-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
interaction with sccache changed, all deps rebuilt when calling "cargo build" twice #6976
Comments
Just to be clear, the ticket is about none-pipelined compilation (unless there is something that turned it on by default that I missed). |
Is this related to #6978 ? |
I was personally unable to reproduce this yesterday, @matthiaskrgr can you detail how to reproduce this? (for example what version of sccache, what project, perhaps a minimal example, etc) |
I'm able to reliably reproduce it. I'm fairly certain this is because Cargo is now producing both rlib and rmeta files, even when pipelining is not enabled. Sometimes sccache detects it (presumably some kind of race?), but usually the rmeta files don't get created. I would think this issue needs to be filed on sccache? Unless @alexcrichton wants to change it so that Cargo can handle rmeta files mysteriously disappearing (EDIT: though I don't think it would be a good idea, it would complicate pipelining I would think). There was a similar issue in the Clippy repo where it was deleting rmeta files, causing everything to be rebuilt (already fixed rust-lang/rust-clippy#4115). |
I use sccache from the git repo https://github.com/mozilla/sccache , commit ce983d5d1b8d35c71e6b99a6a9b17ed17a6dad1a I have RUSTC_WRAPPER set as /home/matthias/.cargo/bin/sccache I can repro for example building https://github.com/serde-rs/json at 5b5f95831d9e0d769367b30b76a686339bffd209
|
Ah thanks for confirming @ehuss and for the extra info @matthiaskrgr. If this is an issue with |
I looked into this briefly and found that sccache isn't caching the rmeta outputs, but there's an existing workaround that pointed to rust-lang/rust#54852 and testing shows that rustc does not in fact list the rmeta filename when calling it with |
This has been fixed on the sccache side 👍 |
When using sccache (via
RUSTC_WRAPPER
), runningcargo build ; cargo build
will cause all dependencies to be rebuilt even if nothing changed between the two "cargo build" runs.(I'm not very sure what is actually happening, since the second run is consistently faster than the first run)
This is not the case when sccache is not used or when
RUSTC_WRAPPER
is unset:According to my bisect, 6b28a0c is the commit that caused this strange behaviour.
The text was updated successfully, but these errors were encountered: