-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 needlessly(?) rebuilds dependencies #4076
Comments
If I comment out
This is definitely a bug in cpp_demangle. Whether it's also a Cargo bug is yet to be decided, but I suspect it shouldn't rerun if the dependency is consistently nonexistent. |
Here is a test case for cargo always rerunning on a non-existent rerun dependency: Cargo.toml: [package]
name = "foo"
build = "build.rs"
version = "0.0.1" build.rs: fn main() {
println!("cargo:rerun-if-changed=idontexist");
} main.rs: fn main() {} |
Ah yeah I believe that this basically boils down to gimli-rs/cpp_demangle#79 in the sense that it's not a bug in Carog, but rather a bug in the build script in question. |
Just to make sure: You're saying it's acceptable behavior that Cargo always reruns for rerun-if-changed targets that don't exist. |
@crumblingstatue That makes sense to me. (ex: If a file used to exist, and was deleted, it makes sense to redo the build. Maybe the build creates it?) It's also unfortunate that Maybe Thanks for finding and linking the root cause, Alex! |
@NfNitLoop Got it, thanks! |
@alexcrichton Double quotes are treated literally which means that cargo goes looking for filenames with quotes in them. While valid to use in a filename, I suspect it's extremely rare for this to happen intentionally in the wild. |
@inferiorhumanorgans true, but the quotes can be omitted? |
@alexcrichton Well, yes. But that's not intuitive behavior. |
Old issue, but I just stumbled upon the "double quotes being considered part of the filename" behavior by doing +1 for some sort of warning about missing files or strange filenames like this or unintentionally containing |
Cargo seems to be having a problem with a few of my dependencies (
error-chain
, and its dependencies,backtrace
andcpp_demangle
). Every time I runcargo build
or run, it rebuilds them.Hmm... I'm just realizing that if these the only libraries that that's happening for, it might be an issue with one of those libraries in particular, and not Cargo? I don't know enough about the cargo build process to know how to track that down, though.
The text was updated successfully, but these errors were encountered: