You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Cargo directives aren't part of the error message text (except cargo:warning, which is reported separately).
522
523
// Some scripts print a lot of cargo:rerun-if-env-changed that obscure the root cause of the failure.
523
524
if parsing_stdout && line.starts_with("cargo:"){
524
525
continue;
525
526
}
526
527
528
+
if !parsing_stdout && may_be_panic {
529
+
// Panics print a backtrace, but the location within the build script is not interesting to downstream users
530
+
if line == "stack backtrace:"{
531
+
skipping_backtrace = true;
532
+
continue;
533
+
}
534
+
if line == "note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace." || line == "note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace"{
535
+
skipping_backtrace = false;
536
+
continue;
537
+
}
538
+
if skipping_backtrace {
539
+
if line.starts_with(" "){
540
+
continue;
541
+
}
542
+
skipping_backtrace = false;
543
+
}
544
+
// Build scripts tend to unwrap() errors. This skips the most common panic message boilerplate.
545
+
ifletSome(rest) = line.strip_prefix("thread 'main' panicked at "){
546
+
line = rest;
547
+
ifletSome(rest) =
548
+
line.strip_prefix("'called `Result::unwrap()` on an `Err` value: ")
0 commit comments