-
Notifications
You must be signed in to change notification settings - Fork 380
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 when run by build scripts #9235
Do not unconditionally succeed RUSTC_WRAPPER when run by build scripts #9235
Conversation
I think it should fix #9227 as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, looks ok for me
Maybe add some tests to emulate a situation happened with anyhow crate?
cbe129a
to
41c28dc
Compare
src/test/kotlin/org/rustSlowTests/lang/resolve/CargoGeneratedItemsResolveTest.kt
Outdated
Show resolved
Hide resolved
src/test/kotlin/org/rustSlowTests/lang/resolve/CargoGeneratedItemsResolveTest.kt
Outdated
Show resolved
Hide resolved
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.
41c28dc
to
f540fe2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors r+
Build succeeded: |
For QA: I failed to reproduce mentioned issues when Sync tool window shows error. I tested the following scenario:
Before these changes, |
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 succeedscargo check
invocations tripping up build scripts usingcargo check
to probe for successful compilations. To prevent this from happening theRUSTC_WRAPPER
now checks if it's run from a build script by looking for theCARGO_CFG_TARGET_ARCH
env var that cargo sets only when running build scripts.changelog: Fix broken
anyhow
compilation whenorg.rust.cargo.evaluate.build.scripts
experimental feature is enabled