-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
RUSTC_WRAPPER is ignored for rustc -vV
call
#10885
Comments
cargo-miri: set RUSTC to us Works around rust-lang/cargo#10885.
cargo-miri: set RUSTC to us Works around rust-lang/cargo#10885.
The current behavior is annoying for both Miri and bootstrap, and probably other tools -- everyone has to overwrite both RUSTC_WRAPPER and RUSTC, which is quite surprising. At least in the case of Miri it is also fragile: what I'd like to do is set RUSTC to @ehuss this was previously attempted in #10887, but unfortunately rejected because more testing was requested. So it seems like passing the cargo test suite is not sufficient. I have never used sccache, so I don't even know what "using sccache" looks like, let alone testing it sufficiently. Is there documentation of what you think should be done? Is it sufficient to pass rustc bootstrap, or does that not use sccache? sccache is mentioned in It seems hard for me to imagine that a wrapper would work with |
To test with sccache, I would recommend going to https://github.com/mozilla/sccache and reading the instructions. You just need to install the sccache binary ( rustc does not directly use sccache for building Rust code, it is only used for caching the llvm build. I think some people use it for local development, and I believe all you have to do is set RUSTC_WRAPPER. The concern is that sccache parses the rustc command-line, and there have been several instances in the past where small changes of the options have broken sccache. It probably works, but it is worth checking. |
FWIW bootstrap also has trouble with this. |
Copying over from #14385 (comment)
|
Problem
We are setting RUSTC_WRAPPER in order to intercept every invocation of rustc from cargo. However, it looks like cargo will call
rustc -vV
in any case, completely bypassing the RUSTC_WRAPPER env var. Only the RUSTC env var seems to be honored for the-vV
call. This is causing us a bunch of pain right now since we need to figure out how to best intercept this-vV
call.The docs describe both RUSTC and RUSTC_WRAPPER in very similar terms, so I think this is clearly a bug -- both env vars should be effective for the same invocations.
We prefer to use RUSTC_WRAPPER over RUSTC because we need to intercept all things that cargo calls (including rustdoc, and running the actual binaries), and RUSTC_WRAPPER makes it easier to figure out what cargo called us for -- if we are invoked with the first argument being
rustc
, we know it was rustc that cargo wanted. (This is in thecargo-miri
wrapper.)The text was updated successfully, but these errors were encountered: