Hi all, I am unable to build upstream swift compiler on my Mac since I upgraded to XCode 16. I get the following error.
Pretty new to Swift so kindly let me know how to diagnose/debug this. Thx.
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/lib/swift/_math.swiftmodule/arm64e-apple-macos.swiftinterface:302:23: error: broken standard library: cannot find intrinsic operations on UnsafeMutablePointer<T>
300 | @available(swift, deprecated: 4.2, message: "use Float(nan: Float.RawSignificand).")
301 | @_transparent public func nan(_ tag: Swift.String) -> Swift.Float {
302 | return Float(nanf(tag))
| `- error: broken standard library: cannot find intrinsic operations on UnsafeMutablePointer<T>
303 | }
304 | @available(macOS 10.9, iOS 7.0, watchOS 2.0, tvOS 9.0, bridgeOS 7.0, visionOS 1.0, *)
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/lib/swift/_math.swiftmodule/arm64e-apple-macos.swiftinterface: 0:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/lib/swift/_math.swiftmodule/arm64e-apple-macos.swiftinterface: 0:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/lib/swift/_math.swiftmodule/arm64e-apple-macos.swiftinterface: 0:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/lib/swift/_math.swiftmodule/arm64e-apple-macos.swiftinterface: 0:
<unknown>:0: error: module 'Swift' cannot be imported because it was built with embedded Swift
<unknown>:0: error: module 'Swift' cannot be imported because it was built with embedded Swift
[1624/1770][ 91%][625.276s] Compiling /Users/peterrong/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/stdlib/public/core//OSX/arm64/Swift.o
ninja: build stopped: subcommand failed.
ERROR: command `['caffeinate', '/Users/peterrong/swift-project/swift/utils/build-script-impl', '--workspace', '/Users/peterrong/swift-project', '--build-dir', '/Users/peterrong/swift-project/build/Ninja-RelWithDebInfoAssert', '--install-prefix', '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr', '--host-target', 'macosx-arm64', '--stdlib-deployment-targets=macosx-arm64', '--host-cc', '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang', '--host-cxx', '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++', '--darwin-xcrun-toolchain', 'default', '--darwin-deployment-version-osx=13.0', '--darwin-deployment-version-ios=16.0', '--darwin-deployment-version-tvos=16.0', '--darwin-deployment-version-watchos=9.0', '--darwin-deployment-version-xros=1.0', '--cmake', '/opt/homebrew/bin/cmake', '--llvm-build-type', 'RelWithDebInfo', '--swift-build-type', 'RelWithDebInfo', '--swift-stdlib-build-type', 'RelWithDebInfo', '--lldb-build-type', 'RelWithDebInfo', '--foundation-build-type', 'RelWithDebInfo', '--libdispatch-build-type', 'RelWithDebInfo', '--xctest-build-type', 'RelWithDebInfo', '--llbuild-build-type', 'RelWithDebInfo', '--swift-enable-assertions', 'true', '--swift-stdlib-enable-assertions', 'true', '--swift-analyze-code-coverage', 'false', '--llbuild-enable-assertions', 'true', '--lldb-assertions', 'true', '--cmake-generator', 'Ninja', '--cross-compile-append-host-target-to-destdir', 'true', '--build-jobs', '16', '--lit-jobs', '16', '--common-cmake-options=-G Ninja -DCMAKE_C_COMPILER:PATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -DCMAKE_CXX_COMPILER:PATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -DCMAKE_Swift_COMPILER:PATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -DCMAKE_LIBTOOL:PATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -DCMAKE_AR:PATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar -DCMAKE_RANLIB:PATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib -DLLVM_VERSION_MAJOR:STRING=17 -DLLVM_VERSION_MINOR:STRING=0 -DLLVM_VERSION_PATCH:STRING=0 -DCLANG_VERSION_MAJOR:STRING=17 -DCLANG_VERSION_MINOR:STRING=0 -DCLANG_VERSION_PATCH:STRING=0 -DCMAKE_MAKE_PROGRAM=/opt/homebrew/bin/ninja', '--build-args=-j16', '--dsymutil-jobs', '1', '--build-swift-libexec', 'true', '--swift-enable-backtracing', 'true', '--build-swift-clang-overlays', 'true', '--build-swift-remote-mirror', 'true', '--swift-cmake-options=-DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE -DSWIFT_FORCE_OPTIMIZED_TYPECHECKER:BOOL=FALSE -DSWIFT_STDLIB_ENABLE_STDLIBCORE_EXCLUSIVITY_CHECKING:BOOL=FALSE -DSWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING:BOOL=TRUE -DSWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY:BOOL=TRUE -DSWIFT_ENABLE_EXPERIMENTAL_CXX_INTEROP:BOOL=TRUE -DSWIFT_ENABLE_CXX_INTEROP_SWIFT_BRIDGING_HEADER:BOOL=TRUE -DSWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED:BOOL=TRUE -DSWIFT_ENABLE_EXPERIMENTAL_NONESCAPABLE_TYPES:BOOL=FALSE -DSWIFT_ENABLE_BACKTRACING:BOOL=TRUE -DSWIFT_ENABLE_EXPERIMENTAL_OBSERVATION:BOOL=TRUE -DSWIFT_ENABLE_SYNCHRONIZATION:BOOL=TRUE -DSWIFT_ENABLE_VOLATILE:BOOL=TRUE -DSWIFT_STDLIB_STATIC_PRINT=FALSE -DSWIFT_FREESTANDING_IS_DARWIN:BOOL=FALSE -DSWIFT_STDLIB_BUILD_PRIVATE:BOOL=TRUE -DSWIFT_STDLIB_ENABLE_UNICODE_DATA=TRUE -DSWIFT_SHOULD_BUILD_EMBEDDED_STDLIB=TRUE -DSWIFT_SHOULD_BUILD_EMBEDDED_STDLIB_CROSS_COMPILING=FALSE -DSWIFT_STDLIB_BUILD_SYMBOL_GRAPHS:BOOL=FALSE -DSWIFT_TOOLS_LD64_LTO_CODEGEN_ONLY_FOR_SUPPORTING_TARGETS:BOOL=FALSE -DSWIFT_ENABLE_EXPERIMENTAL_PARSER_VALIDATION:BOOL=FALSE -USWIFT_DEBUGINFO_NON_LTO_ARGS', '--build-stdlib-deployment-targets', 'all', '--ninja-bin=/opt/homebrew/bin/ninja', '--install-destdir', '/Users/peterrong/swift-project/build/Ninja-RelWithDebInfoAssert/toolchain-macosx-arm64', '--skip-build-benchmarks', '--skip-build-foundation', '--skip-build-xctest', '--skip-build-lldb', '--skip-build-llbuild', '--skip-build-libcxx', '--skip-build-libdispatch', '--skip-build-libxml2', '--skip-build-zlib', '--skip-build-curl', '--build-swift-dynamic-stdlib', '--build-swift-dynamic-sdk-overlay', '--skip-build-android', '--skip-test-swift', '--skip-test-lldb', '--skip-test-llbuild', '--skip-test-xctest', '--skip-test-foundation', '--skip-test-libdispatch', '--skip-test-benchmarks', '--android-deploy-device-path', '/data/local/tmp', '--toolchain-prefix', '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain', '--host-lipo', '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo', '--host-libtool', '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool', "--extra-cmake-options=-DSWIFT_DARWIN_SUPPORTED_ARCHS:STRING=arm64 -DSWIFT_DISABLE_DEAD_STRIPPING:BOOL=TRUE -DSWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE:PATH=/Users/peterrong/swift-project/swift-syntax -DSWIFT_BUILD_SWIFT_SYNTAX:BOOL=TRUE -DSWIFTSYNTAX_ENABLE_ASSERTIONS:BOOL=TRUE '-DCMAKE_IGNORE_PATH=/usr/lib;/usr/local/lib;/lib' -DPKG_CONFIG_EXECUTABLE=/usr/bin/false", '--bootstrapping=hosttools', '--llvm-lit-args=-sv --param color_output', '--llvm-install-components=llvm-ar;llvm-cov;llvm-profdata;IndexStore;clang;clang-resource-headers;compiler-rt;clangd;LTO;lld;dsymutil', '--musl-path=/usr/local/musl', '--linux-static-archs=x86_64;aarch64', '--only-execute', 'macosx-arm64-swift-build']` terminated with a non-zero exit status 1, aborting