Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-12510] Linking error when building tests with code coverage enabled #54952

Open
egorzhdan opened this issue Apr 4, 2020 · 5 comments
Open
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@egorzhdan
Copy link
Collaborator

Previous ID SR-12510
Radar rdar://problem/62201570
Original Reporter @egorzhdan
Type Bug
Environment

Swift 5.2 release toolchain on macOS 10.15 (SIP enabled)

Additional Detail from JIRA
Votes 0
Component/s
Labels Bug
Assignee None
Priority Medium

md5: ce8de84096ed138cb95c934dbc217c1b

Issue Description:

Running /Library/Developer/Toolchains/swift-5.2-RELEASE.xctoolchain/usr/bin/swift test --enable-code-coverage --list-tests with the 5.2 toolchain results in the following error:

error: signalled(6): <env variables printed here>

dyld: Library not loaded: @rpath/XCTest.framework/Versions/A/XCTest
Referenced from: /Library/Developer/Toolchains/swift-5.2-RELEASE.xctoolchain/usr/libexec/swift/pm/swiftpm-xctest-helper
{{ Reason: image not found}}

This used to work fine with Swift 5.1 toolchain

@beccadax
Copy link
Contributor

@swift-ci create

@swift-ci
Copy link
Collaborator

Comment by Jason Wray (JIRA)

This reproduces for me using the current 5.3.2 toolchain from swift.org, but evidently not with toolchains that come with Xcode.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@benlangmuir
Copy link
Member

This appears to work for me in 5.5, maybe it can be closed?

@egorzhdan
Copy link
Collaborator Author

Just tried this with the 5.6.1 toolchain from swift.org, and it failed with a similar error message for me:

Build complete! (58.39s)
error: signalled(6): /Library/Developer/Toolchains/swift-5.6.1-RELEASE.xctoolchain/usr/libexec/swift/pm/swiftpm-xctest-helper /Volumes/Projects/spmbug/.build/x86_64-apple-macosx/debug/spmbugPackageTests.xctest /var/folders/ks/x3qc5sx54012_jzcrljkzq0w0000gn/T/TemporaryFile.To1F9a output:
    dyld[29903]: Library not loaded: @rpath/XCTest.framework/Versions/A/XCTest
      Referenced from: /Library/Developer/Toolchains/swift-5.6.1-RELEASE.xctoolchain/usr/libexec/swift/pm/swiftpm-xctest-helper
      Reason: tried: '/Library/Developer/Toolchains/swift-5.6.1-RELEASE.xctoolchain/usr/libexec/swift/pm/../lib/XCTest.framework/Versions/A/XCTest' (no such file), '/Library/Developer/Toolchains/swift-5.6.1-RELEASE.xctoolchain/usr/libexec/swift/pm/../../../lib/swift/macosx/XCTest.framework/Versions/A/XCTest' (no such file), '/Library/Developer/Toolchains/swift-5.6.1-RELEASE.xctoolchain/usr/libexec/swift/pm/../lib/XCTest.framework/Versions/A/XCTest' (no such file), '/Library/Developer/Toolchains/swift-5.6.1-RELEASE.xctoolchain/usr/libexec/swift/pm/../../../lib/swift/macosx/XCTest.framework/Versions/A/XCTest' (no such file), '/System/Library/Frameworks/XCTest.framework/Versions/A/XCTest' (no such file)

@benlangmuir
Copy link
Member

I cannot reproduce using the original command swift test --enable-code-coverage --list-tests but I can reproduce if I run swiftpm-xctest-helper directly. Not sure what's different about my environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Projects
None yet
Development

No branches or pull requests

4 participants