Skip to content

Commit

Permalink
Unrolled build for rust-lang#124903
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#124903 - Skepfyr:rustc-wrapper, r=clubby789

Ignore empty RUSTC_WRAPPER in bootstrap

This change ignores the RUSTC_WRAPPER_REAL environment variable if it's set to the empty string. This matches cargo behaviour and allows users to easily shadow a globally set RUSTC_WRAPPER (which they might have set for non-rustc projects).

I hit this because I have RUSTC_WRAPPER set to `sccache` in my fish universal env vars, and I can only shadow those locally with an empty string, I can't unset it entirely.
  • Loading branch information
rust-timer committed May 8, 2024
2 parents ec1b698 + c7003f5 commit da29bfa
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/bootstrap/src/bin/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,13 @@ fn main() {
rustc_real
};

let mut cmd = if let Some(wrapper) = env::var_os("RUSTC_WRAPPER_REAL") {
let mut cmd = Command::new(wrapper);
cmd.arg(rustc_driver);
cmd
} else {
Command::new(rustc_driver)
let mut cmd = match env::var_os("RUSTC_WRAPPER_REAL") {
Some(wrapper) if !wrapper.is_empty() => {
let mut cmd = Command::new(wrapper);
cmd.arg(rustc_driver);
cmd
}
_ => Command::new(rustc_driver),
};
cmd.args(&args).env(dylib_path_var(), env::join_paths(&dylib_path).unwrap());

Expand Down

0 comments on commit da29bfa

Please sign in to comment.