Skip to content

[5.9 🍒][Dependency Scanning] Consider optional dependencies of @testable textual dependencies with an adjacent binary module #65256

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 Apr 18, 2023

Cherry-pick of #65234

For a @testable import in program source, if a Swift textual interface dependency is discovered, and has an adjacent binary .swiftmodule, only the binary module will reference the "optional" module dependencies that the built-for-testable module may need to be fully usable.

This change, for @testable direct dependencies of module-under-scan, causes the scanner to open up the adjacent binary .swiftmodule module, and pull in its optional dependencies, and attempt to resolve them. If an optional dependency cannot be resolved on the filesystem, the scanner proceeds silently, without a diagnostic - this is a best-effort attempt to handle testable module dependencies as thoroughly as possible.

Note: Newly-added logic only affects Explicit Module Builds and Dependency Scanning actions.

artemcm added 5 commits April 18, 2023 09:49
…nary module for direct interface dependencies

For a `@Testable` import in program source, if a Swift interface dependency is discovered, and has an adjacent binary `.swiftmodule`, open up the module, and pull in its optional dependencies. If an optional dependency cannot be resolved on the filesystem, fail silently without raising a diagnostic.
…nary module for direct '@testable' interface dependencies

They may be a super-set of the ones that appear in the textual interface - e.g. 'internal' imports will be contained in the adjacent binary module, but not the textual interface
@artemcm artemcm requested a review from nkcsgexi April 18, 2023 16:51
@artemcm artemcm requested a review from a team as a code owner April 18, 2023 16:51
@artemcm
Copy link
Contributor Author

artemcm commented Apr 18, 2023

@swift-ci test

@artemcm
Copy link
Contributor Author

artemcm commented Apr 18, 2023

Note: Newly-added logic only affects Explicit Module Builds and Dependency Scanning actions.

Copy link
Contributor

@nkcsgexi nkcsgexi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code changes are out of the regular implicit module build.

@artemcm artemcm merged commit 3946ef5 into swiftlang:release/5.9 Apr 19, 2023
@AnthonyLatsis AnthonyLatsis added the 🍒 release cherry pick Flag: Release branch cherry picks label May 3, 2023
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants