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-3514] Swift/SwiftPM should warn when attempting to import an executable module #5138

Open
swift-ci opened this issue Dec 30, 2016 · 4 comments

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-3514
Radar None
Original Reporter swizzlr (JIRA User)
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Improvement
Assignee None
Priority Medium

md5: c53885b3dcbae19235bdc3f503785bd2

Issue Description:

This is important in the context of tests. When running swift test from the command line it is not possible to import an executable module's members, whether public or @testable is supplied.

Ideally it should support this use case, but I feel that this would conceptually be easy to achieve and would alleviate some suffering for beginners!

@belkadan
Copy link

belkadan commented Jan 4, 2017

You can certainly do this in Xcode, so I'm not sure why you can't do this from swift test.

@ankitspd
Copy link
Member

ankitspd commented Jan 5, 2017

This is due to limitation that for linux XCTest we create a test executable (and not a bundle).

I don't think we can provide a warning here without knowing what modules are being imported by a module.

@swift-ci
Copy link
Contributor Author

Comment by Thomas Catterall (JIRA)

@aciidb0mb3r What would a fix look like?

@ankitspd
Copy link
Member

We could be strict and only add search paths to actual dependencies of a module.
See:
https://bugs.swift.org/browse/SR-1393
https://bugs.swift.org/browse/SR-1503

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants