I decided to take the new llbuild preview builder for a spin in Xcode 9.x with a mixed-objective c and swift project but it failed to find certain system headers (os/os.log) that is in the base SDK. I created a small swift test project and sure enough, the new builder incorrectly sets the SDKROOT
to the Deployment Target SDK and not the Base SDK. The legacy builder correctly sets SDKROOT
to the Base SDK.
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
cd /Users/blacey/Projects/LoggingTest
export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk
export SWIFTC="Apple Swift version 4.0.3 (swiftlang-900.0.74.1 clang-900.0.39.2)
Target: x86_64-apple-macosx10.9"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -incremental -module-name LoggingTest -Onone -enforce-exclusivity=checked -DDEBUG -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -target x86_64-apple-macosx10.10 -g -module-cache-path /Users/blacey/Library/Developer/Xcode/DerivedData/ModuleCache -Xfrontend -serialize-debugging-options -enable-testing -index-store-path /Users/blacey/Library/Developer/Xcode/DerivedData/LoggingTest-cuitstdxqxisifaujhctsafcrqkq/Index/DataStore -Xfrontend -report-errors-to-debugger -swift-version 4 -I /Users/blacey/Library/Developer/Xcode/DerivedData/LoggingTest-cuitstdxqxisifaujhctsafcrqkq/Build/Products/Debug -F /Users/blacey/Library/Developer/Xcode/DerivedData/LoggingTest-cuitstdxqxisifaujhctsafcrqkq/Build/Products/Debug -parse-as-library -c -j8 /Users/blacey/Projects/LoggingTest/LoggingTest/AppDelegate.swift -output-file-map /Users/blacey/Library/Developer/Xcode/DerivedData/LoggingTest-cuitstdxqxisifaujhctsafcrqkq/Build/Intermediates.noindex/LoggingTest.build/Debug/LoggingTest.build/Objects-normal/x86_64/LoggingTest-OutputFileMap.json -parseable-output -serialize-diagnostics -emit-dependencies -emit-module -emit-module-path /Users/blacey/Library/Developer/Xcode/DerivedData/LoggingTest-cuitstdxqxisifaujhctsafcrqkq/Build/Intermediates.noindex/LoggingTest.build/Debug/LoggingTest.build/Objects-normal/x86_64/LoggingTest.swiftmodule -Xcc -I/Users/blacey/Library/Developer/Xcode/DerivedData/LoggingTest-cuitstdxqxisifaujhctsafcrqkq/Build/Intermediates.noindex/LoggingTest.build/Debug/LoggingTest.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/blacey/Library/Developer/Xcode/DerivedData/LoggingTest-cuitstdxqxisifaujhctsafcrqkq/Build/Intermediates.noindex/LoggingTest.build/Debug/LoggingTest.build/LoggingTest-generated-files.hmap -Xcc -I/Users/blacey/Library/Developer/Xcode/DerivedData/LoggingTest-cuitstdxqxisifaujhctsafcrqkq/Build/Intermediates.noindex/LoggingTest.build/Debug/LoggingTest.build/LoggingTest-own-target-headers.hmap -Xcc -I/Users/blacey/Library/Developer/Xcode/DerivedData/LoggingTest-cuitstdxqxisifaujhctsafcrqkq/Build/Intermediates.noindex/LoggingTest.build/Debug/LoggingTest.build/LoggingTest-all-target-headers.hmap -Xcc -iquote -Xcc /Users/blacey/Library/Developer/Xcode/DerivedData/LoggingTest-cuitstdxqxisifaujhctsafcrqkq/Build/Intermediates.noindex/LoggingTest.build/Debug/LoggingTest.build/LoggingTest-project-headers.hmap -Xcc -I/Users/blacey/Library/Developer/Xcode/DerivedData/LoggingTest-cuitstdxqxisifaujhctsafcrqkq/Build/Products/Debug/include -Xcc -I/Users/blacey/Library/Developer/Xcode/DerivedData/LoggingTest-cuitstdxqxisifaujhctsafcrqkq/Build/Intermediates.noindex/LoggingTest.build/Debug/LoggingTest.build/DerivedSources/x86_64 -Xcc -I/Users/blacey/Library/Developer/Xcode/DerivedData/LoggingTest-cuitstdxqxisifaujhctsafcrqkq/Build/Intermediates.noindex/LoggingTest.build/Debug/LoggingTest.build/DerivedSources -Xcc -DDEBUG=1 -emit-objc-header -emit-objc-header-path /Users/blacey/Library/Developer/Xcode/DerivedData/LoggingTest-cuitstdxqxisifaujhctsafcrqkq/Build/Intermediates.noindex/LoggingTest.build/Debug/LoggingTest.build/Objects-normal/x86_64/LoggingTest-Swift.h -Xcc -working-directory/Users/blacey/Projects/LoggingTest
<unknown>:0: error: Swift does not support the SDK 'MacOSX10.10.sdk'
Command CompileSwiftSources failed with a nonzero exit code
Does anyone know how to work-around this problem?