swift-openapi-generator icon indicating copy to clipboard operation
swift-openapi-generator copied to clipboard

Xcode 26 Beta - Unsupported Configuration Issue

Open jdisho opened this issue 6 months ago • 14 comments

Description

Hi there 👋

I just tried building the project using Xcode 26 Beta, and I ran into this new compile-time error:

unsupported configuration: the aggregate target 'OpenAPIGenerator' has package dependencies, but targets that build for different platforms depend on it

Just wanted to flag this in case others are seeing the same thing or if there's already a known workaround.

Image Image

Reproduction

  1. Trust & Enable Plugin
  2. Command + B / R

Package version(s)

Image

Expected behavior

It should work as it was working on Xcode 16.

Environment

swift-driver version: 1.127.4.2 Apple Swift version 6.2 (swiftlang-6.2.0.9.909 clang-1700.3.9.907)
Target: arm64-apple-macosx26.0

Additional information

No response

jdisho avatar Jun 12 '25 06:06 jdisho

Hi @jdisho,

you seem to be trying to compile the generator for iOS, but only the runtime and the transports work on iOS. The generator tool works on macOS and on Linux, as it runs at build time.

If you follow this tutorial carefully, it calls out which products you should and shouldn't link: https://swiftpackageindex.com/apple/swift-openapi-generator/1.8.0/tutorials/swift-openapi-generator/clientxcode

czechboy0 avatar Jun 12 '25 10:06 czechboy0

Thank you for your support @czechboy0

I’ll take another look later in case I missed something, but this setup works in Xcode 16.

jdisho avatar Jun 12 '25 10:06 jdisho

I see, in that case please file a bug on Xcode using feedbackassistant.apple.com, thanks!

czechboy0 avatar Jun 12 '25 10:06 czechboy0

I also have the same compilation problem as follow descirbed:

Image

maybe, this is bug of Xcode 26, it works on Xcode 16.3

wangzhizhou avatar Jun 13 '25 17:06 wangzhizhou

Yes please use feedback assistant to file the issue on Xcode. This package has no control over which targets the build system links it with.

czechboy0 avatar Jun 13 '25 18:06 czechboy0

Seems like an Xcode or SPM issue, but I think it makes sense to leave this issue here open so others can see this and avoid creating the same issue again. If this does not make sense, feel free to close it 👍

jdisho avatar Jun 14 '25 07:06 jdisho

Yes happy to keep this open until there's a fixed version we can point to.

czechboy0 avatar Jun 14 '25 12:06 czechboy0

I’ve also encountered build issues with Xcode 26, getting Command CompileSwift failed with a nonzero exit code. Reverting to a Swift OpenAPI Generator version earlier than 1.6 seems to temporarily resolve the issue.

Onnwen avatar Jun 14 '25 14:06 Onnwen

Hi @Onnwen - can you share which exact version of Swift OpenAPI Generator built successfully with Xcode 26 for you?

czechboy0 avatar Jun 15 '25 05:06 czechboy0

Hi @Onnwen - can you share which exact version of Swift OpenAPI Generator built successfully with Xcode 26 for you?

Version 1.5.0

Onnwen avatar Jun 16 '25 16:06 Onnwen

I'm running into a similar issue as @Onnwen. I've filed a report to Apple through the Feedback Assistant, but figured I would also post here for folks interested. Let me know if I should file as a separate issue or if you'd prefer we keep all Xcode 26 Beta related issues in here.


When setting up a SwiftPackage library to generate client code from a simple openapi spec using SwiftOpenAPIGenerator 1.8.0 in Xcode 26, the build fails with “Command SwiftCompile failed with a nonzero exit code”. This happens even when the swift-tools-version is set to a version earlier than 6.2. The full exported build error is attached, along with a basic repro project.

When opening and building this exact same project in Xcode 16.4, there is no error.

Given the specifics at the start of the stack trace:

  1. Apple Swift version 6.2 (swiftlang-6.2.0.9.909 clang-1700.3.9.907)
  2. Compiling with effective version 5.10
  3. While evaluating request ExecuteSILPipelineRequest(Run pipelines { Mandatory Diagnostic Passes + Enabling Optimization Passes } on SIL for _OpenAPIGeneratorCore)
  4. While running pass #​359 SILFunctionTransform "SendNonSendable" on SILFunction "@$s21_OpenAPIGeneratorCore14FileTranslatorPAAE29isObjectishSchemaAndSupported_14referenceStackAA02IshJ6ResultO0A6APIKit10JSONSchemaV_AA09ReferenceL0VztKF". for 'isObjectishSchemaAndSupported(_:referenceStack:)' (at /Users/5245479/Library/Developer/Xcode/DerivedData/Xcode26OpenAPIGeneratorError-dhbnfbuhekcygwdbnxjtikjjijkd/SourcePackages/checkouts/swift-openapi-generator/Sources/_OpenAPIGeneratorCore/Translator/TypeAssignment/isSchemaSupported.swift:230:5) Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var LLVM_SYMBOLIZER_PATH to point to it): 0 swift-frontend 0x00000001069d7cb0 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56 1 swift-frontend 0x00000001069d5640 llvm::sys::RunSignalHandlers() + 112 2 swift-frontend 0x00000001069d82dc SignalHandler(int, __siginfo*, void*) + 344 3 libsystem_platform.dylib 0x000000019c1e4624 _sigtramp + 56 4 libsystem_pthread.dylib 0x000000019c1aa88c pthread_kill + 296 5 libsystem_c.dylib 0x000000019c0b3c60 abort + 124 6 swift-frontend 0x000000010177ad7c swift::Partition::assignElement(swift::PartitionPrimitives::Element, swift::PartitionPrimitives::Element, bool) + 96 7 swift-frontend 0x00000001012d5dac swift::RegionAnalysisFunctionInfo::runDataflow() + 5876 8 swift-frontend 0x00000001012d9878 swift::RegionAnalysis::newFunctionAnalysis(swift::SILFunction*) + 1668 9 swift-frontend 0x000000010153aed4 (anonymous namespace)::SendNonSendable::run() + 280 10 swift-frontend 0x000000010157a6cc swift::SILPassManager::runFunctionPasses(unsigned int, unsigned int) + 3332 11 swift-frontend 0x0000000101576740 swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&) + 11988 12 swift-frontend 0x00000001015993d4 swift::SimpleRequest<swift::ExecuteSILPipelineRequest, std::__1::tuple<> (swift::SILPipelineExecutionDescriptor), (swift::RequestFlags)1>::evaluateRequest(swift::ExecuteSILPipelineRequest const&, swift::Evaluator&) + 52 13 swift-frontend 0x000000010157d190 swift::ExecuteSILPipelineRequest::OutputType swift::Evaluator::getResultUncached<swift::ExecuteSILPipelineRequest, swift::ExecuteSILPipelineRequest::OutputType swift::evaluateOrFatalswift::ExecuteSILPipelineRequest(swift::Evaluator&, swift::ExecuteSILPipelineRequest)::'lambda'()>(swift::ExecuteSILPipelineRequest const&, swift::ExecuteSILPipelineRequest::OutputType swift::evaluateOrFatalswift::ExecuteSILPipelineRequest(swift::Evaluator&, swift::ExecuteSILPipelineRequest)::'lambda'()) + 412 14 swift-frontend 0x000000010157f76c swift::runSILDiagnosticPasses(swift::SILModule&) + 416 15 swift-frontend 0x0000000100a30e4c swift::CompilerInstance::performSILProcessing(swift::SILModule*) + 656 16 swift-frontend 0x000000010064cad0 performCompileStepsPostSILGen(swift::CompilerInstance&, std::__1::unique_ptr<swift::SILModule, std::__1::default_deleteswift::SILModule>, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) + 1360 17 swift-frontend 0x000000010064bdbc swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 1032 18 swift-frontend 0x000000010064f0e0 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 1764 19 swift-frontend 0x000000010064dcfc swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3580 20 swift-frontend 0x00000001005cf390 swift::mainEntry(int, char const**) + 5412 21 dyld 0x000000019be0ab98 start + 6076

I would hazard a guess that this is an issue with how the Swift 6.2 compiler compiles with lower effective Swift versions, and is largely on the Swift / Apple side of things to resolve. Still, the more info the better, right?

Here are the files: Build GeneratorError_2025-06-16T13-25-05.txt Xcode26OpenAPIGeneratorError.zip

dan-magnusson-lowes avatar Jun 16 '25 20:06 dan-magnusson-lowes

@dan-magnusson-lowes the crasher is tracked separately, and has been fixed in Swift already: https://github.com/apple/swift-openapi-generator/issues/781

czechboy0 avatar Jun 16 '25 21:06 czechboy0

I’m running into the same issue now that the Xcode 26 beta 1 compiler crash has been fixed:

unsupported configuration: the aggregate target 'OpenAPIGenerator' has package dependencies, but targets that build for different platforms depend on it

Is there a workaround to make it compile until this is hopefully addressed in beta 3?

Edit: actually I found a "workaround" based on this comment: https://github.com/swiftlang/swift-build/issues/614

If any (custom / additional) toolchain is installed (Swift, Metal) this problem will arise. Without (the metal toolchain in my case), the project compiles just fine.

frogg avatar Jun 26 '25 12:06 frogg

Fixed for me in Beta 3

FrankSolleveld avatar Jul 09 '25 06:07 FrankSolleveld