Skip to content

Commit 93e0783

Browse files
Add RUSTC_WRAPPER support to build script
(cherry picked from commit 8dba4a0)
1 parent 67c4300 commit 93e0783

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

build.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,17 @@ fn rustc_minor_nightly() -> (u32, bool) {
196196
};
197197
}
198198

199-
let rustc = otry!(env::var_os("RUSTC"));
200-
let output = Command::new(rustc)
199+
let rustc = env::var_os("RUSTC").expect("Failed to get rustc version: missing RUSTC env");
200+
let mut cmd = match env::var_os("RUSTC_WRAPPER") {
201+
Some(wrapper) if !wrapper.is_empty() => {
202+
let mut cmd = Command::new(wrapper);
203+
cmd.arg(rustc);
204+
cmd
205+
}
206+
_ => Command::new(rustc),
207+
};
208+
209+
let output = cmd
201210
.arg("--version")
202211
.output()
203212
.ok()

0 commit comments

Comments
 (0)