Skip to content

Commit 3f102f3

Browse files
authored
Merge pull request #3845 from nathaniel-bennett/rustc-wrapper-fix-0.2
[0.2] Add RUSTC_WRAPPER support to build script
2 parents 9b1ec25 + 570d892 commit 3f102f3

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

build.rs

+11-2
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").as_ref() {
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)