Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upRerun-if-changed without disabling other heuristics as a side-effect #4587
Comments
alexcrichton
added
the
A-build-scripts
label
Oct 6, 2017
This comment has been minimized.
This comment has been minimized.
|
The current semantics of
is effectively the same as without the
causes Cargo to still ignore the package sources due to a reference to an env-var and use IMHO The current implementation calls for the build-script to |
This comment has been minimized.
This comment has been minimized.
|
I'm also OK with changing the existing behavior to be additive without side effects, and adding another explicit option like |
alexcrichton
referenced this issue
Jan 5, 2018
Closed
build.rs is not run after src/main.rs changed, when using cargo:rerun-if-env-changed #4901
kornelski
referenced this issue
Apr 21, 2018
Open
Sanitize environment variables for build scripts #5282
This comment has been minimized.
This comment has been minimized.
|
Can disabling of built-in heuristics as a side effect be fixed (i.e. side-effect removed)? Does building more than necessary count as a breaking change? If so, can it be done as part of 2018 edition? |
This comment has been minimized.
This comment has been minimized.
|
Yes changing the default behavior would be a breaking change, but we could always add a new option for build scripts (or something like that) to say "use the default heuristics". Either that or a crate could be published to crates.io which is a one-liner to do what Cargo currently does. |
kornelski commentedOct 6, 2017
•
edited
Currently any use rerun-if-changed opts in entire build into a completely "manual" tracking, disabling all built-in rules as a side effect. This means it's not possible to safely just add one file/env var check to the build without understanding all the dependencies of the entire build script.
In order to use rerun-if-changed features in build-time libraries without potentially breaking rest of the build, it's necessary to be able to use rerun-if-changed-like functionality without disabling the built-in heuristic (i.e. rerun if a var/file has changed in addition to all the other/default conditions that cause the build to be rebuilt).
rust-lang/pkg-config-rs#45 (comment)
bikeshed syntax:
cargo:rerun-if-also-changed=file,cargo:rerun-if-changed+=file,cargo:rerun-if-changed;keep-defaults=file