From 78f51a4be00381b0a6dd578247107962dae7f3c7 Mon Sep 17 00:00:00 2001 From: jyn Date: Thu, 13 Jul 2023 02:19:39 -0500 Subject: [PATCH] Rename `Builder::try_run` to `run_delaying_failure` --- src/bootstrap/lib.rs | 2 +- src/bootstrap/run.rs | 2 +- src/bootstrap/test.rs | 28 ++++++++++++++-------------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 7c53d1a92f7..e64cbc0152b 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -981,7 +981,7 @@ fn try_run_quiet(&self, cmd: &mut Command) -> bool { } /// Runs a command, printing out contextual info if it fails, and delaying errors until the build finishes. - pub(crate) fn try_run(&self, cmd: &mut Command) -> bool { + pub(crate) fn run_delaying_failure(&self, cmd: &mut Command) -> bool { if !self.fail_fast { #[allow(deprecated)] // can't use Build::try_run, that's us if self.config.try_run(cmd).is_err() { diff --git a/src/bootstrap/run.rs b/src/bootstrap/run.rs index 128916b03c6..4082f5bb9b1 100644 --- a/src/bootstrap/run.rs +++ b/src/bootstrap/run.rs @@ -24,7 +24,7 @@ impl Step for ExpandYamlAnchors { /// anchors in them, since GitHub Actions doesn't support them. fn run(self, builder: &Builder<'_>) { builder.info("Expanding YAML anchors in the GitHub Actions configuration"); - builder.try_run( + builder.run_delaying_failure( &mut builder.tool_cmd(Tool::ExpandYamlAnchors).arg("generate").arg(&builder.src), ); } diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index eaf3f3460ac..3852c92d728 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -180,9 +180,7 @@ fn run(self, builder: &Builder<'_>) { let _guard = builder.msg(Kind::Test, compiler.stage, "Linkcheck", bootstrap_host, bootstrap_host); let _time = util::timeit(&builder); - builder.try_run( - linkchecker.arg(builder.out.join(host.triple).join("doc")), - ); + builder.run_delaying_failure(linkchecker.arg(builder.out.join(host.triple).join("doc"))); } fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { @@ -235,7 +233,9 @@ fn run(self, builder: &Builder<'_>) { builder.default_doc(&[]); builder.ensure(crate::doc::Rustc::new(builder.top_stage, self.target, builder)); - builder.try_run(builder.tool_cmd(Tool::HtmlChecker).arg(builder.doc_out(self.target))); + builder.run_delaying_failure( + builder.tool_cmd(Tool::HtmlChecker).arg(builder.doc_out(self.target)), + ); } } @@ -274,7 +274,7 @@ fn run(self, builder: &Builder<'_>) { let _time = util::timeit(&builder); let mut cmd = builder.tool_cmd(Tool::CargoTest); - builder.try_run( + builder.run_delaying_failure( cmd.arg(&cargo) .arg(&out_dir) .args(builder.config.test_args()) @@ -876,7 +876,7 @@ fn run(self, builder: &Builder<'_>) { util::lld_flag_no_threads(self.compiler.host.contains("windows")), ); } - builder.try_run(&mut cmd); + builder.run_delaying_failure(&mut cmd); } } @@ -1136,7 +1136,7 @@ fn run(self, builder: &Builder<'_>) { } builder.info("tidy check"); - builder.try_run(&mut cmd); + builder.run_delaying_failure(&mut cmd); builder.ensure(ExpandYamlAnchors); @@ -1181,7 +1181,7 @@ impl Step for ExpandYamlAnchors { /// by the user before committing CI changes. fn run(self, builder: &Builder<'_>) { builder.info("Ensuring the YAML anchors in the GitHub Actions config were expanded"); - builder.try_run( + builder.run_delaying_failure( &mut builder.tool_cmd(Tool::ExpandYamlAnchors).arg("check").arg(&builder.src), ); } @@ -1970,7 +1970,7 @@ fn run_ext_doc(self, builder: &Builder<'_>) { compiler.host, ); let _time = util::timeit(&builder); - let toolstate = if builder.try_run(&mut rustbook_cmd) { + let toolstate = if builder.run_delaying_failure(&mut rustbook_cmd) { ToolState::TestPass } else { ToolState::TestFail @@ -2132,7 +2132,7 @@ fn markdown_test(builder: &Builder<'_>, compiler: Compiler, markdown: &Path) -> cmd.arg("--test-args").arg(test_args); if builder.config.verbose_tests { - builder.try_run(&mut cmd) + builder.run_delaying_failure(&mut cmd) } else { try_run_quiet(builder, &mut cmd) } @@ -2160,7 +2160,7 @@ fn run(self, builder: &Builder<'_>) { let src = builder.src.join(relative_path); let mut rustbook_cmd = builder.tool_cmd(Tool::Rustbook); - let toolstate = if builder.try_run(rustbook_cmd.arg("linkcheck").arg(&src)) { + let toolstate = if builder.run_delaying_failure(rustbook_cmd.arg("linkcheck").arg(&src)) { ToolState::TestPass } else { ToolState::TestFail @@ -2713,7 +2713,7 @@ fn run(self, builder: &Builder<'_>) { .current_dir(builder.src.join("src/bootstrap/")); // NOTE: we intentionally don't pass test_args here because the args for unittest and cargo test are mutually incompatible. // Use `python -m unittest` manually if you want to pass arguments. - builder.try_run(&mut check_bootstrap); + builder.run_delaying_failure(&mut check_bootstrap); let mut cmd = Command::new(&builder.initial_cargo); cmd.arg("test") @@ -2789,7 +2789,7 @@ fn run(self, builder: &Builder<'_>) { self.compiler.host, self.compiler.host, ); - builder.try_run(&mut cargo.into()); + builder.run_delaying_failure(&mut cargo.into()); } } @@ -2875,7 +2875,7 @@ fn run(self, builder: &Builder<'_>) { cmd.env("CARGO", &builder.initial_cargo); cmd.env("RUSTC", &builder.initial_rustc); cmd.env("TMP_DIR", &tmpdir); - builder.try_run(&mut cmd); + builder.run_delaying_failure(&mut cmd); } fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {