Skip to content

[6.0][ScanDependency][canImport] Improve canImport handling in explicit build #74105

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

cachemeifyoucan
Copy link
Contributor

Explanation: Teach dependency scanner to report all the module canImport check result to swift-frontend, so swift-frontend doesn't need to parse swiftmodule or parse TBD file to determine the versions.
Scope: Improve scanner consistency and fix the clang module cross import issue when swift caching is enabled.
Issue: rdar://128067152
Original PR: #73853
Risk: Low
Reviewer: @tshortli
Testing: SWB test and Unit Test

Teach dependency scanner to report all the module canImport check result
to swift-frontend, so swift-frontend doesn't need to parse swiftmodule
or parse TBD file to determine the versions. This ensures dependency
scanner and swift-frontend will have the same resolution for all
canImport checks.

This also fixes two related issues:
* Previously, in order to get consistant results between scanner and
  frontend, scanner will request building the module in canImport check
  even it is not imported later. This slightly alters the definition of
  the canImport to only succeed when the module can be found AND be
  built. This also can affect the auto-link in such cases.
* For caching build, the location of the clang module is abstracted away
  so swift-frontend cannot locate the TBD file to resolve
  underlyingVersion.

rdar://128067152
(cherry picked from commit 026fcd2)
@cachemeifyoucan cachemeifyoucan requested a review from a team as a code owner June 3, 2024 21:38
@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please test

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.

Thank you for fixing it!

@cachemeifyoucan cachemeifyoucan merged commit 5fa19d4 into swiftlang:release/6.0 Jun 4, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants