Skip to content

[Dependency Scanning] Do not add underlying Clang module to persistent (global) scanner cache #60789

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
merged 1 commit into from
Aug 26, 2022

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented Aug 25, 2022

When we are building a Swift module which has an underlying Clang module, and which generates an ObjC interface ('-Swift.h'), the mechanism for building the latter involves a VFS redirect of its modulemap to one that does not yet have the generated Swift code, because it must be built before the Swift portion is built because the Swift portion depends on it. This means that the invocation to build this module is different to one used by the clients which depend on this module.

To avoid the subsequent client scans from re-using the partial (VFS-redirected) module, ensure that we do not store dependency info of the underlying Clang module into the global scanner cache. This will cause subsequent client scans to re-scan for this module, and find the fully-resolved modulemap without a VFS redirect.

Resolves rdar://88309064

@artemcm artemcm requested a review from nkcsgexi August 25, 2022 23:10
@artemcm
Copy link
Contributor Author

artemcm commented Aug 25, 2022

@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.

I had totally overestimated this problem. Thank you for the simple fix!

@artemcm artemcm force-pushed the DepScan-ForgetUnderlyingModule branch from 516a228 to bd83d4f Compare August 26, 2022 17:15
@artemcm
Copy link
Contributor Author

artemcm commented Aug 26, 2022

@swift-ci test

…t (global) scanner cache

When we are building a Swift module which has an underlying Clang module, and which generates an ObjC interface ('-Swift.h'), the mechanism for building the latter involves a VFS redirect of its modulemap to one that does not yet have the generated Swift code, because it must be built before the Swift portion is built because the Swift portion depends on it. This means that the invocation to build this module is different to one used by the clients which depend on this module.

To avoid the subsequent client scans from re-using the partial (VFS-redirected) module, ensure that we do not store dependency info of the underlying Clang module into the global scanner cache. This will cause subsequent client scans to re-scan for this module, and find the fully-resolved modulemap without a VFS redirect.

Resolves rdar://88309064
@artemcm artemcm force-pushed the DepScan-ForgetUnderlyingModule branch from bd83d4f to 9fcd202 Compare August 26, 2022 17:31
@artemcm
Copy link
Contributor Author

artemcm commented Aug 26, 2022

@swift-ci test

@artemcm artemcm merged commit 308d335 into swiftlang:main Aug 26, 2022
@artemcm artemcm changed the title [Dependency Scanning] Do not add underlying Clang moduel to persistent (global) scanner cache [Dependency Scanning] Do not add underlying Clang module to persistent (global) scanner cache Aug 26, 2022
@artemcm artemcm deleted the DepScan-ForgetUnderlyingModule branch August 24, 2023 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants