Skip to content

Commit 92b6a57

Browse files
committed
fix: use RUST_WORKSPACE_WRAPPER in compile probe
1 parent f80de3e commit 92b6a57

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

eyre/build.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,16 @@ fn compile_probe(probe: &str) -> Option<ExitStatus> {
6969
let probefile = Path::new(&out_dir).join("probe.rs");
7070
fs::write(&probefile, probe).ok()?;
7171

72-
// Supports invoking rustc thrugh a wrapper
73-
let mut cmd = if let Some(wrapper) = env::var_os("RUSTC_WRAPPER") {
74-
let mut cmd = Command::new(wrapper);
75-
76-
cmd.arg(rustc);
77-
78-
cmd
79-
} else {
80-
Command::new(rustc)
81-
};
72+
let rustc_wrapper = env::var_os("RUSTC_WRAPPER").filter(|wrapper| !wrapper.is_empty());
73+
let rustc_workspace_wrapper =
74+
env::var_os("RUSTC_WORKSPACE_WRAPPER").filter(|wrapper| !wrapper.is_empty());
75+
let mut rustc = rustc_wrapper
76+
.into_iter()
77+
.chain(rustc_workspace_wrapper)
78+
.chain(std::iter::once(rustc));
79+
80+
let mut cmd = Command::new(rustc.next().unwrap());
81+
cmd.args(rustc);
8282

8383
if let Some(target) = env::var_os("TARGET") {
8484
cmd.arg("--target").arg(target);

0 commit comments

Comments
 (0)