Skip to content

Commit 726f39a

Browse files
authored
Rollup merge of rust-lang#63196 - RalfJung:build_helper, r=alexcrichton
build_helper: try less confusing method names build_helper's `*_silent` methods were likely called that way because they do not print the command being run to stdout. [In the original file this all makes sense](rust-lang@046e687#diff-5c3d6537a43ecae03014e118a7fe3321). But later it also gained `*_suppressed` methods and the difference between `silent` and `suppressed` is far from clear. So rename `run` (which prints the command being run) to `run_verbose`. Then we can call the methods that just run a command and show its output but nothing extra `run` and `try_run`. `run_verbose` (formerly `run`) is unused from what I can tell. Should I remove it? r? @alexcrichton Cc @Mark-Simulacrum Also see rust-lang#63089 (comment).
2 parents edc846f + 30f61de commit 726f39a

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

src/bootstrap/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ use std::os::unix::fs::symlink as symlink_file;
125125
use std::os::windows::fs::symlink_file;
126126

127127
use build_helper::{
128-
mtime, output, run_silent, run_suppressed, t, try_run_silent, try_run_suppressed,
128+
mtime, output, run, run_suppressed, t, try_run, try_run_suppressed,
129129
};
130130
use filetime::FileTime;
131131

@@ -682,7 +682,7 @@ impl Build {
682682
fn run(&self, cmd: &mut Command) {
683683
if self.config.dry_run { return; }
684684
self.verbose(&format!("running: {:?}", cmd));
685-
run_silent(cmd)
685+
run(cmd)
686686
}
687687

688688
/// Runs a command, printing out nice contextual information if it fails.
@@ -698,7 +698,7 @@ impl Build {
698698
fn try_run(&self, cmd: &mut Command) -> bool {
699699
if self.config.dry_run { return true; }
700700
self.verbose(&format!("running: {:?}", cmd));
701-
try_run_silent(cmd)
701+
try_run(cmd)
702702
}
703703

704704
/// Runs a command, printing out nice contextual information if it fails.

src/bootstrap/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1527,7 +1527,7 @@ impl Step for RustcGuide {
15271527
fn run(self, builder: &Builder<'_>) {
15281528
let src = builder.src.join("src/doc/rustc-guide");
15291529
let mut rustbook_cmd = builder.tool_cmd(Tool::Rustbook);
1530-
try_run_quiet(builder, rustbook_cmd.arg("linkcheck").arg(&src));
1530+
try_run(builder, rustbook_cmd.arg("linkcheck").arg(&src));
15311531
}
15321532
}
15331533

src/build_helper/lib.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,19 @@ pub fn restore_library_path() {
4545
}
4646
}
4747

48-
pub fn run(cmd: &mut Command) {
48+
/// Run the command, printing what we are running.
49+
pub fn run_verbose(cmd: &mut Command) {
4950
println!("running: {:?}", cmd);
50-
run_silent(cmd);
51+
run(cmd);
5152
}
5253

53-
pub fn run_silent(cmd: &mut Command) {
54-
if !try_run_silent(cmd) {
54+
pub fn run(cmd: &mut Command) {
55+
if !try_run(cmd) {
5556
std::process::exit(1);
5657
}
5758
}
5859

59-
pub fn try_run_silent(cmd: &mut Command) -> bool {
60+
pub fn try_run(cmd: &mut Command) -> bool {
6061
let status = match cmd.status() {
6162
Ok(status) => status,
6263
Err(e) => fail(&format!(

0 commit comments

Comments
 (0)