Skip to content

Add --quiet flag to x.py and bootstrap to suppress output#154616

Open
erickt wants to merge 1 commit intorust-lang:mainfrom
erickt:quiet
Open

Add --quiet flag to x.py and bootstrap to suppress output#154616
erickt wants to merge 1 commit intorust-lang:mainfrom
erickt:quiet

Conversation

@erickt
Copy link
Copy Markdown
Contributor

@erickt erickt commented Mar 31, 2026

View all comments

This adds a --quiet flag to x.py and bootstrap to suppress some of the output when compiling Rust. It conflicts with --verbose, matching the behavior of cargo which does not allow --verbose and --quiet.

It works by passing quiet flags down to the underlying cargo, or LLVM build processes. Note that for LLVM, we only can suppress logs when we explicitly configure it with ninja. Otherwise we won't know what flag to pass along to whichever build system cmake decides to use.

This can be helpful with AI workloads in the Rust codebase to help shrink down the output to reduce token usage, which can help prevent context pollution and lower costs.

This patch was partially generated with Gemini, but I've reviewed the changes it made.

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 31, 2026

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

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

This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp.

@rustbot rustbot added 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 31, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 31, 2026

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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: @Mark-Simulacrum

@jieyouxu
Copy link
Copy Markdown
Member

I can only look into these this weekend, but cc also #154587

(It would be nice to be careful that we don't use --quiet to mean different things)

@erickt
Copy link
Copy Markdown
Contributor Author

erickt commented Mar 31, 2026

Ha! What a coincidence. I’m certainly intending to have the same semantics as that PR, so I think they should be compatible with each other. I’m happy to wait for it to land since it beat me by a few hours, then I can match the style with whatever you finalize on.

@jieyouxu
Copy link
Copy Markdown
Member

(I think either one can land first, I was just remarking just in case we somehow have --quiet do two entirely different things which would be very confusing, but doesn't seem like the case)

@Mark-Simulacrum Mark-Simulacrum removed their assignment Apr 4, 2026
@rust-bors

This comment has been minimized.

@jieyouxu
Copy link
Copy Markdown
Member

jieyouxu commented Apr 5, 2026

Thanks for the patience. So I looked at both this PR and the #154587, and I think I would say:

  • We keep using --quiet in this PR for the more general-purpose operation of suppressing certain build outputs, which seems more common.
  • We'll use something more specific like --verbose-run-make-subprocess-output for the other use case next doors, because that use case is very niche.

I'll review this PR now.

@jieyouxu jieyouxu self-requested a review April 5, 2026 08:25
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. Have a question and a suggestion.

View changes since this review

Comment thread src/bootstrap/bootstrap.py Outdated
Comment thread src/bootstrap/bootstrap.py
Comment thread src/bootstrap/bootstrap.py Outdated
Comment thread src/bootstrap/src/core/build_steps/llvm.rs
@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.

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 15, 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.

This adds a `--quiet` flag to x.py and bootstrap to suppress some of the
output when compiling Rust. It conflicts with `--verbose`, matching the
behavior of `cargo` which does not allow `--verbose` and `--quiet`.

It works by passing quiet flags down to the underlying cargo, or LLVM
build processes. Note that for LLVM, we only can suppress logs when we
explicitly configure it with ninja. Otherwise we won't know what flag
to pass along to whichever build system cmake decides to use.

This can be helpful with AI workloads in the Rust codebase to help
shrink down the output to reduce token usage, which can help prevent
context pollution and lower costs.

This patch was partially generated with Gemini, but I've reviewed the
changes it made.
@erickt
Copy link
Copy Markdown
Contributor Author

erickt commented Apr 15, 2026

@jieyouxu - Thanks for the review! I force pushed a rebased version, and tried to address your comments.

I can't find one though where you asked for the reasoning behind it. I updated the PR doc (and with this version I did use gemini to simplify things, and noted that in the comment). My interest in this was from doing some AI driven bug hunting with Gemini for #150907, and I thought that if we could suppress output from the Rust build we could cut down on wasted tokens to avoid context pollution and avoid spending extra on unnecessary tokens.

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 15, 2026
@erickt erickt requested a review from jieyouxu April 15, 2026 17:07
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, given that I anticipate this is more for local usage, even if it hides a few too many / too little warnings and whatever it's not a huge problem, because you can always attempt a rebuild without --quiet.

@bors r+ rollup

View changes since this review

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 16, 2026

📌 Commit f52f125 has been approved by jieyouxu

It is now in the queue for this repository.

@rust-bors rust-bors bot 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 Apr 16, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Apr 16, 2026
Add `--quiet` flag to x.py and bootstrap to suppress output

This adds a `--quiet` flag to x.py and bootstrap to suppress some of the output when compiling Rust. It conflicts with `--verbose`, matching the behavior of `cargo` which does not allow `--verbose` and `--quiet`.

It works by passing quiet flags down to the underlying cargo, or LLVM build processes. Note that for LLVM, we only can suppress logs when we explicitly configure it with ninja. Otherwise we won't know what flag to pass along to whichever build system cmake decides to use.

This can be helpful with AI workloads in the Rust codebase to help shrink down the output to reduce token usage, which can help prevent context pollution and lower costs.

This patch was partially generated with Gemini, but I've reviewed the changes it made.
rust-bors bot pushed a commit that referenced this pull request Apr 16, 2026
Rollup of 18 pull requests

Successful merges:

 - #154595 (Emit fatal on invalid const args with nested defs)
 - #154599 (report the `varargs_without_pattern` lint in deps)
 - #154699 (`core::unicode`: Replace `Cased` table with `Lt`)
 - #155353 (resolve: Remove `inaccessible_ctor_reexport` resolver field)
 - #155357 (Add `--remap-path-scope` as unstable in rustdoc)
 - #150649 (clippy fix: non_canonical_clone_impl)
 - #154604 (abort in core)
 - #154616 (Add `--quiet` flag to x.py and bootstrap to suppress output)
 - #154970 (rustdoc: preserve `doc(cfg)` on locally re-exported type aliases)
 - #155215 (Clean up `AttributeLintKind` and refactor diagnostic attribute linting)
 - #155228 (Check diagnostic output in incremental `cpass` and `rpass` revisions)
 - #155266 (Adjust release notes for post-merge feedback)
 - #155326 (Disallow ZST allocations with `TypedArena`.)
 - #155334 (docs: Use `0b1` instead of `NonZero::MIN` in `NonZero::bit_width` doctests)
 - #155340 (Handle nonnull pattern types in size skeleton)
 - #155347 (Add push_mut and new Layout methods to release notes)
 - #155356 (remove calls to AliasTyKind::def_id)
 - #155364 (Reduce diagnostic type visibilities.)
jhpratt added a commit to jhpratt/rust that referenced this pull request Apr 16, 2026
Add `--quiet` flag to x.py and bootstrap to suppress output

This adds a `--quiet` flag to x.py and bootstrap to suppress some of the output when compiling Rust. It conflicts with `--verbose`, matching the behavior of `cargo` which does not allow `--verbose` and `--quiet`.

It works by passing quiet flags down to the underlying cargo, or LLVM build processes. Note that for LLVM, we only can suppress logs when we explicitly configure it with ninja. Otherwise we won't know what flag to pass along to whichever build system cmake decides to use.

This can be helpful with AI workloads in the Rust codebase to help shrink down the output to reduce token usage, which can help prevent context pollution and lower costs.

This patch was partially generated with Gemini, but I've reviewed the changes it made.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

4 participants