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

Prune ccache caches in CI on each run #457

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

alexcrichton
Copy link
Collaborator

I noticed in a recent build that the cache size for Windows is quite large at 500M. That might be related to switching to MSVC, I'm not sure, but something else I've realized is that as-configured wasi-sdk will continuously grow the cache over time and it won't ever get trimmed until we hit github actions limits. This is because the cache is restored from an older version, then appended to with the current build, then saved again. That theoretically means that each builder could make up to a 5G cache which is a bit too large.

This commit adds an extra step that removes all objects older than 1d to ensure that older builds eventually get cleaned out of the cache. GitHub Actions should then still delete older caches pretty regularly but each individual cache should be bounded still.

I noticed in a [recent build] that the cache size for Windows is quite
large at 500M. That might be related to switching to MSVC, I'm not sure,
but something else I've realized is that as-configured wasi-sdk will
continuously grow the cache over time and it won't ever get trimmed
until we hit github actions limits. This is because the cache is
restored from an older version, then appended to with the current
build, then saved again. That theoretically means that each builder
could make up to a 5G cache which is a bit too large.

This commit adds an extra step that removes all objects older than 1d to
ensure that older builds eventually get cleaned out of the cache. GitHub
Actions should then still delete older caches pretty regularly but each
individual cache should be bounded still.

[recent build]: https://github.com/WebAssembly/wasi-sdk/actions/runs/10045872592/job/27764084758?pr=456
@alexcrichton
Copy link
Collaborator Author

Looks like the 500M cache I saw was because the MSVC build defaults to "Debug" and the default-to-minsizerel logic wasn't kicking in. Unrelated to this PR but explains that large cache size.

@alexcrichton alexcrichton enabled auto-merge (squash) July 22, 2024 18:43
@alexcrichton alexcrichton merged commit 0584df3 into WebAssembly:main Jul 22, 2024
7 checks passed
@alexcrichton alexcrichton deleted the prune-caches branch July 31, 2024 14:58
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.

2 participants