Skip to content

[CAS] Teach swift-frontend to replay result from cache #65924

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

Teach swift-frontend to replay cache results if there is a cache hit.

@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@artemcm artemcm left a comment

Choose a reason for hiding this comment

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

This is very cool.

@@ -48,6 +48,13 @@ llvm::Expected<llvm::cas::ObjectRef> swift::createCompileJobBaseCacheKey(
SkipNext = true;
continue;
}
// FIXME: Use a heuristic to remove all the flags that affect output paths.
// Those should not affect compile cache key.
if (Arg.startswith("-emit-")) {
Copy link
Contributor

Choose a reason for hiding this comment

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

😬

return None;
}
if (!*Lookup) {
Diag.diagnose(SourceLoc(), diag::output_cache_miss, OutputPath,
Copy link
Contributor

Choose a reason for hiding this comment

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

Going forward, should these remarks be being a flag of some sort?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, we should guard them but at some point I will reconfigure all the flags. Currently I am thinking that:

  • add -compile-cache driver option to turn on replay and output storing.
  • -enable-cas will just be a frontend option to add a cas instance for various cas tasks, like cas based dependency scanning, cas fs, cas object file format, etc.

@xedin xedin removed their request for review May 23, 2023 17:03
@cachemeifyoucan cachemeifyoucan merged commit daaee27 into swiftlang:main May 30, 2023
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