File tree 1 file changed +10
-9
lines changed
1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change 1
1
use std:: env;
2
2
use std:: ffi:: OsString ;
3
+ use std:: iter;
3
4
use std:: path:: Path ;
4
5
use std:: process:: { self , Command , Stdio } ;
5
6
@@ -66,15 +67,15 @@ fn compile_probe(rustc_bootstrap: bool) -> bool {
66
67
let out_dir = cargo_env_var ( "OUT_DIR" ) ;
67
68
let probefile = Path :: new ( "build" ) . join ( "probe.rs" ) ;
68
69
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 ) ;
78
79
79
80
if !rustc_bootstrap {
80
81
cmd. env_remove ( "RUSTC_BOOTSTRAP" ) ;
You can’t perform that action at this time.
0 commit comments