ci: enable sccache for Rust compilation.#32330
Conversation
This was previously disabled in servo#30508 due to sccache not working well with crown. The sccache issue (mozilla/sccache#861) linked in that PR is now closed and [testing][1] on my fork also seems to indicated we should be able to turn on sccache again. [1]: https://github.com/mukilan/servo/actions/runs/9154196647 Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
sagudev
left a comment
There was a problem hiding this comment.
I completely forgot about it (and I helped to fix sccache, but it wasn't released yet)
IIRC sccache wasn't working on windows before, but maybe it works now? We could try it in followup.
|
Out of interest, where is the cache data stored? |
GitHub runners have special cached artifacts that can be used across runs: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows |
|
Do we not run into this:
Most Rust repos I'm involved in are using https://github.com/Swatinem/rust-cache (sccache may well be better for Servo's use case), but my Servo target directory very quickly exceeds 10GB and I would imagine this would happen especially quickly with multiple PRs compiling different versions of the code. Perhaps using artifacts rather than the built-in caching works around this? |
From what I understand, sscache caches each compilation artifact individually, as separate entries in the Action cache, so hopefully there is still some sharing even in the presence of multiple versions of code. That said, Swatinem/rust-cache or artifact based cache is also something we can explore. rust-cache seems to support caching the cargo registry which could be complimentary to |
This was previously disabled in #30508 due to sccache not working well with crown. The sccache issue (mozilla/sccache#861) linked in that PR is now closed and testing on my fork also seems to indicated we should be able to turn on sccache again.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errors