-
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 build will rebuild without code change #7692
Comments
The error there is |
@alexcrichton, I have some configuration for rustc.
RUSTUP_DIST_SERVER=http://mirrors.ustc.edu.cn/rust-static
RUSTUP_UPDATE_ROOT=http://mirrors.ustc.edu.cn/rust-static/rustup
RUST_BACKTRACE=1
CARGO_HOME=%USERPROFILE%\.cargo
# custom registry support via the `registry.index` configuration is being removed
[source.crates-io]
replace-with = 'ustc'
[source.ustc]
registry = "https://mirrors.ustc.edu.cn/crates.io-index"
[source.github]
registry = "https://github.com/rust-lang/crates.io-index"
[source.gitlab]
registry = "https://gitlab.com/integer32llc/crates.io-index"
[source.crates-io]
replace-with = 'ustc'
[source.ustc]
registry = "https://mirrors.ustc.edu.cn/crates.io-index"
#[source.github]
#registry = "https://github.com/rust-lang/crates.io-index"
[source.gitlab]
registry = "https://gitlab.com/integer32llc/crates.io-index" |
Thanks for the info! This looks like it may be a bug in Cargo's resolution of crates perhaps, and it definitely looks like source replacement may be the issue here. Do you have a standalone example that I could reproduce with locally perhaps? |
I think I may be seeing the same issue, although it could be different. In my case, after updating a single dependency, cargo did a full rebuild of all dependencies. I created a gist of the commands I ran and the cargo output: It appears to be a regression in behaviour because the same project did not use to exhibit this problem. I'm not using source replacement, but I am using the I'm also on windows, |
@Diggsey I don't see where the issue is in the output you showed. Can you file a new issue since it seems unrelated. It would help to have some kind of reproduction. I would suspect in your case when you ran |
Proposed fix in #7751.
@alexcrichton FYI, that log message was incorrect (see #7749), it was actually the source path was changing between different registries. |
Problem
Repeat
cargo build
, it rebuild sometimes. For example, wait for 20s between two build requests, it probably will rebuild.Steps
cargo build
project is build without any error.
Wait for 10s ~ 20s
run
cargo build
againsee the build result, project rebuild again
if not rebuild, try
cargo build
again laterPossible Solution(s)
Notes
Output of
cargo version
:output with
The text was updated successfully, but these errors were encountered: