-
Notifications
You must be signed in to change notification settings - Fork 1.5k
ci: Cache Rust compilation and cargo dependencies #11707
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
base: main
Are you sure you want to change the base?
Conversation
Personally I don't think we're a good fit for caching here, so I'm not sure about this. Some concerns I would have are:
The most plausible route I know of for caching would be something like |
I noticed that Wasmtime uses almost no cache for its GitHub Actions workflows. Let's see how well adding a cache for `target` plus various `cargo` dirs works.
ee10d42
to
42f01a4
Compare
Yeah, it's possible that this will end up not being worth it: my first attempt shaved about 45 seconds off the build, and that might vary by which job wins the race to creating the cache entry. I just force-pushed a new version using https://github.com/Swatinem/rust-cache. We'll see if that does any better at all. If not, the only other thing I can think of is to specifically enable caching for the longest-running jobs and nothing else. Or we'll just close this at that point. |
I re-triggered the build with cache seeded, but I'm already pretty certain that this won't help as-is: the job name part of the cache keys for the |
The test jobs are the long pole, and the cache key needs to be derived from the test matrix to work properly.
…e on `main` This brings disk usage for the cache down to about 340MB per platform, which should mean that we're not risking eviction of other, longer-term stable caches.
With a switch to only using the cache for the longest-running test job, I think this might work? It seems to reduce CI runtime by about 60-80 seconds, or ~10% or so, which doesn't seem too bad. The last iteration also only caches dependencies now. With that, a cache entry for Linux is about 400MB, which should hopefully mean that for a full test run we should still stay way under 10GB, and hence shouldn't risk evicting the preexisting, much more long-term stable caches. [Edit: 400MB, not 340MB. I think that doesn't change the calculus though) |
Could you run Another possible alternative, though, is to configure sccache for the wasmtime-cli test job too. That would I think yield effectively the same speedups with better cache eviction behavior because the cache entries are much more fine-grained. |
I noticed that Wasmtime uses almost no cache for its GitHub Actions workflows. Let's see how well adding a cache for
target
plus variouscargo
dirs works.