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.75k stars 542 forks source link

support rls and clippy #423

Open matthiaskrgr opened 5 years ago

matthiaskrgr commented 5 years ago

It would be great if sccache supported clippy and rls calls as well. I tried something like RUSTC_WRAPPER="sccache clippy-driver rustc" but that didn't work out.

luser commented 5 years ago

What would you expect sccache to do in this scenario? AFAIK rls and clippy aren't performing actual compilation so there isn't likely to be any benefit from caching the executions.

matthiaskrgr commented 5 years ago

rls calls rustc and dumps its compilation output into target/rls. clippy-driver also calls rustc, but none of these calls (both clippy and rls) seem to be cached.

I was trying to play around with the code and make it accept "clippy-driver rustc" as a valid "compiler" but to no avail.

doronbehar commented 5 years ago

I'm not sure about clippy but as for rls, I think it does benefit from having RUSTC_WRAPPER="sccache" set in the environment.

trinity-1686a commented 5 years ago

As a workaround for clippy, it's possible to run check before as both use the same (rustc managed-)cache. On some project of mine, running clippy directly takes ~4m10s, but running cargo check && cargo clippy takes only ~2m30 by taking advantage of sccache

luser commented 5 years ago

It's possible this was fixed by #441

matthiaskrgr commented 4 years ago

Similar discussion: https://github.com/mozilla/sccache/issues/539