Skip to content

6.2 OSS toolchain failed to find libswiftCompatibilitySpan.dylib in testing #9163

@ainame

Description

@ainame

Description

A SPM project with swift-subprocess (main branch or 0.1) failed to run "swift test".
https://github.com/ainame/swift-subprocess-fails-to-run-testing/

% swift test
[1/1] Planning build
Building for debugging...
[25/25] Compiling Subprocess Thread.swift
Build complete! (2.23s)
Test Suite 'All tests' started at 2025-09-20 01:16:02.008.
Test Suite 'All tests' passed at 2025-09-20 01:16:02.009.
	 Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.001) seconds
swiftpm_testing_helper/Entrypoint.swift:34: Fatal error: Failed to open test bundle at path /Users/ainame/ghq/github.com/ainame/swift-6.2-test/.build/arm64-apple-macosx/debug/swift-6.2-testPackageTests.xctest/Contents/MacOS/swift-6.2-testPackageTests: dlopen(/Users/ainame/ghq/github.com/ainame/swift-6.2-test/.build/arm64-apple-macosx/debug/swift-6.2-testPackageTests.xctest/Contents/MacOS/swift-6.2-testPackageTests, 0x0101): Library not loaded: @rpath/libswiftCompatibilitySpan.dylib
  Referenced from: <FACAF584-A249-3974-818B-3974660C3121> /Users/ainame/ghq/github.com/ainame/swift-6.2-test/.build/arm64-apple-macosx/debug/swift-6.2-testPackageTests.xctest/Contents/MacOS/swift-6.2-testPackageTests
  Reason: tried: '/Users/ainame/Library/Developer/Toolchains/swift-6.2-RELEASE.xctoolchain/usr/lib/swift/macosx/testing/libswiftCompatibilitySpan.dylib' (no such file), '/Applications/Xcode-26.0.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/libswiftCompatibilitySpan.dylib' (no such file), '/Users/ainame/ghq/github.com/ainame/swift-6.2-test/.build/arm64-apple-macosx/debug/swift-6.2-testPackageTests.xctest/Contents/MacOS/../../../libswiftCompatibilitySpan.dylib' (no such file), '/Users/ainame/ghq/github.com/ainame/swift-6.2-test/.build/arm64-apple-macosx/debug/swift-6.2-testPackageTests.xctest/Contents/MacOS/../../../libswiftCompatibilitySpan.dylib' (no such file), '/Users/ainame/Library/Developer/Toolchains/swift-6.2-RELEASE.xctoolchain/usr/libexec/swift/lib/libswiftCompatibilitySpan.dylib' (no such file), '/Users/ainame/Library/Developer/Toolchains/swift-6.2-RELEASE.xctoolchain/usr/libexec/swift/lib/libswiftCompatibilitySpan.dylib' (no such file)
error: Exited with unexpected signal code 5

It tried to dlopen /Users/xxx/Library/Developer/Toolchains/swift-6.2-RELEASE.xctoolchain/usr/lib/swift/macosx/testing/libswiftCompatibilitySpan.dylib but libswiftCompatibilitySpan.dylib only exists at /Users/xxx/Library/Developer/Toolchains/swift-6.2-RELEASE.xctoolchain/usr/lib/swift/macosx/libswiftCompatibilitySpan.dylib (/testing directory was redundant)

Reproduction

Expected behavior

"swift test" should succeed to run with 6.2 OSS toolchain.

Environment

  • macOS 26
  • swiftly 1.0.1
  • swift-6.2-RELEASE toolchains
% swift --version
 Apple Swift version 6.2 (swift-6.2-RELEASE)
 Target: arm64-apple-macosx26.0
 Build config: +assertions

Additional information

Originally reported this to swift-subprocess but I saw other people faced similar issue with different package. I assume this is toolchain issue.

swiftlang/swift-subprocess#183
swiftlang/swift#84379 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions