From eb1d1fcd35babba38cce2279dc0eda60a42c5050 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 27 Feb 2023 20:00:58 -0800 Subject: [PATCH] Add more `cargo:rerun-if-env-changed`'s to build.rs (#544) * 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. --- build.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/build.rs b/build.rs index 697110771..4ee4fedcb 100644 --- a/build.rs +++ b/build.rs @@ -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