[SR-13954] Sourcekit index request doesn't include polluted transitive dependencies #56351
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Attachment: Download
Additional Detail from JIRA
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)
The text was updated successfully, but these errors were encountered: