File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change 11use std:: env;
22use std:: ffi:: OsString ;
3+ use std:: iter;
34use std:: path:: Path ;
45use std:: process:: { self , Command , Stdio } ;
56
@@ -66,15 +67,15 @@ fn compile_probe(rustc_bootstrap: bool) -> bool {
6667 let out_dir = cargo_env_var ( "OUT_DIR" ) ;
6768 let probefile = Path :: new ( "build" ) . join ( "probe.rs" ) ;
6869
69- // Make sure to pick up Cargo rustc configuration.
70- let mut cmd = if let Some ( wrapper ) = env :: var_os ( "RUSTC_WRAPPER" ) {
71- let mut cmd = Command :: new ( wrapper) ;
72- // The wrapper's first argument is supposed to be the path to rustc.
73- cmd . arg ( rustc ) ;
74- cmd
75- } else {
76- Command :: new ( rustc)
77- } ;
70+ let rustc_wrapper = env :: var_os ( "RUSTC_WRAPPER" ) . filter ( |wrapper| !wrapper . is_empty ( ) ) ;
71+ let rustc_workspace_wrapper =
72+ env :: var_os ( "RUSTC_WORKSPACE_WRAPPER" ) . filter ( | wrapper| !wrapper . is_empty ( ) ) ;
73+ let mut rustc = rustc_wrapper
74+ . into_iter ( )
75+ . chain ( rustc_workspace_wrapper )
76+ . chain ( iter :: once ( rustc ) ) ;
77+ let mut cmd = Command :: new ( rustc. next ( ) . unwrap ( ) ) ;
78+ cmd . args ( rustc ) ;
7879
7980 if !rustc_bootstrap {
8081 cmd. env_remove ( "RUSTC_BOOTSTRAP" ) ;
You can’t perform that action at this time.
0 commit comments