Skip to content

Commit

Permalink
apply RUSTC_WRAPPER when querying rustc version
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung authored and stepancheg committed Oct 15, 2024
1 parent 3ba69de commit 37e0613
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion protobuf/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,15 @@ fn version_is_nightly(version: &str) -> bool {

fn cfg_rust_version() {
let rustc = env::var("RUSTC").expect("RUSTC unset");
let mut cmd = if let Some(wrapper) = env::var_os("RUSTC_WRAPPER").filter(|w| !w.is_empty()) {
let mut cmd = process::Command::new(wrapper);
cmd.arg(rustc);
cmd
} else {
process::Command::new(rustc)
};

let mut child = process::Command::new(rustc)
let mut child = cmd
.args(&["--version"])
.stdin(process::Stdio::null())
.stdout(process::Stdio::piped())
Expand Down

0 comments on commit 37e0613

Please sign in to comment.