Skip to content

Commit

Permalink
Merge pull request #3842 from nathaniel-bennett/rustc-wrapper-fix
Browse files Browse the repository at this point in the history
Add RUSTC_WRAPPER support to build script
  • Loading branch information
tgross35 authored Aug 16, 2024
2 parents 6eddffb + 8dba4a0 commit fc28283
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,16 @@ 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 = if let Some(wrapper) = env::var_os("RUSTC_WRAPPER").filter(|w| !w.is_empty()) {
let mut cmd = Command::new(wrapper);
cmd.arg(rustc);
cmd
} else {
Command::new(rustc)
};

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

0 comments on commit fc28283

Please sign in to comment.