Page MenuHomePhabricator

Rust CI jobs should use caching
Open, Needs TriagePublic

Description

Follow-up from T256827: Support Rust repositories in CI

The crates.io metadata and package archives probably can be cached in castor, but we should use something like sccache (see T260414) for build caching.

Event Timeline

We save the whole content of /cache which is defined in the XDG_CACHE_HOME environment variable. Is cargo recognizes it, the packages metadata and archives are already saved.

For the build caching, if it is fast enough I guess do not bother with a shared build cache. It might well end up being a nightmare to set it right or get polluted by the arbitrary code we run.

We save the whole content of /cache which is defined in the XDG_CACHE_HOME environment variable. Is cargo recognizes it, the packages metadata and archives are already saved.

It doesn't :( https://github.com/rust-lang/cargo/issues/1734

Caches are saved in cargo's "home": https://doc.rust-lang.org/cargo/guide/cargo-home.html - I think setting CARGO_HOME=/cache should work.

For the build caching, if it is fast enough I guess do not bother with a shared build cache. It might well end up being a nightmare to set it right or get polluted by the arbitrary code we run.

I think it's definitely a nice to have, especially as we get more rust projects (hopefully :)). I've been doing some testing of sccache in Cloud VPS and locally and it's been pretty great so far.