Skip to content

[CAS] Teach swift compiler to compute cache key and store outputs into CAS #65288

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 compiler how to compute cache key and store outputs into CAS. It contains:

  • Cache key computation logic
  • CAS output backend that mirrors the output into CAS
  • Add cache lookup entry for outputs in ActionCache
  • A swift-driver tool that can be used to inspect caching functions.

@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please smoke test

@cachemeifyoucan cachemeifyoucan force-pushed the eng/PR-swift-cache-backend branch from 7dc4973 to 8206278 Compare April 19, 2023 17:57
@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please test

@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please smoke test

@cachemeifyoucan cachemeifyoucan force-pushed the eng/PR-swift-cache-backend branch from 8206278 to eaa9963 Compare April 20, 2023 15:58
@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please smoke test

@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please smoke test macOS platform

@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@benlangmuir benlangmuir left a comment

Choose a reason for hiding this comment

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

LGTM, but please wait for at least one more reviewer to approve since I'm not that familiar with the swift frontend.

@cachemeifyoucan cachemeifyoucan force-pushed the eng/PR-swift-cache-backend branch from 774a46f to b97eb93 Compare April 24, 2023 17:14
@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please smoke test

@cachemeifyoucan cachemeifyoucan force-pushed the eng/PR-swift-cache-backend branch from b97eb93 to 8b36ee8 Compare April 24, 2023 17:41
@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please smoke test

Teach swift how to serialize its input into CAS to create a cache key
for compiler outputs. To compute the cache key for the output, it first
needs to compute a base-key for the compiler invocation. The base key is
computed from: swift compiler version and the command-line arguments for
the invocation.

Each compiler output from swift will gets its own key. The key for the
output is computed from: the base key for the compiler invocation + the
primary input for the output + the output type.
Add tool swift-cache-tool for caching related testing and inspection.
When `-enable-cas` option is used, mirror the output into CAS so it can
be fetched from CAS with the cache key in the future.
Move all the declarations for SupplementaryOutputPaths to a def file to
keep variables and function interfaces in sync.
@cachemeifyoucan cachemeifyoucan force-pushed the eng/PR-swift-cache-backend branch from 8b36ee8 to 8d3d9b2 Compare April 24, 2023 20:58
@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please smoke test

@cachemeifyoucan
Copy link
Contributor Author

@swift-ci please smoke test

@cachemeifyoucan cachemeifyoucan merged commit 86927ef into swiftlang:main Apr 25, 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.

3 participants