Embedded swift Build errors on macOS 26, XCode 26

Seems I chose a bad time to start with embedded swift.

After resolving various errors I am now stuck with errors like:
error: Invalid manifest (compiled with: ["~/Library/Developer/Toolchains/swift-6.1.3-RELEASE.xctoolchain/usr/bin/swiftc"
and
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/DarwinFoundation1.modulemap:306:8: error: module '_c_standard_library_obsolete' requires feature 'found_incompatible_headers__check_search_paths'

It seems this is because of latest version of XCode that is leaving me slightly stumped. I thought there would be no dependency, and that it would not even be needed. I tried installing older command line tools, but it cannot because “The version of macOS is too new.”

Can it really be that the new XCode is the issue, and if so, how can I fix it?

Do you get the same thing with a Swift 6.2 snapshot toolchain?

Yes, I get the same error after switching to 6.2-dev (LLVM e9c1512e54bde18, Swift 04ed96021884c7a).
It was a lot more painful though, because I also got concurrency errors that I had to remove first.
Knowing that I get the same error in 6.2 does not give me any more insight into my problem, or am I missing something?

I got the same error while building Swift WASM library with 6.1 toolchain. Solution that worked for me was to use macOS 15.5 SDK from XCode 16.4. Then override default SDK root with:

export SDKROOT=/Applications/Xcode164.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk where Xcode164.app is the name of your XCode 16.4 app bundle (I had to rename it to let it coexist with XCode 26. Hope that helps with your problem.

Wasm and Embedded Swift are not supported in the Xcode toolchain, you'll have to use toolchains from swift.org (usually installed via swiftly). Please follow the getting started guide for Wasm, which contains recommended instructions.

@Max_Desiatov Yes, I’m well aware of that and am successfully using 6.1-RELEASE-wasm32-unknown-wasi. But with XCode 26 installed on my machine, my build system stopped working with the error mentioned above. I was able to fix it with SDKROOT override, pointing to older SDK. I suspect that this solution should work for embedded switft as well.

BTW, thanks for your great work on Swift WASM and related tools! Saved us a bunch of time porting iOS component to web.

1 Like