u-output-failed-commands
authorRust Maintainers <pkg-rust-maintainers@lists.alioth.debian.org>
Sun, 15 Oct 2017 19:31:03 +0000 (20:31 +0100)
committerXimin Luo <infinity0@debian.org>
Sun, 15 Oct 2017 19:31:03 +0000 (20:31 +0100)
Gbp-Pq: Name u-output-failed-commands.patch

src/bootstrap/check.rs
src/bootstrap/lib.rs
src/bootstrap/step.rs

index 5483b6a914b29a3bdd9fde93c02f99e57a03e437..d650ef102379257e7888b73e4d48748d7826f452 100644 (file)
@@ -61,8 +61,8 @@ impl fmt::Display for TestKind {
 fn try_run(build: &Build, cmd: &mut Command) {
     if build.flags.cmd.no_fail_fast() {
         if !build.try_run(cmd) {
-            let failures = build.delayed_failures.get();
-            build.delayed_failures.set(failures + 1);
+            let mut failures = &mut build.delayed_failures.borrow_mut();
+            failures.push(format!("{:?}", cmd));
         }
     } else {
         build.run(cmd);
@@ -72,8 +72,8 @@ fn try_run(build: &Build, cmd: &mut Command) {
 fn try_run_quiet(build: &Build, cmd: &mut Command) {
     if build.flags.cmd.no_fail_fast() {
         if !build.try_run_quiet(cmd) {
-            let failures = build.delayed_failures.get();
-            build.delayed_failures.set(failures + 1);
+            let mut failures = &mut build.delayed_failures.borrow_mut();
+            failures.push(format!("{:?}", cmd));
         }
     } else {
         build.run_quiet(cmd);
index 00cbc589ae6a04c53d83b38606e98b90069a07f9..b16902ae5c68a6878774b1cac08d47615c7f5971 100644 (file)
@@ -79,7 +79,7 @@ extern crate toml;
 #[cfg(unix)]
 extern crate libc;
 
-use std::cell::Cell;
+use std::cell::RefCell;
 use std::cmp;
 use std::collections::HashMap;
 use std::env;
@@ -181,7 +181,7 @@ pub struct Build {
     is_sudo: bool,
     src_is_git: bool,
     ci_env: CiEnv,
-    delayed_failures: Cell<usize>,
+    delayed_failures: RefCell<Vec<String>>,
 }
 
 #[derive(Debug)]
@@ -276,7 +276,7 @@ impl Build {
             is_sudo: is_sudo,
             src_is_git: src_is_git,
             ci_env: CiEnv::current(),
-            delayed_failures: Cell::new(0),
+            delayed_failures: RefCell::new(Vec::new()),
         }
     }
 
index dcbd70fab63f48c51db520a7c992da2e5c3857fe..b9ebdd03d67046abd4fbc65c6d6d4e2aa9185b74 100644 (file)
@@ -1268,9 +1268,12 @@ invalid rule dependency graph detected, was a rule added and maybe typo'd?
         }
 
         // Check for postponed failures from `test --no-fail-fast`.
-        let failures = self.build.delayed_failures.get();
-        if failures > 0 {
-            println!("\n{} command(s) did not execute successfully.\n", failures);
+        let failures = self.build.delayed_failures.borrow();
+        if failures.len() > 0 {
+            println!("\n{} command(s) did not execute successfully:\n", failures.len());
+            for failure in failures.iter() {
+                println!("  - {}\n", failure);
+            }
             process::exit(1);
         }
     }