libswiftCompatibilitySpan.dylib missing in XCode 26.3

A macOS privileged helper tool that uses SubProcess crashes on intel Macs (running macOS 13 - 15: unable to test on macOS 26 on intel) with the error that libswiftCompatibilitySpan.dylib cannot be loaded when built with XCode 26.3. The same helper tool works as expected with XCode 26.2.

The helper is installed using SMAppService.

When I remove the dependency for SubProcess, the crash no longer occurs (but important functionality is also disabled).

The helper is installed using SMAppService.

Is it using the BundleProgram property, so that the system runs the privileged helper tool from within the app bundle?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Yes, it's using the BundleProgram property.

OK.

When you run this command, what do you see:

% find YourApp.app -name "libswiftCompatibilitySpan.dylib"
YourApp.app/Contents/Frameworks/libswiftCompatibilitySpan.dylib

libswiftCompatibilitySpan.dylib exists to provide Span support on older systems. AFAICT it’s expected to work on Intel Macs running 13.1 or later:

% vtool -show-build Test817488.app/Contents/Frameworks/libswiftCompatibilitySpan.dylib
Test817488.app/Contents/Frameworks/libswiftCompatibilitySpan.dylib (architecture x86_64):
Load command 10
      cmd LC_BUILD_VERSION
  cmdsize 32
 platform MACOS
    minos 13.1
      sdk 26.2
   ntools 1
     tool LD
  version 1230.1
…

And I tested it here in my office, on both 26.2 (Rosetta) and 13.6.1 (real hardware), and I didn’t have a problem. However, that was from my main app, not from a privileged helper tool, so it’s possible that there’s something specific to privileged helper tools in play here.

My test code is pasted in at the end of this email. If you temporarily add this to your app, does it work on the same Intel Mac?

And with that in place, does your helper tool spontaneously start working?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"


func runTest() {
    print("AppDelegate.testAction(_:)")
    Task {
        do {
            print("will list")
            let result = try await run(.name("ls"), output: .string(limit: 4096))
            print("did list, \(result)")
        } catch {
            print("did not list, \(error)")
        }
    }
}
libswiftCompatibilitySpan.dylib missing in XCode 26.3
 
 
Q