Skip to content

Commit 18639db

Browse files
authored
Rollup merge of #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.
2 parents 294ac1b + c7003f5 commit 18639db

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/bootstrap/src/bin/rustc.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,13 @@ fn main() {
9191
rustc_real
9292
};
9393

94-
let mut cmd = if let Some(wrapper) = env::var_os("RUSTC_WRAPPER_REAL") {
95-
let mut cmd = Command::new(wrapper);
96-
cmd.arg(rustc_driver);
97-
cmd
98-
} else {
99-
Command::new(rustc_driver)
94+
let mut cmd = match env::var_os("RUSTC_WRAPPER_REAL") {
95+
Some(wrapper) if !wrapper.is_empty() => {
96+
let mut cmd = Command::new(wrapper);
97+
cmd.arg(rustc_driver);
98+
cmd
99+
}
100+
_ => Command::new(rustc_driver),
100101
};
101102
cmd.args(&args).env(dylib_path_var(), env::join_paths(&dylib_path).unwrap());
102103

0 commit comments

Comments
 (0)