Skip to content

Commit

Permalink
Add RUSTC_WRAPPER support to build script
Browse files Browse the repository at this point in the history
  • Loading branch information
nathaniel-bennett committed Aug 16, 2024
1 parent 6eddffb commit 8dba4a0
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 8dba4a0

Please sign in to comment.