Skip to content

[6.1 🍒][ModuleInterface] Determine package-only resolution need based on input mode #78869

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

Merged

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented Jan 23, 2025

Cherry-pick of #78867

Description: #77686 restricted lookup of package-only dependencies of loaded binary Swift modules to only occur on in-package source compiles or from compilation of package textual interfaces. The logic to determine if we are in a source compile queried the requested action of the compiler frontend. This is incorrect for Implicitly Built modules, because textual interface sub-invocations inherit the parent invocation's requested action, which means the existing logic considers them to be source compiles. This change fixes this to instead rely on the compiler input mode, which is always set when compiling textual interfaces, both explicit and implicit.

Risk: Low, this change adds a synchronization mechanism to establish a critical section in the parallel section of the scan, without otherwise changing functionality.
Testing: Regression test added to the compiler test suite
Original PR: #78867
Radar: rdar://143505814

…ut mode

Instead of requested action. In implicit builds, implicit interface build sub-invocations inherit their parent invocation's requested action, which the code was failing to detect that we were building an interface, not source, and erroneously resulted in enabling in-package module dependency resolution.

Resolves rdar://143505814
@artemcm artemcm added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.1 labels Jan 23, 2025
@artemcm artemcm requested a review from nkcsgexi January 23, 2025 22:27
@artemcm artemcm requested a review from a team as a code owner January 23, 2025 22:27
@artemcm
Copy link
Contributor Author

artemcm commented Jan 23, 2025

@swift-ci test

@artemcm artemcm merged commit 2e850bb into swiftlang:release/6.1 Jan 24, 2025
5 checks passed
@artemcm artemcm deleted the 61_NoPackageOnlyImportOnImplicitBuild branch January 24, 2025 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 6.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants