Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build_helper: try less confusing method names #63196

Merged
merged 3 commits into from
Aug 3, 2019

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Aug 1, 2019

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. 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 #63089 (comment).

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 1, 2019
@@ -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));
Copy link
Member Author

@RalfJung RalfJung Aug 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is based on this thread: I think we actually want to see the output here.

The only other user of try_run_quiet uses logic of the kind

    if builder.config.verbose_tests {
        try_run(builder, &mut cmd)
    } else {
        try_run_quiet(builder, &mut cmd)
    }

Most tools just use try_run.

@alexcrichton
Copy link
Member

@bors: r+

Sounds reasonable to me!

@bors
Copy link
Contributor

bors commented Aug 2, 2019

📌 Commit 30f61de has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 2, 2019
Centril added a commit to Centril/rust that referenced this pull request Aug 2, 2019
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).
bors added a commit that referenced this pull request Aug 2, 2019
Rollup of 7 pull requests

Successful merges:

 - #63107 (Added support for armv7-unknown-linux-gnueabi/musleabi)
 - #63121 (On `format!()` arg count mismatch provide extra info)
 - #63196 (build_helper: try less confusing method names)
 - #63206 (remove unsupported test case)
 - #63208 (Round generator sizes to a multiple of their alignment)
 - #63212 (Pretty print attributes in `print_arg`)
 - #63215 (Clarify semantics of mem::zeroed)

Failed merges:

r? @ghost
@bors bors merged commit 30f61de into rust-lang:master Aug 3, 2019
@bors
Copy link
Contributor

bors commented Aug 3, 2019

☔ The latest upstream changes (presumably #63228) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 3, 2019
@RalfJung RalfJung deleted the build_helper branch August 5, 2019 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants