Skip to content
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

Use sccache instead of ccache #25058

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cbjeukendrup
Copy link
Contributor

@cbjeukendrup cbjeukendrup commented Oct 6, 2024

sccache has built-in support for GitHub Actions, which makes it work fundamentally differently from ccache.

With ccache:

  • the entire cache is downloaded from some previous action; if there is one for the current branch, that one is used, otherwise, a random one I believe
  • then, complication happens
  • then, the entire cache is uploaded again, i.e. the old cache files plus the new ones from this build
  • thus, the archive keeps growing, but we have set a limit of 2GB

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 configure sccache
  • sccache itself communicates directly with the GitHub Actions Cache API, and downloads/uploads directly when necessary

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

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.

1 participant