ITADN

SwiftBuild: swift test Failed to open test bundle

#9986Openvsarunas 创建于 2026-04-25
bug
V
vsarunascommented
### Is it reproducible with SwiftPM command-line tools: `swift build`, `swift test`, `swift package` etc? - [x] Confirmed reproduction steps with SwiftPM CLI. The description text _must_ include reproduction steps with either of command-line SwiftPM commands, `swift build`, `swift test`, `swift package` etc. ### Description Everything worked with `main-snapshot-2026-04-01`, but starting with the release of `swift-DEVELOPMENT-SNAPSHOT-2026-04-17`, tests fail to correctly find a dynamic library that the test depends on: ``` ~/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2026-04-22-a.xctoolchain/usr/bin/swift test --build-system swiftbuild --verbose Build complete! (1,84 sec) Test Suite 'All tests' started at 2026-04-25 08:13:58.649. Test Suite 'All tests' passed at 2026-04-25 08:13:58.658. Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.008) seconds error: signalled(5): /Users/runner/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2026-04-22-a.xctoolchain/usr/libexec/swift/pm/swiftpm-testing-helper --test-bundle-path /Users/runner/actions-runner/_work/plugin-data-generator/plugin-data-generator/.build/out/Products/Debug/DataGeneratorTests.xctest/Contents/MacOS/DataGeneratorTests --list-tests --testing-library swift-testing /Users/runner/actions-runner/_work/plugin-data-generator/plugin-data-generator/.build/out/Products/Debug/DataGeneratorTests.xctest/Contents/MacOS/DataGeneratorTests output: swiftpm_testing_helper/Entrypoint.swift:34: Fatal error: Failed to open test bundle at path /Users/runner/actions-runner/_work/plugin-data-generator/plugin-data-generator/.build/out/Products/Debug/DataGeneratorTests.xctest/Contents/MacOS/DataGeneratorTests: dlopen(/Users/runner/actions-runner/_work/plugin-data-generator/plugin-data-generator/.build/out/Products/Debug/DataGeneratorTests.xctest/Contents/MacOS/DataGeneratorTests, 0x0101): Library not loaded: @rpath/libDataGeneratorBackend.dylib Referenced from: <A86BBAD8-13DA-38CE-8680-5AB8FA2CA115> /Users/runner/actions-runner/_work/plugin-data-generator/plugin-data-generator/.build/out/Products/Debug/DataGeneratorTests.xctest/Contents/MacOS/DataGeneratorTests Reason: tried: '/Users/runner/actions-runner/_work/plugin-data-generator/plugin-data-generator/.build/out/Products/Debug/DataGeneratorTests.xctest/Contents/MacOS/libDataGeneratorBackend.dylib' (no such file), '/Users/runner/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2026-04-22-a.xctoolchain/usr/lib/swift/macosx/testing/libDataGeneratorBackend.dylib' (no such file), '/Applications/Xcode-26.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/libDataGeneratorBackend.dylib' (no such file), '/usr/lib/swift/libDataGeneratorBackend.dylib' (no such file, not in dyld cache), '/System/Volumes/Preboot/Cryptexes/OS/usr/lib/swift/libDataGeneratorBackend.dylib' (no such file), '/Users/runner/actions-runner/_work/plugin-data-generator/plugin-data-generator/.build/out/Products/Debug/DataGeneratorTests.xctest/Contents/MacOS/libDataGeneratorBackend.dylib' (no such file), '/Users/runner/actions-runner/_work/plugin-data-generator/plugin-data-generator/.build/out/Products/Debug/PackageFrameworks/libDataGeneratorBackend.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/actions-runner/_work/plugin-data-generator/plugin-data-generator/.build/out/Products/Debug/PackageFrameworks/libDataGeneratorBackend.dylib' (no such file), '/Users/runner/actions-runner/_work/plugin-data-generator/plugin-data-generator/.build/out/Products/Debug/DataGeneratorTests.xctest/Contents/MacOS/Frameworks/libDataGeneratorBackend.dylib' (no such file), '/Users/runner/actions-runner/_work/plugin-data-generator/plugin-data-generator/.build/out/Products/Debug/DataGeneratorTests.xctest/Contents/MacOS/../Frameworks/libDataGeneratorBackend.dylib' (no such file), '/usr/lib/swift/libDataGeneratorBackend.dylib' (no such file, not in dyld cache), '/System/Volumes/Preboot/Cryptexes/OS/usr/lib/swift/libDataGeneratorBackend.dylib' (no such file), '/Users/runner/actions-runner/_work/plugin-data-generator/plugin-data-generator/.build/out/Products/Debug/DataGeneratorTests.xctest/Contents/MacOS/libDataGeneratorBackend.dylib' (no such file), '/Users/runner/actions-runner/_work/plugin-data-generator/plugin-data-generator/.build/out/Products/Debug/PackageFrameworks/libDataGeneratorBackend.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/actions-runner/_work/plugin-data-generator/plugin-data-generator/.build/out/Products/Debug/PackageFrameworks/libDataGeneratorBackend.dylib' (no such file), '/Users/runner/actions-runner/_work/plugin-data-generator/plugin-data-generator/.build/out/Products/Debug/DataGeneratorTests.xctest/Contents/MacOS/Frameworks/libDataGeneratorBackend.dylib' (no such file), '/Users/runner/actions-runner/_work/plugin-data-generator/plugin-data-generator/.build/out/Products/Debug/DataGeneratorTests.xctest/Contents/MacOS/../Frameworks/libDataGeneratorBackend.dylib' (no such file), '/usr/lib/swift/libDataGeneratorBackend.dylib' (no such file, not in dyld cache), '/System/Volumes/Preboot/Cryptexes/OS/usr/lib/swift/libDataGeneratorBackend.dylib' (no such file), '/Users/ec2-user/jenkins/workspace/oss-swift-package-macos/build/buildbot_osx/intermediate-install/macosx-x86_64/Applications/Xcode.app/Contents/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2026-04-22-a.xctoolchain/usr/lib/swift-6.2/macosx/libDataGeneratorBackend.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/ec2-user/jenkins/workspace/oss-swift-package-macos/build/buildbot_osx/intermediate-install/macosx-x86_64/Applications/Xcode.app/Contents/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2026-04-22-a.xctoolchain/usr/lib/swift-6.2/macosx/libDataGeneratorBackend.dylib' (no such file), '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-6.2/macosx/libDataGeneratorBackend.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-6.2/macosx/libDataGeneratorBackend.dylib' (no such file), '/usr/lib/swift/libDataGeneratorBackend.dylib' (no such file, not in dyld cache), '/System/Volumes/Preboot/Cryptexes/OS/usr/lib/swift/libDataGeneratorBackend.dylib' (no such file), '/Users/ec2-user/jenkins/workspace/oss-swift-package-macos/build/buildbot_osx/intermediate-install/macosx-x86_64/Applications/Xcode.app/Contents/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2026-04-22-a.xctoolchain/usr/lib/swift-6.2/macosx/libDataGeneratorBackend.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/ec2-user/jenkins/workspace/oss-swift-package-macos/build/buildbot_osx/intermediate-install/macosx-x86_64/Applications/Xcode.app/Contents/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2026-04-22-a.xctoolchain/usr/lib/swift-6.2/macosx/libDataGeneratorBackend.dylib' (no such file), '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-6.2/macosx/libDataGeneratorBackend.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-6.2/macosx/libDataGeneratorBackend.dylib' (no such file) ``` Library correctly present: ``` $ find .build | grep libDataGeneratorBackend .build/out/Intermediates.noindex/data-generator-backend.build/Debug/DataGeneratorBackend-product-t.build/libDataGeneratorBackend.dylib.xcent.der .build/out/Intermediates.noindex/data-generator-backend.build/Debug/DataGeneratorBackend-product-t.build/libDataGeneratorBackend.dylib.xcent .build/out/Products/Debug/libDataGeneratorBackend.dylib ``` Linked to rpath: ``` otool -L /Users/runner/actions-runner/_work/plugin-data-generator/plugin-data-generator/.build/out/Products/Debug/DataGeneratorTests.xctest/Contents/MacOS/DataGeneratorTests | grep libDataGeneratorBackend @rpath/libDataGeneratorBackend.dylib (compatibility version 1.0.0, current version 1.0.0) ``` This works correctly: `swift test --build-system native`. ### Expected behavior _No response_ ### Actual behavior _No response_ ### Steps to reproduce _No response_ ### Swift Package Manager version/commit hash _No response_ ### Swift & OS version (output of `swift --version ; uname -a`) `swift-DEVELOPMENT-SNAPSHOT-2026-04-22` ``` Apple Swift version 6.4-dev (LLVM f9f6f82a498c191, Swift 4a700afbe44b5df) Target: arm64-apple-macosx26.0 Build config: +assertions ```
1 条评论