Skip to content

Commit

Permalink
Merge pull request #1605 from dtolnay/workspacewrapper
Browse files Browse the repository at this point in the history
Apply RUSTC_WORKSPACE_WRAPPER
  • Loading branch information
dtolnay authored Mar 26, 2024
2 parents aebdd7a + 3748333 commit dcd74f5
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use std::env;
use std::ffi::OsString;
use std::iter;
use std::process::{self, Command, Stdio};

// The rustc-cfg strings below are *not* public API. Please let us know by
Expand All @@ -20,16 +21,15 @@ fn main() {

fn unstable() -> bool {
let rustc = cargo_env_var("RUSTC");

// Pick up Cargo rustc configuration.
let mut cmd = if let Some(wrapper) = env::var_os("RUSTC_WRAPPER") {
let mut cmd = Command::new(wrapper);
// The wrapper's first argument is supposed to be the path to rustc.
cmd.arg(rustc);
cmd
} else {
Command::new(rustc)
};
let rustc_wrapper = env::var_os("RUSTC_WRAPPER").filter(|wrapper| !wrapper.is_empty());
let rustc_workspace_wrapper =
env::var_os("RUSTC_WORKSPACE_WRAPPER").filter(|wrapper| !wrapper.is_empty());
let mut rustc = rustc_wrapper
.into_iter()
.chain(rustc_workspace_wrapper)
.chain(iter::once(rustc));
let mut cmd = Command::new(rustc.next().unwrap());
cmd.args(rustc);

cmd.stdin(Stdio::null());
cmd.stdout(Stdio::null());
Expand Down

0 comments on commit dcd74f5

Please sign in to comment.