apple / swift-atomics

Low-level atomic operations for Swift
Apache License 2.0
1.08k stars 52 forks source link

Compilation for iOS in release mode fails #33

Closed 0ax1 closed 3 years ago

0ax1 commented 3 years ago

swift-atomics doesn't compile for iOS in release mode when building with Xcode (but succeeds in debug).

Information

Checklist

Steps to Reproduce

Create a new iOS project from the App template in Xcode, add the swift-atomics package as a dependency under Package Dependencies (using branch: main) and set the build configuration in Edit Scheme... to Release.

Expected behavior

The build for iOS in release mode succeeds.

Actual behavior

The build for iOS in release mode fails with the following 2 errors:

1.)
CompileC /Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/Build/Intermediates.noindex/swift-atomics.build/Release-iphonesimulator/_AtomicsShims.build/Objects-normal/i386/_AtomicsShims.o /Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/SourcePackages/checkouts/swift-atomics/Sources/_AtomicsShims/src/_AtomicsShims.c normal i386 c com.apple.compilers.llvm.clang.1_0.compiler (in target '_AtomicsShims' from project 'swift-atomics')
    cd /Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/SourcePackages/checkouts/swift-atomics
    export LANG\=en_US.US-ASCII
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c -target i386-apple-ios9.0-simulator -fmessage-length\=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -fmodules -gmodules -fmodules-cache-path\=/Users/lx/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -fmodules-prune-interval\=86400 -fmodules-prune-after\=345600 -fbuild-session-file\=/Users/lx/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror\=non-modular-include-in-framework-module -fmodule-name\=_AtomicsShims -fapplication-extension -Wno-trigraphs -fpascal-strings -Os -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -DSWIFT_PACKAGE -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -g -Wno-sign-conversion -Wno-infinite-recursion -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-semicolon-before-method-body -I/Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/Build/Products/Release-iphonesimulator/include -I/Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/SourcePackages/checkouts/swift-atomics/Sources/_AtomicsShims/include -I/Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/Build/Intermediates.noindex/swift-atomics.build/Release-iphonesimulator/_AtomicsShims.build/DerivedSources-normal/i386 -I/Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/Build/Intermediates.noindex/swift-atomics.build/Release-iphonesimulator/_AtomicsShims.build/DerivedSources/i386 -I/Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/Build/Intermediates.noindex/swift-atomics.build/Release-iphonesimulator/_AtomicsShims.build/DerivedSources -F/Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/Build/Products/Release-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks -iframework /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/Developer/Library/Frameworks -DXcode -MMD -MT dependencies -MF /Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/Build/Intermediates.noindex/swift-atomics.build/Release-iphonesimulator/_AtomicsShims.build/Objects-normal/i386/_AtomicsShims.d --serialize-diagnostics /Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/Build/Intermediates.noindex/swift-atomics.build/Release-iphonesimulator/_AtomicsShims.build/Objects-normal/i386/_AtomicsShims.dia -c /Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/SourcePackages/checkouts/swift-atomics/Sources/_AtomicsShims/src/_AtomicsShims.c -o /Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/Build/Intermediates.noindex/swift-atomics.build/Release-iphonesimulator/_AtomicsShims.build/Objects-normal/i386/_AtomicsShims.o

In file included from /Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/SourcePackages/checkouts/swift-atomics/Sources/_AtomicsShims/src/_AtomicsShims.c:13:
/Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/SourcePackages/checkouts/swift-atomics/Sources/_AtomicsShims/include/_AtomicsShims.h:339:28: error: unknown type name '__uint128_t'
_sa_dword _sa_decode_dword(__uint128_t value) {
                           ^
1 error generated.
2.)
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'Atomics' from project 'swift-atomics')
    cd /Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/SourcePackages/checkouts/swift-atomics
    export DEVELOPER_DIR\=/Applications/Xcode.app/Contents/Developer
    export SDKROOT\=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -incremental -module-name Atomics -O -whole-module-optimization -enforce-exclusivity\=checked @/Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/Build/Intermediates.noindex/swift-atomics.build/Release-iphonesimulator/Atomics.build/Objects-normal/arm64/Atomics.SwiftFileList -DSWIFT_PACKAGE -DXcode -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk -target arm64-apple-ios9.0-simulator -g -module-cache-path /Users/lx/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -Xfrontend -serialize-debugging-options -application-extension -swift-version 5 -I /Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/Build/Products/Release-iphonesimulator -I /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/lib -F /Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/Build/Products/Release-iphonesimulator/PackageFrameworks -F /Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/Build/Products/Release-iphonesimulator -F /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks -F /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/Developer/Library/Frameworks -c -num-threads 8 -output-file-map /Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/Build/Intermediates.noindex/swift-atomics.build/Release-iphonesimulator/Atomics.build/Objects-normal/arm64/Atomics-OutputFileMap.json -parseable-output -serialize-diagnostics -emit-dependencies -emit-module -emit-module-path /Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/Build/Intermediates.noindex/swift-atomics.build/Release-iphonesimulator/Atomics.build/Objects-normal/arm64/Atomics.swiftmodule -Xcc -I/Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/Build/Intermediates.noindex/swift-atomics.build/Release-iphonesimulator/Atomics.build/swift-overrides.hmap -Xcc -I/Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/SourcePackages/checkouts/swift-atomics/Sources/_AtomicsShims/include -Xcc -I/Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/Build/Products/Release-iphonesimulator/include -Xcc -I/Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/Build/Intermediates.noindex/swift-atomics.build/Release-iphonesimulator/Atomics.build/DerivedSources-normal/arm64 -Xcc -I/Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/Build/Intermediates.noindex/swift-atomics.build/Release-iphonesimulator/Atomics.build/DerivedSources/arm64 -Xcc -I/Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/Build/Intermediates.noindex/swift-atomics.build/Release-iphonesimulator/Atomics.build/DerivedSources -Xcc -DSWIFT_PACKAGE -emit-objc-header -emit-objc-header-path /Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/Build/Intermediates.noindex/swift-atomics.build/Release-iphonesimulator/Atomics.build/Objects-normal/arm64/Atomics-Swift.h -working-directory /Users/lx/Library/Developer/Xcode/DerivedData/ldsdhs-bzmdchssanulrqdlkqewpmdcmpmq/SourcePackages/checkouts/swift-atomics

remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
Command CompileSwiftSources failed with a nonzero exit code
lorentey commented 3 years ago

Ah, this is a regression introduced in #26. It seems we will need to beef up CI coverage.

0ax1 commented 3 years ago

Thanks so much for looking into it, much appreciated!

lorentey commented 3 years ago

Submitted a PR with the fix -- apologies for not catching this earlier.

0ax1 commented 3 years ago

Awesome, that was a super fast fix, thanks again!