Open theres-waldo opened 5 years ago
(To be clear, this is just a plain local build, with sccache
used to cache Rust compilations to reduce incremental build time when switching branches and such. I'm not trying to do any distributed compilation here.)
(To be clear, this is just a plain local build, with
sccache
used to cache Rust compilations to reduce incremental build time [snip]
For Mozilla code I think rust incremental compilation is on for all configurations (I could well be wrong) and I guess that's the case for most other projects too. It looks like sccache currently doesn't cache rust compiler output if rustc incremental compilation is turned on in which case for most people sccache isn't going to help with compiling Rust code unless you're distributing the compilation.
Interesting; I wasn't aware of that. So I should just remove that line from my .mozconfig
for the time being?
I'm guessing so from my current understanding (at least until #236 is fixed), but maybe better to solicit the opinion of someone who knows more about these things than me. Or else just run some test builds with and without export RUSTC_WRAPPER=sccache
to get concrete numbers for your specific setup.
cargo will only use incremental compilation for path-based dependencies, so all the crates that live in mozilla-central will use it. It will not use incremental compilation for all of the dependencies from crates.io, so sccache should be able to cache those compiles.
Thanks for clarifying, @luser!
I just did a few tests for my setup for building the Mozilla source.
Roughly speaking a build using icecc and ccache (populated cache) takes about 20 minutes to do a clobber build. If I also use RUSTC_WRAPPER=sccache (populated ccache) it takes about 15-16 minutes.
So RUSTC_WRAPPER=sccache can indeed provide a significant build time improvement, at least for certain scenarios. I guess it depends on how often the crates from crates.io that we build change from commit to commit. Then again, RUSTC_WRAPPER=sccache didn't seem to add much overhead in the case that the sccache cache was empty, so it seems worth having regardless.
(Originally filed in BMO).
I build mozilla-central locally with sccache configured via the following line in my .mozconfig:
My build often fails with the following error:
It's usually resolved just by running the build again, but still somewhat annoying.