Is a shared build cache a good fit for Cargo?

FYI, @alexcrichton, @glandium and I sat down two weeks ago and hashed out a plan for using sccache as a compiled crate cache from cargo. The initial use case will be for CI builds, which should immediately benefit Rust, Servo and Firefox builds, but I’ve done some work on sccache recently to make it suitable for use in local development, so it we get it all working it should be possible to use sccache for local Rust development as well.

We’re also working on making it possible for people doing local Firefox builds to get cache hits from the cache populated by our CI builders, so once we sort that out it is feasible that we could do the same for Rust projects. It doesn’t seem unreasonable that at the end of that work we could provide a public crate cache usable by anyone doing Rust development, but we might need to do some additional work to make that work well. The “shared cache for CI builds for a single project” use case is a lot smaller in scope!

I’m going to start working on the sccache implementation for caching Rust compilation in Q1 2017 (with my primary focus being to make sure we don’t regress Firefox build times significantly as we add a giant pile of Rust to the build), and Alex has already enabled sccache for Linux/OS X Rust builds in CI, so we should be able to test there fairly easily. I expect the Servo folks will be pretty interested in testing this as well.

7 Likes