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};
3
3
use std:: path:: Path ;
4
4
use std:: process:: Command ;
5
5
6
+ use crate :: ci:: CiEnv ;
7
+
6
8
/// Invokes `build_helper::util::detail_exit` with `cfg!(test)`
7
9
///
8
10
/// 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) -> ! {
20
22
if is_test {
21
23
panic ! ( "status code: {code}" ) ;
22
24
} 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
+
23
34
// otherwise, exit with provided status code
24
35
std:: process:: exit ( code) ;
25
36
}
You can’t perform that action at this time.
0 commit comments