Skip to content

Commit

Permalink
Merge pull request #3845 from nathaniel-bennett/rustc-wrapper-fix-0.2
Browse files Browse the repository at this point in the history
[0.2] Add RUSTC_WRAPPER support to build script
  • Loading branch information
tgross35 authored Aug 17, 2024
2 parents 9b1ec25 + 570d892 commit 3f102f3
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,17 @@ fn rustc_minor_nightly() -> (u32, bool) {
};
}

let rustc = otry!(env::var_os("RUSTC"));
let output = Command::new(rustc)
let rustc = env::var_os("RUSTC").expect("Failed to get rustc version: missing RUSTC env");
let mut cmd = match env::var_os("RUSTC_WRAPPER").as_ref() {
Some(wrapper) if !wrapper.is_empty() => {
let mut cmd = Command::new(wrapper);
cmd.arg(rustc);
cmd
}
_ => Command::new(rustc),
};

let output = cmd
.arg("--version")
.output()
.ok()
Expand Down

0 comments on commit 3f102f3

Please sign in to comment.