Skip to content

Add --quiet flag to suppress verbose run-make output for passing tests#154587

Open
Ayuse wants to merge 4 commits intorust-lang:mainfrom
Ayuse:compiletest-quiet-run-make
Open

Add --quiet flag to suppress verbose run-make output for passing tests#154587
Ayuse wants to merge 4 commits intorust-lang:mainfrom
Ayuse:compiletest-quiet-run-make

Conversation

@Ayuse
Copy link
Copy Markdown

@Ayuse Ayuse commented Mar 30, 2026

  • Adds --quiet flag to ./x test and compiletest

    • ./x test --no-capture --quiet suppresses verbose subprocess output for passing run-make tests
    • Failed tests always print their output regardless of --quiet
    • Default behavior (verbose) is unchanged

    This addresses the request from @bjorn3 which needs --no-capture (due to panic=abort) but doesn't want output
    dumped for every passing test.

    Fixes Retain ability to not verbose-dump cmd/output for successful tests even when --nopcature for cg_clif #154069

    Test plan

    • ./x test tests/run-make/bare-outfile --no-capture --force-rerun — verbose output for passing test
    • ./x test tests/run-make/bare-outfile --no-capture --quiet --force-rerun — no verbose output for passing test
    • Failing test still dumps output with --quiet

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 30, 2026

This PR modifies src/bootstrap/src/core/config.

If appropriate, please update CONFIG_CHANGE_HISTORY in src/bootstrap/src/utils/change_tracker.rs.

The run-make-support library was changed

cc @jieyouxu

Some changes occurred in src/tools/compiletest

cc @jieyouxu

@rustbot rustbot added A-compiletest Area: The compiletest test runner A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Mar 30, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 30, 2026

r? @wesleywiser

rustbot has assigned @wesleywiser.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @jieyouxu, @oli-obk, @wesleywiser, bootstrap
  • @jieyouxu, @oli-obk, @wesleywiser, bootstrap expanded to 8 candidates
  • Random selection from Mark-Simulacrum, clubby789, jieyouxu, wesleywiser

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 30, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rustbot

This comment has been minimized.

@rustbot rustbot added has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 30, 2026
When using `--no-capture` with `panic=abort` test suites, every passing test dumps its full command output, flooding the terminal. This adds a `--quiet` flag so that `./x test --no-capture --quiet` suppresses that output for passing tests while still showing output for failures.
@rust-log-analyzer

This comment has been minimized.

@Ayuse Ayuse force-pushed the compiletest-quiet-run-make branch from ee8706b to d7cd840 Compare March 30, 2026 14:04
@rustbot rustbot removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. has-merge-commits PR has merge commits, merge with caution. labels Mar 30, 2026
@rust-log-analyzer

This comment has been minimized.

@Ayuse
Copy link
Copy Markdown
Author

Ayuse commented Mar 30, 2026

r? @jieyouxu

Copy link
Copy Markdown
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

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

Thanks, two things

View changes since this review

Comment on lines +37 to +45
cmd.inspect(|std_cmd| {
eprintln!("{std_cmd:?}");
});
eprintln!("output status: `{}`", output.status());
eprintln!("=== STDOUT ===\n{}\n\n", output.stdout_utf8());
eprintln!("=== STDERR ===\n{}\n\n", output.stderr_utf8());
if !cmd.get_context().is_empty() {
eprintln!("Context:\n{}", cmd.get_context());
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Question: wait, why is the body of verbose_print_command inlined here?

Comment on lines +426 to +428
/// suppress verbose subprocess output for successful run-make tests (useful with
/// --no-capture for panic=abort test suites like cg_clif)
quiet: bool,
Copy link
Copy Markdown
Member

@jieyouxu jieyouxu Apr 5, 2026

Choose a reason for hiding this comment

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

Suggestion: I thought about this flag name a bit more. With #154616 in mind, I want to reserve --quiet for the more general operation of "suppressing certain bootstrap build output". I don't want to use --quiet for the more niche use cases of suppressing run-make verbose subprocess output.

Can you change this flag and config name to sth more like --verbose-run-make-subprocess-output? I would expect that:

  • It is normally true (preserve previous default), but
  • For cg_clif we want to explicitly set --verbose-run-make-subprocess-output=false (in a follow-up PR).

I'm fully aware that:

  • The flag name is extremely specific, but that's my intention: when and if we need to recycle this flag somewhere else, I want us to re-evaluate the two places if it makes sense to recycle it as-is.
  • The flag name is really long. Also intentional, because this usage is quite niche (cg_clif/cg_* backend specific). General rule of thumb for flag name length is proportional to how often/common we anticipate it to be used.

@rustbot rustbot 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-review Status: Awaiting review from the assignee but also interested parties. labels Apr 5, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 5, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

Comment on lines +426 to +428
/// suppress verbose subprocess output for successful run-make tests (useful with
/// --no-capture for panic=abort test suites like cg_clif)
quiet: bool,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggestion: please also document the new ./x test flag (prob. --verbose-run-make-subprocess-output) in rustc-dev-guide (fine to do so in the subtree in this PR)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-compiletest Area: The compiletest test runner A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Retain ability to not verbose-dump cmd/output for successful tests even when --nopcature for cg_clif

5 participants