Regression: Xcode 15 can't build Swift for macOS earlier than 10.15

According to the documentation, Xcode is supposed to be able to build for macOS 10.13 and up. However, this does not seem to be the case in practice; my testers on 10.14.6 have reported random crashes when trying to test my app when built with Xcode 15 beta. I've isolated the code that crashes to a simple test case, and posted it on GitHub Issues, but it seems to have attracted no attention:

I've reproduced the bug in Xcode 15 beta 5, beta 6, and beta 7.

What's more, I decided to spin up a macOS 10.13 VM in UTM to see what would happen there. On 10.13 it doesn't even launch:

dyld: Library not loaded: @rpath/libswiftCore.dylib
  Referenced from: /Users/csrstka/Desktop/crashtest
  Reason: image not found
Abort trap: 6

It seems that Xcode 15 is not correctly including the embedded Swift libraries for use on macOS versions older than 10.15. On macOS 10.14.6, it seems there are embedded Swift libraries in /usr/lib/swift, but they are apparently buggy and not compatible with modern Swift code. The net result is that although it claims to be able to build for 10.13, the effective minimum target is 10.15, and this should either be fixed before release, or the documentation should be updated to reflect the change.

I've also posted a GitHub issue for this, in case it manages to get lucky and attract more attention than the other one did: Regression: Xcode 15 cannot build correctly for macOS versions older than 10.15 · Issue #68163 · apple/swift · GitHub

Command line tools don’t have embedded Swift libraries; the user has to install the “command line support for Swift” package from Apple or something if their OS predates ABI stability. But the crashes on OSs that do have /usr/lib/swift are indeed concerning.

Has that changed? I seem to remember being able to build command-line tools (with fairly large binaries) that had the runtime embedded inside them. Admittedly this was several Swift versions ago.

However, I just tested this with an .app bundle, and it doesn't launch on 10.13 either, because:

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    DYLD, [0x3] Wrong version

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
  Library not loaded: @rpath/libswiftAppKit.dylib
  Referenced from: /Users/USER/Desktop/Pacifist.app/Contents/MacOS/Pacifist
  Reason: Incompatible library version: Pacifist requires version 45.0.0 or later, but libswiftAppKit.dylib provides version 1.0.0

The command-line thing has been that way for a while!

https://support.apple.com/kb/DL1998

But the “incompatible version” error here definitely makes it look like something else has changed. Hopefully a current Apple person will provide an answer soon.

We're seeing this crash on 10.13 for a macOS desktop app. The app uses a Swift Module that's been compiled with 10.13 support but causes the app to crash at launch with this error requires version 45.0.0 or later, but libswiftAppKit.dylib provides version 1.0.0

Any idea what needs to be done other than asking users to install Swift 5 runtime support? This same app worked just fine when compiled with Xcode 14.

1 Like

I can confirm that it still happens with Xcode 15.0. I got alerted after receiving a negative review for my App Store app after publishing an update built with Xcode 15.0, which I thought still supported macOS 10.13. Why does it take so long to fix this issue?

1 Like

This has been confirmed by Apple. Here's Apple's workaround:

2 Likes