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