File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -61,10 +61,19 @@ impl fmt::Display for ProcessWrapperError {
61
61
62
62
impl std:: error:: Error for ProcessWrapperError { }
63
63
64
+ macro_rules! log {
65
+ ( $( $arg: tt) * ) => {
66
+ if std:: env:: var( "RULES_RUST_PROCESS_WRAPPER_DEBUG" ) . is_ok( ) {
67
+ eprintln!( $( $arg) * ) ;
68
+ }
69
+ } ;
70
+ }
71
+
64
72
fn main ( ) -> Result < ( ) , ProcessWrapperError > {
65
73
let opts = options ( ) . map_err ( |e| ProcessWrapperError ( e. to_string ( ) ) ) ?;
66
74
67
- let mut child = Command :: new ( opts. executable )
75
+ let mut command = Command :: new ( opts. executable ) ;
76
+ command
68
77
. args ( opts. child_arguments )
69
78
. env_clear ( )
70
79
. envs ( opts. child_environment )
@@ -79,7 +88,9 @@ fn main() -> Result<(), ProcessWrapperError> {
79
88
} else {
80
89
Stdio :: inherit ( )
81
90
} )
82
- . stderr ( Stdio :: piped ( ) )
91
+ . stderr ( Stdio :: piped ( ) ) ;
92
+ log ! ( "{:#?}" , command) ;
93
+ let mut child = command
83
94
. spawn ( )
84
95
. map_err ( |e| ProcessWrapperError ( format ! ( "failed to spawn child process: {}" , e) ) ) ?;
85
96
You can’t perform that action at this time.
0 commit comments