-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Do not unconditionally succeed RUSTC_WRAPPER checks when run by build scripts #13010
Conversation
… scripts rust-analyzer's RUSTC_WRAPPER unconditionally succeeds `cargo check` invocations tripping up build scripts using `cargo check` to probe for successful compilations. To prevent this from happening the RUSTC_WRAPPER now checks if it's run from a build script by looking for the `CARGO_CFG_TARGET_ARCH` env var that cargo sets only when running build scripts.
I tested this on two workspaces that exhibit the problem reported with |
Thank you for testing! There shouldn't be any regressions caused due to this (unless cargo sets this env var in other occasions which it shouldn't) |
☀️ Test successful - checks-actions |
This seems to cause unnecessary rebuilds, it seems. Some crate that depends on |
this is only invoked on startup for rust-analyzer, so this cannot have changed the behavior for when you save |
Hrm, then something else must've changed between this and last Monday's release. Sorry for the noise here then. |
The only recent relevant change I could think of is #12808, but that is 2 releases ago, not one |
You might be hitting this issue. |
Thanks, that seems to have fixed this |
9235: Do not unconditionally succeed RUSTC_WRAPPER when run by build scripts r=Undin a=vlad20012 Fixes #9198, fixes #9227. Based on rust-lang/rust-analyzer#13010 and discussion in rust-lang/rust-analyzer#12973. intellij-rust-native-helper in `RUSTC_WRAPPER` role unconditionally succeeds `cargo check` invocations tripping up build scripts using `cargo check` to probe for successful compilations. To prevent this from happening the `RUSTC_WRAPPER` now checks if it's run from a build script by looking for the `CARGO_CFG_TARGET_ARCH` env var that cargo sets only when running build scripts. changelog: Fix broken `anyhow` compilation when `org.rust.cargo.evaluate.build.scripts` [experimental feature](https://plugins.jetbrains.com/plugin/8182-rust/docs/rust-faq.html#experimental-features) is enabled Co-authored-by: vlad20012 <beskvlad@gmail.com>
rust-analyzer's RUSTC_WRAPPER unconditionally succeeds
cargo check
invocations tripping up build scripts using
cargo check
to probe forsuccessful compilations. To prevent this from happening the RUSTC_WRAPPER
now checks if it's run from a build script by looking for the
CARGO_CFG_TARGET_ARCH
env var that cargo sets only when running buildscripts.