-
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
cargo build --all-targets
executes build.rs
twice in beta and nightly
#5575
Comments
This is sort-of intentional behavior change. When executing build scripts, Cargo passes env-vars like @ehuss @alexcrichton we've decided that this is an ok change of behavior, but probably it isn't? I certainly see how this could be surprising, and that in the common case, when build.rs does not inspect those env-vars, this could lead to genuinely duplicated work as well. |
cc #5384, which introduced the changes. |
Related to #4929 there's a question about how I'm not sure how surprising Let me know what the cargo team thinks of that idea, and I can work on it. † Overridden |
I'm personally ok with the change as is, but I agree with @ehuss that perhaps the best thing to do here is to have |
Use "test" profile for `cargo build` benchmarks. When using `cargo build` (without `--release`), build benchmarks using the "test" profile. This was causing some confusion where the benchmark is placed in the `target/debug` directory, and also causing some duplicates that may not be expected. It also makes it easier to debug benchmarks (previously you had to edit the `[profile.bench]` profile). Closes #5575, closes #6301, closes #4240, closes #4929.
build.rs
Repro
clone
https://github.com/stepancheg/cargo-build-rs-twice
cd cargo-build-rs-twice
Stable:
Nightly:
build.rs
writes a pid file intoxx/
directory.Two pid files in
xx
directory mean thatbuild.rs
was executed twice in nightly.The text was updated successfully, but these errors were encountered: