Commit Graph

10 Commits

Author SHA1 Message Date
Steven Wu
7d10bcafd9 [TEST-ONLY][Caching] Don't assume pluginCAS can be shared with builtinCAS
Don't assume the `-cas-path` option can be shared between builtin CAS
and plugin CAS. This can lead to test failures when pluginCAS doesn't
use the same storage schema as builtin CAS.
2025-06-23 09:57:50 -07:00
Steven Wu
fba8ec3292 [CAS] Make CAS plugin options to be cache invariant
Do not add CAS configurations into cache key computation. This ensure if
the cache keys are identical if two functionally equivalent plugins are
used. This is safe to do because if any of the CAS configurations
changes how the cache key is computed, they are going to be directly
reflected in the cache key without adding its configuration into the
key.

rdar://137091843
2024-10-02 14:07:32 -07:00
Steven Wu
52671e1a6a [Caching] Improve swift caching related tests
Improve caching related tests to make them faster and test the situation
closer to what actually happens during explicit module build. Most
noticable changes are:
* Avoid swift stdlib dependency during the tests to save time
* Use dependency scanner output to construct test cases
* Update old test cases that try to simulate caching from file system
  inputs to using only CAS inputs.
2024-01-28 22:06:59 -08:00
Steven Wu
30cfa3deb2 [Caching] Re-associate diagnostics cache key with InputFile
Change how cached diagnostics are stored inside the CAS. It used to be
stored as a standalone entry for a frontend invocation in the cache and
now it is switched to be associated with input files, stored together
with other outputs like object files, etc.

This enables cleaner Cache Replay APIs and future cached diagnostics
that can be splitted up by file contribution.
2023-10-30 16:02:19 -07:00
Steven Wu
1d111392d2 [CAS] Teach swift-cache-tool about plugin-cas 2023-08-24 16:25:29 -07:00
Steven Wu
b78b569450 [CAS] Consolidate compile cache flags
Rename `-enable-cas` to `-compile-cache-job` to align with clang option
names and promote that to a new driver only flag.

Few other additions to driver flag for caching behaviors:
* `-compile-cache-remarks`: now cache hit/miss remarks are guarded behind
  this flag
* `-compile-cache-skip`: skip replaying from the cache. Useful as a
  debugging tool to do the compilation using CAS inputs even the output
  is a hit from the cache.
2023-06-26 10:34:27 -07:00
Steven Wu
9a3573bed1 [CacheKey] Fix filelist CAS option
When using a file list inputs to the swift-frontend invocation, the name
of the file is not significant, only the content of the file. Improve
cache key computation so only the content of the input file will affect
cache key, not the file name.
2023-06-12 13:22:10 -07:00
Steven Wu
d3891a86ba [CAS] Add caching diagnostic processor
Add a CachedDiagnosticsProcessor that is a DiagConsumer can capture all
the diagnostics during a compilation, serialized them into CAS with a
format that can be replayed without re-compiling.
2023-04-27 13:36:49 -07:00
Steven Wu
8cbf83f903 Mirror outputs into CAS using CASOutputBackend
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.
2023-04-24 13:57:47 -07:00
Steven Wu
c153210505 [CAS] Add test case for cache key computation
Add tool swift-cache-tool for caching related testing and inspection.
2023-04-24 13:56:33 -07:00