Latest Trunk Toolchain Missing `lib_SwiftSyntaxMacros.dylib` for arm64?

I'm trying to use the latest Swift Trunk Development toolchain builds (from December 4th and 5th), but it seems like lib_SwiftSyntaxMacros.dylib was only built for x86 and not arm64. This causes every swift invocation to fail immediately as shown below:

> export PATH=/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2022-12-05-a.xctoolchain/usr/bin:"${PATH}"
> swift --version
dyld[44267]: Library not loaded: @rpath/lib_SwiftSyntaxMacros.dylib
  Referenced from: <E62B365F-9F56-39E1-8A1E-F9D7D71DE3F9> /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2022-12-05-a.xctoolchain/usr/bin/swift-frontend
  Reason: tried: '/usr/lib/swift/lib_SwiftSyntaxMacros.dylib' (no such file, not in dyld cache), '/System/Volumes/Preboot/Cryptexes/OS/usr/lib/swift/lib_SwiftSyntaxMacros.dylib' (no such file), '/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2022-12-05-a.xctoolchain/usr/lib/swift/host/lib_SwiftSyntaxMacros.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/usr/lib/swift/lib_SwiftSyntaxMacros.dylib' (no such file, not in dyld cache), '/System/Volumes/Preboot/Cryptexes/OS/usr/lib/swift/lib_SwiftSyntaxMacros.dylib' (no such file), '/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2022-12-05-a.xctoolchain/usr/lib/swift/host/lib_SwiftSyntaxMacros.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS@rpath/lib_SwiftSyntaxMacros.dylib' (no such file), '/usr/lib/swift/lib_SwiftSyntaxMacros.dylib' (no such file, not in dyld cache), '/System/Volumes/Preboot/Cryptexes/OS/usr/lib/swift/lib_SwiftSyntaxMacros.dylib' (no such file), '/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2022-12-05-a.xctoolchain/usr/lib/swift/host/lib_SwiftSyntaxMacros.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/usr/lib/swift/lib_SwiftSyntaxMacros.dylib' (no such file, not in dyld cache), '/System/Volumes/Preboot/Cryptexes/OS/usr/lib/swift/lib_SwiftSyntaxMacros.dylib' (no such file), '/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2022-12-05-a.xctoolchain/usr/lib/swift/host/lib_SwiftSyntaxMacros.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/usr/lib/lib_SwiftSyntaxMacros.dylib' (no such file, not in dyld cache)
[1]    44267 abort      swift --version

I am on macOS Version 13.0.1 (22A400) on an M1 Pro MacBook Pro.

Am I using it wrong, or will this be fixed again with the next toolchain builds? Is there a simple fix I could apply in the meantime?

Thanks for your help!

Can confirm this, I am having the same issue.

@Douglas_Gregor sorry to tag you, but are you aware of this?

I am, and I'm looking into it today. I suspect a CMake bug that's tripped us up before, and if it's that---the workaround is simple.

Doug

2 Likes

Update: this took longer than I'd hoped, but the fix is finally merged and the toolchain built in the PR has the right content in it. Thanks for your patience, everyone.

Doug

5 Likes