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