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.85k stars 552 forks source link

Sccache server spawned by one user used by another sccache user #1435

Open RuijieYu opened 1 year ago

RuijieYu commented 1 year ago
$ sccache --version
sccache 0.3.0
$ rustc --version
rustc 1.65.0 (897e37553 2022-11-02)

I have two users that were trying to compile the same Rust crate simultaneously, where both users have configured sccache as the rustc wrapper. User A calls cargo build first, which spawns a sccache server listening on localhost:4226. User B then calls cargo build, sees the socket 4226, and returns a permission-denied error, probably because it is trying to access the cache in User A's home dir.

Is there something already implemented that helps the situation? Apparently I can just run sccache --stop-server on User B before running cargo build, but is there something else that more elegently handles it?

sum12 commented 1 year ago

you can use different ports for each user using SCCACHE_SERVER_PORT