Skip to content

Commit c7003f5

Browse files
committed
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).
1 parent ce652db commit c7003f5

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)