swift-atomics
swift-atomics copied to clipboard
Swift atomics fails to compile running `xcodebuild` with `OTHER_SWIFT_FLAGS`
Problem
Swift atomics fails to compile running xcodebuild with OTHER_SWIFT_FLAGS.
For example:
$ xcodebuild build OTHER_SWIFT_FLAGS="-suppress-warnings"
...
<SNIP>/Sources/Atomics/Conformances/autogenerated/AtomicBool.swift:22:8: error: no such module 'Builtin'
import Builtin
^
** BUILD FAILED **
The following build commands failed:
CompileSwift normal arm64 (in target 'Atomics' from project 'swift-atomics')
...
However removing OTHER_SWIFT_FLAGS succeeds, the target depending on swift-atomics compiles successfully.
The following command works:
$ xcodebuild build
...
** BUILD SUCCEEDED **
FWIW, any value for OTHER_SWIFT_FLAGS fails in the above way. For example xcodebuild build OTHER_SWIFT_FLAGS="baz" also fails.
Information
$ xcodebuild -version
Xcode 15.1
Build version 15C65
$ swift -version
swift-driver version: 1.87.3 Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
Resolved source packages:
swift-atomics: https://github.com/apple/swift-atomics.git @ 1.2.0
Checklist
- [x] If possible, I've reproduced the issue using the
mainbranch of this package. - [X] I've searched for existing reports of the same issue.
Steps to Reproduce
- Using the above version of Xcode create a new iOS app project
- Add swift atomics as a dependancy (File > Add Package Dependencies > swift-atomics)
- Run
xcodebuild build OTHER_SWIFT_FLAGS="-suppress-warnings"💥 , get the above error.
Expected behavior
Project compiles
Actual behavior
Project fails to compile with the following error:
<SNIP>/Sources/Atomics/Conformances/autogenerated/AtomicBool.swift:22:8: error: no such module 'Builtin'
import Builtin
^
** BUILD FAILED **
The following build commands failed:
CompileSwift normal arm64 (in target 'Atomics' from project 'swift-atomics')
Thanks in advance for any help.