-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Cargo does not re-build if Rust toolchain changes without version changing #10664
Comments
This is currently intentional behavior, which is not clear if it can be changed. Closing as a duplicate of #10367. |
I think this is actually slightly different — this isn't about whether the path to |
#10367 is also about changing the If you want to check if libstd and friends change, perhaps you can use |
Ah, I read it as specifically talking about the When you say "use |
Passing |
Oh iiinteresting. That's a great tip, thanks! The nightly-only-ness and reliance on mtime over the hashes present in the |
We haven't really discussed moving it beyond the initial introduction which was needed for rustbuild, so I'm not sure. I expect it will be enabled unconditionally. Yea, I think the codegen backends could be added later. |
I ran into the issue in the stable version after having upgraded from macOS Monterey to Ventura. |
Problem
In my build environment, Rust is built from source into a custom toolchain, which I then have set as a rustup override for all my Rust projects. This normally works just fine. But, if I ever re-build Rust, any later Cargo build starts failing with errors like
The error stems from here in
rustc
, and is raised because the hash for libstd has changed.rustc
is accurately identifying thatautocfg
was previously built against a differentlibstd
than is now in the toolchain, and thus refusing to build against it.I think this is really a bug (or, perhaps, missing feature) in Cargo's fingergprinting. Specifically, it currently only takes into account the version of Rust used to build an artifact, not the core library hashes. This means that if the version stays the same but the hash changes, Cargo doesn't realize a re-build is necessary:
cargo/src/cargo/core/compiler/fingerprint.rs
Lines 516 to 517 in cf09f37
Steps
Possible Solution(s)
Cargo's fingerprinting should probably take into account the hashes for the core libraries, not just the overall Rust version.
Notes
No response
Version
The text was updated successfully, but these errors were encountered: