Skip to content
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

Add more cargo:rerun-if-env-changed's to build.rs #544

Merged
merged 2 commits into from
Feb 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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");
Copy link

@jyn514 jyn514 Feb 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect just this line to fix the issue, but having more rerun directives won't hurt anything.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That might be true. I've now scaled back the list a little to exclude all the cargo features, because those seem less likely to be the problem here, and are more tedious to maintain. Hopefully this works!

println!("cargo:rerun-if-env-changed=TARGET");
println!("cargo:rerun-if-env-changed=CARGO_RUSTC_WRAPPER");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like CARGO_RUSTC_WRAPPER is a wrong name. Could you please change it to the proper RUSTC_WRAPPER ?

For reference: dtolnay/anyhow#248

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I've now submitted #563 to fix that.

println!("cargo:rerun-if-env-changed=PROFILE");
}

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