File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,44 @@ Caused by:
47
47
. run ( ) ;
48
48
}
49
49
50
+ #[ cargo_test]
51
+ fn custom_build_script_failed_backtraces_message ( ) {
52
+ // In this situation (no dependency sharing), debuginfo is turned off in
53
+ // `dev.build-override`. However, if an error occurs running e.g. a build
54
+ // script, and backtraces are opted into: a message explaining how to
55
+ // improve backtraces is also displayed.
56
+ let p = project ( )
57
+ . file (
58
+ "Cargo.toml" ,
59
+ r#"
60
+ [package]
61
+
62
+ name = "foo"
63
+ version = "0.5.0"
64
+ authors = ["wycats@example.com"]
65
+ build = "build.rs"
66
+ "# ,
67
+ )
68
+ . file ( "src/main.rs" , "fn main() {}" )
69
+ . file ( "build.rs" , "fn main() { std::process::exit(101); }" )
70
+ . build ( ) ;
71
+ p. cargo ( "build -v" )
72
+ . env ( "RUST_BACKTRACE" , "1" )
73
+ . with_status ( 101 )
74
+ . with_stderr (
75
+ "\
76
+ [COMPILING] foo v0.5.0 ([CWD])
77
+ [RUNNING] `rustc --crate-name build_script_build build.rs [..]--crate-type bin [..]`
78
+ [RUNNING] `[..]/build-script-build`
79
+ [ERROR] failed to run custom build command for `foo v0.5.0 ([CWD])`
80
+ note: To improve backtraces for build dependencies[..]
81
+
82
+ Caused by:
83
+ process didn't exit successfully: `[..]/build-script-build` (exit [..]: 101)" ,
84
+ )
85
+ . run ( ) ;
86
+ }
87
+
50
88
#[ cargo_test]
51
89
fn custom_build_env_vars ( ) {
52
90
let p = project ( )
You can’t perform that action at this time.
0 commit comments