Can't build for arm64 using the 5.5 open-source toolchain

I'm testing a Swift Package Manager project on macOS arm64.

When I build the project using the Xcode toolchain, I can build for x86_64 and arm64 just by using the arch utility:

$ arch -arm64 swift test

However if I pass the --toolchain argument and the path to the open-source 5.5 toolchain, it causes errors:

$ arch -arm64 swift test --toolchain /Users/me/Library/Developer/Toolchains/swift-5*
xctest[48397:944809] The bundle “MyPackageTests.xctest” couldn’t be loaded because it doesn’t contain a version for the current architecture. Try installing a universal version of the bundle.
xctest[48397:944809] (dlopen_preflight(/Users/me/Documents/MyPackage/.build/x86_64-apple-macosx/debug/MyPackageTests.xctest/Contents/MacOS/MyPackageTests): no suitable image found.  Did find:
        /Users/me/Documents/MyPackage/.build/x86_64-apple-macosx/debug/MyPackageTests.xctest/Contents/MacOS/MyPackageTests: mach-o, but wrong architecture
        /Users/me/Documents/MyPackage/.build/x86_64-apple-macosx/debug/MyPackageTests.xctest/Contents/MacOS/MyPackageTests: mach-o, but wrong architecture)
The terminal process "arch" '-arm64' 'swift' 'test', '--toolchain', '/Users/me/Library/Developer/Toolchains/swift-5.5-RELEASE.xctoolchain'" terminated with exit code: 1.

Any idea why this is? Does the open source toolchain not support arm64 right now?

Terms of Service

Privacy Policy

Cookie Policy