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-13954] Sourcekit index request doesn't include polluted transitive dependencies #56351

Open
keith opened this issue Dec 11, 2020 · 2 comments
Open
Labels

Comments

@keith
Copy link
Collaborator

@keith keith commented Dec 11, 2020

Previous ID SR-13954
Radar rdar://problem/72207654
Original Reporter @keith
Type Bug

Attachment: Download

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

md5: 80f7f4e8342bebb4fd7df3d0168964dd

Issue Description:

In some cases, like the one described here: https://bugs.swift.org/browse/SR-11901 files can depend on things defined in modules they do not import. In that case if you use sourcekit's index support, you also don't get the polluted modules back in the key.dependencies list.

More discussion: https://forums.swift.org/t/supporting-strict-imports/42472/7

To repro this I've attached the same project as the above ticket with a repro.sh script that calls sourcekitd-test (which must be in your $PATH for the script).

First build with `SWIFT_EXEC=path/to/built/swiftc swift build` then run `./repro.sh` and see the output key.dependencies. In this example it contains the modules it directly imports, but does not contain the `extender` module the `transitive` module pollutes an extension from into main.swift.

Note: the repro.sh script + sourcekit rely on the same args being used as what was used to build, this repro case could drift in the future since repro.sh duplicates the current args from swiftpm

Note: The extender module is included transitively in the key.dependencies array, but not directly (which is the issue)

@typesanitizer
Copy link

@typesanitizer typesanitizer commented Dec 11, 2020

@swift-ci create

@keith
Copy link
Collaborator Author

@keith keith commented Dec 11, 2020

Here's another example of this when using operators, in this case defining `==` import-pollution-operator.zip

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

No branches or pull requests

2 participants