]>
Commit | Line | Data |
---|---|---|
83b02c13 XL |
1 | Description: rustbuild: with --no-fail-fast, report the specific commands that failed |
2 | Author: Ximin Luo <infinity0@debian.org> | |
3 | Bug: https://github.com/rust-lang/rust/pull/44680 | |
4 | ||
6185c016 XL |
5 | --- a/src/bootstrap/check.rs |
6 | +++ b/src/bootstrap/check.rs | |
1c888d53 | 7 | @@ -67,8 +67,8 @@ |
6185c016 | 8 | fn try_run(build: &Build, cmd: &mut Command) { |
798afc80 | 9 | if !build.fail_fast { |
6185c016 XL |
10 | if !build.try_run(cmd) { |
11 | - let failures = build.delayed_failures.get(); | |
12 | - build.delayed_failures.set(failures + 1); | |
13 | + let mut failures = &mut build.delayed_failures.borrow_mut(); | |
14 | + failures.push(format!("{:?}", cmd)); | |
15 | } | |
16 | } else { | |
17 | build.run(cmd); | |
1c888d53 | 18 | @@ -78,8 +78,8 @@ |
6185c016 | 19 | fn try_run_quiet(build: &Build, cmd: &mut Command) { |
798afc80 | 20 | if !build.fail_fast { |
6185c016 XL |
21 | if !build.try_run_quiet(cmd) { |
22 | - let failures = build.delayed_failures.get(); | |
23 | - build.delayed_failures.set(failures + 1); | |
24 | + let mut failures = &mut build.delayed_failures.borrow_mut(); | |
25 | + failures.push(format!("{:?}", cmd)); | |
26 | } | |
27 | } else { | |
28 | build.run_quiet(cmd); | |
29 | --- a/src/bootstrap/lib.rs | |
30 | +++ b/src/bootstrap/lib.rs | |
f4af8d6a | 31 | @@ -134,13 +134,13 @@ |
6185c016 XL |
32 | #[cfg(unix)] |
33 | extern crate libc; | |
34 | ||
35 | -use std::cell::Cell; | |
36 | +use std::cell::RefCell; | |
1c888d53 | 37 | use std::collections::{HashSet, HashMap}; |
6185c016 | 38 | use std::env; |
1c888d53 | 39 | use std::fs::{self, File}; |
f4af8d6a XL |
40 | use std::io::Read; |
41 | use std::path::{PathBuf, Path}; | |
42 | -use std::process::Command; | |
43 | +use std::process::{self, Command}; | |
44 | use std::slice; | |
45 | ||
46 | use build_helper::{run_silent, run_suppressed, try_run_silent, try_run_suppressed, output, mtime}; | |
1c888d53 XL |
47 | @@ -245,7 +245,7 @@ |
48 | crates: HashMap<Interned<String>, Crate>, | |
6185c016 | 49 | is_sudo: bool, |
6185c016 XL |
50 | ci_env: CiEnv, |
51 | - delayed_failures: Cell<usize>, | |
52 | + delayed_failures: RefCell<Vec<String>>, | |
53 | } | |
54 | ||
55 | #[derive(Debug)] | |
1c888d53 | 56 | @@ -327,7 +327,7 @@ |
798afc80 | 57 | lldb_python_dir: None, |
1c888d53 | 58 | is_sudo, |
6185c016 XL |
59 | ci_env: CiEnv::current(), |
60 | - delayed_failures: Cell::new(0), | |
61 | + delayed_failures: RefCell::new(Vec::new()), | |
62 | } | |
63 | } | |
64 | ||
1c888d53 XL |
65 | @@ -366,6 +366,16 @@ |
66 | metadata::build(self); | |
6185c016 | 67 | |
1c888d53 XL |
68 | builder::Builder::run(&self); |
69 | + | |
70 | + // Check for postponed failures from `test --no-fail-fast`. | |
71 | + let failures = self.delayed_failures.borrow(); | |
6185c016 XL |
72 | + if failures.len() > 0 { |
73 | + println!("\n{} command(s) did not execute successfully:\n", failures.len()); | |
74 | + for failure in failures.iter() { | |
75 | + println!(" - {}\n", failure); | |
76 | + } | |
1c888d53 XL |
77 | + process::exit(1); |
78 | + } | |
6185c016 | 79 | } |
1c888d53 XL |
80 | |
81 | /// Clear out `dir` if `input` is newer. |