Skip to content

Fix --no-xcodebuild universal builds (waiting on upstream fix) #94

@stackotter

Description

@stackotter

At the moment, use of .swiftLanguageMode(_:) swift setting in package manifests results in build failures when targeting multiple architectures at once (i.e. performing a universal build). The upstream issue was first reported in swiftlang/swift-package-manager#7958.

SwiftPM PR 9001 along with the adoption of the new swift-build based build system should fix the upstream issue.

I'm not sure if there's anything that we can do before then, other than work around the issue.

Workaround

To work around the issue, use the --xcodebuild command line flag. This uses xcodebuild instead of SwiftPM under the hood. Notice that despite my best efforts, there won't necessarily be 100% parity between the resource bundling behaviour for SwiftPM-based and xcodebuild-based builds.

swift bundler bundle --universal --xcodebuild

Versions

$ xcodebuild -version
Xcode 16.4
Build version 16F6

$ swift --version
swift-driver version: 1.120.5 Apple Swift version 6.1.2 (swiftlang-6.1.2.1.2 clang-1700.0.13.5)
Target: arm64-apple-macosx15.0

I have not had the chance to test out this issue under newer Xcode versions. If someone with a newer Xcode version could try to reproduce this issue I would be interested to know the results.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions