]> git.ipfire.org Git - thirdparty/ccache.git/commit
feat: Merge local manifest with fetched remote manifest
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 14 Sep 2022 19:19:14 +0000 (21:19 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 21 Sep 2022 15:06:31 +0000 (17:06 +0200)
commitf48b80c3f2e9153a98b876ad6e37c75d603d1918
tree151ed4b0b5a542ea401c8c9d0a63e05e07700ab4
parent3fcfd751f87a445f71525481aa5206424a8e1df4
feat: Merge local manifest with fetched remote manifest

With read-only secondary storage, it can happen that primary storage has
a manifest named M with a result entry R1, while secondary storage also
has a manifest M but with result R2. On a compilation that matches R2,
ccache will first succeed to look up M in primary storage, fail to find
R2 and then get M from secondary storage where R2 can be found. Since M
already exists locally, ccache will simply return the cache hit but not
store knowledge of R2 locally. On a rebuild of R2, ccache therefore
needs to fetch from secondary storage again.

The improvement brought by this commit is that ccache now merges the
manifests from primary and secondary storage and stores the merged
version in primary storage. In other words, ccache setups with read-only
secondary storage will be able to accumulate local header file
combinations and seamlessly combine them with changes from secondary
storage.

Closes #1049.
src/ccache.cpp
src/core/Manifest.cpp
src/storage/primary/PrimaryStorage.cpp
test/suites/secondary_file.bash