File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ use std::io::{BufRead, BufReader};
33use std:: path:: Path ;
44use std:: process:: Command ;
55
6+ use crate :: ci:: CiEnv ;
7+
68/// Invokes `build_helper::util::detail_exit` with `cfg!(test)`
79///
810/// This is a macro instead of a function so that it uses `cfg(test)` in the *calling* crate, not in build helper.
@@ -20,6 +22,15 @@ pub fn detail_exit(code: i32, is_test: bool) -> ! {
2022 if is_test {
2123 panic ! ( "status code: {code}" ) ;
2224 } else {
25+ // If we're in CI, print the current bootstrap invocation command, to make it easier to
26+ // figure out what exactly has failed.
27+ if CiEnv :: is_ci ( ) {
28+ // Skip the first argument, as it will be some absolute path to the bootstrap binary.
29+ let bootstrap_args =
30+ std:: env:: args ( ) . skip ( 1 ) . map ( |a| a. to_string ( ) ) . collect :: < Vec < _ > > ( ) . join ( " " ) ;
31+ eprintln ! ( "Bootstrap failed while executing `{bootstrap_args}`" ) ;
32+ }
33+
2334 // otherwise, exit with provided status code
2435 std:: process:: exit ( code) ;
2536 }
You can’t perform that action at this time.
0 commit comments