mozilla / sccache

Sccache is a ccache-like tool. It is used as a compiler wrapper and avoids compilation when possible. Sccache has the capability to utilize caching in remote storage environments, including various cloud storage options, or alternatively, in local storage.
Apache License 2.0
5.87k stars 552 forks source link

Fix rustc -Z ls handling #2290

Open lissyx opened 6 days ago

lissyx commented 6 days ago

I was investigating a high memory usage on sccache rust compilation part and I came accross a failure in the build log https://github.com/mozilla/sccache/blob/b0a6355d9ef18df3d9d26531254d8ab52ba306ca/src/compiler/rust.rs#L2388.

At first I assumed it was just a byproduct of configure step, but it looks like -Z ls changes in https://github.com/rust-lang/rust/commit/ff00763dd1c542abe9897ff62c3acff5baa6d2eb#diff-03c3ed2f6e27e58df63382e00323eea6fd1ce3a4f9546941b2b717fead25e520

One might need to update to -Z ls=root.

lissyx commented 6 days ago

Running the changes locally, I think it also fixes the high memory usage that prompted that investigation: I had to kill sometime (or OOM killker did) because sccache was consuming > 65% of RAM (out of 32GB ...). I have not been able to see more than 16% after this changed (mach build -j128 on a 16 cores laptop + 32GB RAM with sccache-dist setup and a desktop with 128 cores and 128GB of RAM).