Use sccache instead of ccache #25058
Open
+104
−163
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
sccache
has built-in support for GitHub Actions, which makes it work fundamentally differently fromccache
.With
ccache
:Because every time the entire cache archive for an action is downloaded and uploaded, there is a big lack of granularity. It means that a lot of information is stored multiple times in different cache archives; it means that runs download cache data that is partially not relevant for them; it means that cache archives are very quickly deleted because GitHub's total storage reaches the limit of 10GB, which means that a branch's own cache archive is soon deleted, which means that it will next time receive the archive from another branch, which is probably less relevant. Anyway, complicated, but a lot of potential suboptimalities here. And, when a build fails at the very end, nothing is uploaded at all.
With
sccache
:mozilla-actions/sccache-action
is used to install and configuresccache
sccache
itself communicates directly with the GitHub Actions Cache API, and downloads/uploads directly when necessaryThis solves basically all aforementioned problems. Another advantage of
sccache
is that it seems to have slightly better support for MSVC, but still not every option we use is supported.