Skip to content

Commit

Permalink
Remove some rerun-if-env-changed lines from build.rs. (#576)
Browse files Browse the repository at this point in the history
Now that we appear to have a known-working fix for #526, we can
investigate relaxing the fix. If #526 reappears, we now have a
known-working state we can quickly revert to.

Reports in #562 and #575 are that having rerun-if-env-changed=RUSTC
and rerun-if-env-changed=RUSTC_WRAPPER are triggering spurious rebuilds
in some situations, so remove these. In theory, cargo should already be
aware of these environment variables. In practice, there were reports of
build failures which had the appearance of using an older version of
rustc with build.rs output from a newer version of rustc, and it wasn't
clear what was happening. But, it's possible that #563 fixes the issue
properly. So let's try removing these rerun-if-env-changed lines, and
see if the problem resurfaces.

And, rerun-if-env-changed=TARGET is explicitly documented as being
unnecessary [here].

[here]: https://doc.rust-lang.org/cargo/reference/build-scripts.html
  • Loading branch information
sunfishcode committed Oct 12, 2023
1 parent 7eb9187 commit 842d7d9
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,6 @@ fn main() {
println!("cargo:rerun-if-env-changed=CARGO_FEATURE_USE_LIBC");
println!("cargo:rerun-if-env-changed=CARGO_FEATURE_RUSTC_DEP_OF_STD");
println!("cargo:rerun-if-env-changed=CARGO_CFG_MIRI");
println!("cargo:rerun-if-env-changed=CARGO_ENCODED_RUSTFLAGS");
println!("cargo:rerun-if-env-changed=RUSTC");
println!("cargo:rerun-if-env-changed=TARGET");
println!("cargo:rerun-if-env-changed=RUSTC_WRAPPER");
println!("cargo:rerun-if-env-changed=PROFILE");
}

/// Link in the desired version of librustix_outline_{arch}.a, containing the
Expand Down

0 comments on commit 842d7d9

Please sign in to comment.