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

Conversation

sunfishcode
Copy link
Member

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.

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.
println!("cargo:rerun-if-env-changed=CARGO_FEATURE_ALL_IMPLS");
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!

@sunfishcode sunfishcode merged commit faa4c7b into main Feb 28, 2023
@sunfishcode sunfishcode deleted the sunfishcode/rerun-build-script branch February 28, 2023 04:01
sunfishcode added a commit that referenced this pull request Mar 4, 2023
* 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.
sunfishcode added a commit that referenced this pull request Mar 4, 2023
* 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.
celinval added a commit to celinval/kani-dev that referenced this pull request Mar 8, 2023
After updating our dependencies, running `cargo build-dev` always
trigger the recompilation of a few dependencies as well as `kani-driver`
and `kani-compiler`.

This seems to be caused by
[this change](bytecodealliance/rustix#544) on
`rustix` dependency.

The problem here is that we share the same build folder for
our tools and our binaries. But they build with slightly different
cargo arguments, and this package decided to make their build script
very sensitive to changes to their environment

To overcome this, force `cargo build-dev` to use a different folder
for the tools build.
celinval added a commit to model-checking/kani that referenced this pull request Mar 8, 2023
After updating our dependencies, running `cargo build-dev` always trigger the recompilation of a few dependencies as well as `kani-driver` and `kani-compiler`.

This seems to be caused by [this change](bytecodealliance/rustix#544) on `rustix` dependency.

The problem here is that we share the same build folder for our tools and our binaries. But they build with slightly different cargo arguments, and this package decided to make their build script very sensitive to changes to their environment

To overcome this, force `cargo build-dev` to use a different folder for the tools build.
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");

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.

sunfishcode added a commit that referenced this pull request Mar 18, 2023
Similar to dtolnay/anyhow#248, and as suggested [here], check `RUSTC_WRAPPER`
instead of `CARGO_RUSTC_WRAPPER`.

[here]: #544 (comment)
sunfishcode added a commit that referenced this pull request Mar 18, 2023
Similar to dtolnay/anyhow#248, and as suggested [here], check `RUSTC_WRAPPER`
instead of `CARGO_RUSTC_WRAPPER`.

[here]: #544 (comment)
sunfishcode added a commit to sunfishcode/io-lifetimes that referenced this pull request Mar 18, 2023
Similar to dtolnay/anyhow#248, and as suggested [here], check `RUSTC_WRAPPER` instead of `CARGO_RUSTC_WRAPPER`.

[here]: bytecodealliance/rustix#544 (comment)
sunfishcode added a commit to sunfishcode/io-lifetimes that referenced this pull request Mar 18, 2023
Similar to dtolnay/anyhow#248, and as suggested [here], check `RUSTC_WRAPPER` instead of `CARGO_RUSTC_WRAPPER`.

[here]: bytecodealliance/rustix#544 (comment)
sunfishcode added a commit to bytecodealliance/cap-std that referenced this pull request Mar 18, 2023
Similar to dtolnay/anyhow#248, and as suggested [here], check `RUSTC_WRAPPER` instead of `CARGO_RUSTC_WRAPPER`.

[here]: bytecodealliance/rustix#544 (comment)
sunfishcode added a commit that referenced this pull request Mar 18, 2023
Similar to dtolnay/anyhow#248, and as suggested [here], check `RUSTC_WRAPPER`
instead of `CARGO_RUSTC_WRAPPER`.

[here]: #544 (comment)
sunfishcode added a commit to bytecodealliance/cap-std that referenced this pull request Mar 18, 2023
Similar to dtolnay/anyhow#248, and as suggested [here], check `RUSTC_WRAPPER` instead of `CARGO_RUSTC_WRAPPER`.

[here]: bytecodealliance/rustix#544 (comment)
sunfishcode added a commit to bytecodealliance/cap-std that referenced this pull request Mar 18, 2023
Similar to dtolnay/anyhow#248, and as suggested [here], check `RUSTC_WRAPPER` instead of `CARGO_RUSTC_WRAPPER`.

[here]: bytecodealliance/rustix#544 (comment)
sunfishcode added a commit that referenced this pull request Mar 18, 2023
Similar to dtolnay/anyhow#248, and as suggested [here], check `RUSTC_WRAPPER`
instead of `CARGO_RUSTC_WRAPPER`.

[here]: #544 (comment)
sunfishcode added a commit to bytecodealliance/cap-std that referenced this pull request Mar 18, 2023
Similar to dtolnay/anyhow#248, and as suggested [here], check `RUSTC_WRAPPER` instead of `CARGO_RUSTC_WRAPPER`.

[here]: bytecodealliance/rustix#544 (comment)
sunfishcode added a commit that referenced this pull request Mar 18, 2023
Similar to dtolnay/anyhow#248, and as suggested [here], check `RUSTC_WRAPPER`
instead of `CARGO_RUSTC_WRAPPER`.

[here]: #544 (comment)
sunfishcode added a commit that referenced this pull request Oct 12, 2023
* 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.
sunfishcode added a commit that referenced this pull request Oct 12, 2023
Similar to dtolnay/anyhow#248, and as suggested [here], check `RUSTC_WRAPPER`
instead of `CARGO_RUSTC_WRAPPER`.

[here]: #544 (comment)
sunfishcode added a commit that referenced this pull request Oct 12, 2023
* 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.
sunfishcode added a commit that referenced this pull request Oct 12, 2023
Similar to dtolnay/anyhow#248, and as suggested [here], check `RUSTC_WRAPPER`
instead of `CARGO_RUSTC_WRAPPER`.

[here]: #544 (comment)
sunfishcode added a commit that referenced this pull request Oct 12, 2023
* 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.
sunfishcode added a commit that referenced this pull request Oct 12, 2023
Similar to dtolnay/anyhow#248, and as suggested [here], check `RUSTC_WRAPPER`
instead of `CARGO_RUSTC_WRAPPER`.

[here]: #544 (comment)
sunfishcode added a commit that referenced this pull request Oct 12, 2023
* 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.
sunfishcode added a commit that referenced this pull request Oct 12, 2023
Similar to dtolnay/anyhow#248, and as suggested [here], check `RUSTC_WRAPPER`
instead of `CARGO_RUSTC_WRAPPER`.

[here]: #544 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants