Skip to content

[Dependency Scanning] Simplify the persistent dependency scanning cache #62411

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 2 commits into from
Dec 7, 2022

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented Dec 5, 2022

  • Key into a global (shared) dependency scanning cache via context hash.
    Introduces a concept of a dependency scanning action context hash, which is used to select an instance of a global dependency scanning cache which gets re-used across multiple dependency scanning actions. In practice, this means that GlobalModuleDependenciesCache's map is keyed with a Context Hash that a given CompilerInvocation knows how to produce.

  • Removes disambiguation of 'GlobalModuleDependenciesCache' results by search path set
    Previously, GlobalModuleDependenciesCache was keyed by triple and returned a collection of results, one for each potential search path set. This is no longer necessary with the above change since the cache is always configured for the current scanning context hash, which includes the search path set.

@artemcm artemcm force-pushed the BetterDependencyCaching-ContextHash branch 3 times, most recently from 914376d to c92b456 Compare December 5, 2022 23:58
@artemcm
Copy link
Contributor Author

artemcm commented Dec 5, 2022

@swift-ci test

@artemcm artemcm force-pushed the BetterDependencyCaching-ContextHash branch from c92b456 to 5bfa3b8 Compare December 6, 2022 00:01
@artemcm
Copy link
Contributor Author

artemcm commented Dec 6, 2022

@swift-ci test

…cache via context hash

Introduces a concept of a dependency scanning action context hash, which is used to select an instance of a global dependency scanning cache which gets re-used across dependency scanning actions.
@artemcm artemcm force-pushed the BetterDependencyCaching-ContextHash branch from 5bfa3b8 to 951c5d3 Compare December 6, 2022 16:30
@artemcm
Copy link
Contributor Author

artemcm commented Dec 6, 2022

@swift-ci test Linux Platform

@artemcm artemcm marked this pull request as ready for review December 6, 2022 21:39
@artemcm artemcm force-pushed the BetterDependencyCaching-ContextHash branch from 951c5d3 to a90dda5 Compare December 6, 2022 22:00
@artemcm
Copy link
Contributor Author

artemcm commented Dec 6, 2022

@swift-ci test

…che' by search path set

This is no longer necessary since the cache is always configured for the current scanning context hash, which includes the search path set.
@artemcm artemcm force-pushed the BetterDependencyCaching-ContextHash branch from a90dda5 to f39c638 Compare December 6, 2022 22:15
@artemcm
Copy link
Contributor Author

artemcm commented Dec 6, 2022

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

Nice abstraction!

@artemcm
Copy link
Contributor Author

artemcm commented Dec 7, 2022

@swift-ci test Windows platform

@artemcm artemcm merged commit 62b26b1 into swiftlang:main Dec 7, 2022
@artemcm artemcm deleted the BetterDependencyCaching-ContextHash branch December 7, 2022 19:24
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