Skip to content

Commit

Permalink
Add more cargo:rerun-if-env-changed's to build.rs (#544)
Browse files Browse the repository at this point in the history
* Add more `cargo:rerun-if-env-changed`'s to build.rs

Add more `cargo:rerun-if-env-changed`'s to build.rs for rustix's
features, configuration flags, and the toolchain variables rustix uses
for autoconfiguration, to hopefully ensure it gets rerun when anything
changes.

See also #526.

* Don't include all the cargo features.
  • Loading branch information
sunfishcode committed Oct 12, 2023
1 parent 3de9a4d commit 48182c5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,18 @@ fn main() {
}

println!("cargo:rerun-if-env-changed=CARGO_CFG_RUSTIX_USE_EXPERIMENTAL_ASM");
println!("cargo:rerun-if-env-changed=CARGO_CFG_RUSTIX_USE_LIBC");

// Rerun this script if any of our features or configuration flags change,
// or if the toolchain we used for feature detection changes.
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=CARGO_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 48182c5

Please sign in to comment.