From 79a1e7aaa68dea2ca80c3af38ad62bcf5f01b506 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 1 Aug 2019 20:08:49 +0200 Subject: [PATCH 1/3] build_helper: rename run -> run_verbose (seems unused) --- src/build_helper/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/build_helper/lib.rs b/src/build_helper/lib.rs index c30307f3a1b28..1e395b5ddea6d 100644 --- a/src/build_helper/lib.rs +++ b/src/build_helper/lib.rs @@ -45,7 +45,8 @@ pub fn restore_library_path() { } } -pub fn run(cmd: &mut Command) { +/// Run the command, printing what we are running. +pub fn run_verbose(cmd: &mut Command) { println!("running: {:?}", cmd); run_silent(cmd); } From 0d8c97b465476c59da7228ad9a207e252b542b38 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 1 Aug 2019 20:13:47 +0200 Subject: [PATCH 2/3] build_helper: rename (try_)run_silent -> (try_)run --- src/bootstrap/lib.rs | 6 +++--- src/build_helper/lib.rs | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index c2e64ef51a746..c8ea3157dc92b 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -125,7 +125,7 @@ use std::os::unix::fs::symlink as symlink_file; use std::os::windows::fs::symlink_file; use build_helper::{ - mtime, output, run_silent, run_suppressed, t, try_run_silent, try_run_suppressed, + mtime, output, run, run_suppressed, t, try_run, try_run_suppressed, }; use filetime::FileTime; @@ -682,7 +682,7 @@ impl Build { fn run(&self, cmd: &mut Command) { if self.config.dry_run { return; } self.verbose(&format!("running: {:?}", cmd)); - run_silent(cmd) + run(cmd) } /// Runs a command, printing out nice contextual information if it fails. @@ -698,7 +698,7 @@ impl Build { fn try_run(&self, cmd: &mut Command) -> bool { if self.config.dry_run { return true; } self.verbose(&format!("running: {:?}", cmd)); - try_run_silent(cmd) + try_run(cmd) } /// Runs a command, printing out nice contextual information if it fails. diff --git a/src/build_helper/lib.rs b/src/build_helper/lib.rs index 1e395b5ddea6d..a1aa18922b5c5 100644 --- a/src/build_helper/lib.rs +++ b/src/build_helper/lib.rs @@ -48,16 +48,16 @@ pub fn restore_library_path() { /// Run the command, printing what we are running. pub fn run_verbose(cmd: &mut Command) { println!("running: {:?}", cmd); - run_silent(cmd); + run(cmd); } -pub fn run_silent(cmd: &mut Command) { - if !try_run_silent(cmd) { +pub fn run(cmd: &mut Command) { + if !try_run(cmd) { std::process::exit(1); } } -pub fn try_run_silent(cmd: &mut Command) -> bool { +pub fn try_run(cmd: &mut Command) -> bool { let status = match cmd.status() { Ok(status) => status, Err(e) => fail(&format!( From 30f61dec30c01c260587760770da83b29d9cce6a Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 1 Aug 2019 20:21:25 +0200 Subject: [PATCH 3/3] replace what I think is an erroneous try_run_quiet by try_run --- src/bootstrap/test.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index fec7f73f3b7e5..1f81efd16a7e4 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -1527,7 +1527,7 @@ impl Step for RustcGuide { fn run(self, builder: &Builder<'_>) { let src = builder.src.join("src/doc/rustc-guide"); let mut rustbook_cmd = builder.tool_cmd(Tool::Rustbook); - try_run_quiet(builder, rustbook_cmd.arg("linkcheck").arg(&src)); + try_run(builder, rustbook_cmd.arg("linkcheck").arg(&src)); } }