Skip to content

bootstrap: Optionally print a backtrace if a command fails - #153992

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
ferrocene:jyn/bootstrap-backtrace
Mar 20, 2026
Merged

bootstrap: Optionally print a backtrace if a command fails#153992
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
ferrocene:jyn/bootstrap-backtrace

Conversation

@jyn514

Copy link
Copy Markdown
Member

I found this quite useful for debugging why a command was failing eagerly (it turns out that .delay_failure() is ignored if fail_fast is enabled).

@jyn514
jyn514 marked this pull request as ready for review March 17, 2026 09:19
@rustbotrustbot added 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) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 17, 2026
@rustbot

Copy link
Copy Markdown
Collaborator

r? @jieyouxu

rustbot has assigned @jieyouxu.
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: bootstrap
  • bootstrap expanded to 6 candidates
  • Random selection from Mark-Simulacrum, clubby789, jieyouxu

@rustbotrustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Mar 17, 2026

@jieyouxujieyouxu left a comment

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.

@jieyouxu

Copy link
Copy Markdown
Member

@bors r+ rollup

@rust-bors

rust-borsBot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

📌 Commit e1186d2 has been approved by jieyouxu

It is now in the queue for this repository.

@rust-borsrust-borsBot 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 Mar 17, 2026
@Kobzol

Copy link
Copy Markdown
Member

@bors r-

(sorry, to ask some questions :) )

With this change, it would print a backtrace even when the failure behavior is Ignore, that doesn't seem like something we want?

Also, bootstrap already prints where was the corresponding command created (file + line) and where was it executed (file + line). But I suppose that it wasn't enough for you and you wanted a full backtrace?

@rust-borsrust-borsBot 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 Mar 17, 2026
@jyn514

Copy link
Copy Markdown
MemberAuthor

With this change, it would print a backtrace even when the failure behavior is Ignore, that doesn't seem like something we want?

correct, yes. I agree this doesn't make a lot of sense, I'll force off backtraces for Ignore.

Also, bootstrap already prints where was the corresponding command created (file + line) and where was it executed (file + line). But I suppose that it wasn't enough for you and you wanted a full backtrace?

Yes. Specifically I was trying to debug the command infra itself, to figure out why an unsuccessful command exited the process instead of delaying the failure until later.

@jieyouxu

Copy link
Copy Markdown
Member

Hm, I wonder if you are looking for sth more like --verbose-always-print-cmd-backtrace 🤔

@Kobzol

Copy link
Copy Markdown
Member

I think we already have multiple verbosity levels, so maybe we can enable the backtrace only for -vv? That being said, I like the idea of showing the backtrace (regardless of verbosity level) when RUST_BACKTRACE=1 is enabled.

@jyn514
jyn514force-pushed the jyn/bootstrap-backtrace branch from e1186d2 to c8a2c46CompareMarch 18, 2026 10:12
@jyn514

Copy link
Copy Markdown
MemberAuthor

pushed some changes, let me know if they look how you expect :)

@Kobzol

Copy link
Copy Markdown
Member

Looks good, thanks!

@bors r=jieyouxu,kobzol

@rust-bors

rust-borsBot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

📌 Commit c8a2c46 has been approved by jieyouxu,kobzol

It is now in the queue for this repository.

@rust-borsrust-borsBot 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 18, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 18, 2026
… r=jieyouxu,kobzol
bootstrap: Optionally print a backtrace if a command fails
I found this quite useful for debugging why a command was failing eagerly (it turns out that `.delay_failure()` is ignored if `fail_fast` is enabled).
rust-borsBot pushed a commit that referenced this pull request Mar 18, 2026
…uwer
Rollup of 5 pull requests
Successful merges:
- #153308 (Add hygiene annotations for tokens in `macro_rules!` bodies)
- #153557 (fix inference variables leaking into HIR const literal lowering logic)
- #153913 (Fix some suggestions of the `for-loops-over-fallibles` lint)
- #153987 (mGCA: Lower const generic args to infer when needed)
- #153992 (bootstrap: Optionally print a backtrace if a command fails)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 18, 2026
… r=jieyouxu,kobzol
bootstrap: Optionally print a backtrace if a command fails
I found this quite useful for debugging why a command was failing eagerly (it turns out that `.delay_failure()` is ignored if `fail_fast` is enabled).
@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors try jobs=x86_64-gnu-distcheck

@rust-bors

This comment has been minimized.

rust-borsBot pushed a commit that referenced this pull request Mar 19, 2026
bootstrap: Optionally print a backtrace if a command fails
try-job: x86_64-gnu-distcheck
@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors r-
#154062 (comment)

@rust-borsrust-borsBot 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 Mar 19, 2026
@jyn514

Copy link
Copy Markdown
MemberAuthor

I don't think this is related to my change. My guess is #153957.

@jyn514

Copy link
Copy Markdown
MemberAuthor

@jyn514

Copy link
Copy Markdown
MemberAuthor

@rustbot ready

@rustbotrustbot 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 Mar 19, 2026
@JonathanBrouwer

JonathanBrouwer commented Mar 19, 2026

Copy link
Copy Markdown
Member

Ah right, I followed the backtrace to this PR but that's just because this PR adds the backtrace feature :p
A little bit of a dumb move of me
@bors r=jieyouxu,kobzol

@rust-bors

rust-borsBot commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

📌 Commit c8a2c46 has been approved by jieyouxu,kobzol

It is now in the queue for this repository.

@rust-borsrust-borsBot 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 Mar 19, 2026
@rust-bors

rust-borsBot commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 616883a (616883ab97e2bb9335a3fa226a30e60a28fc426a, parent: 8b86f48958be8c3473c979e0b5504c2d2e0fd4fd)

JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 19, 2026
… r=jieyouxu,kobzol
bootstrap: Optionally print a backtrace if a command fails
I found this quite useful for debugging why a command was failing eagerly (it turns out that `.delay_failure()` is ignored if `fail_fast` is enabled).
rust-borsBot pushed a commit that referenced this pull request Mar 19, 2026
…uwer
Rollup of 9 pull requests
Successful merges:
- #153556 (`impl` restriction lowering)
- #153992 (bootstrap: Optionally print a backtrace if a command fails)
- #154019 (two smaller feature cleanups)
- #154059 (tests: Activate `must_not_suspend` test for `MutexGuard` dropped before `await`)
- #154075 (Rewrite `query_ensure_result`.)
- #154082 (Updates derive_where and removes workaround)
- #154084 (Preserve braces around `self` in use tree pretty printing)
- #154086 (Insert space after float literal ending with `.` in pretty printer)
- #154087 (Fix whitespace after fragment specifiers in macro pretty printing)
rust-borsBot pushed a commit that referenced this pull request Mar 19, 2026
…uwer
Rollup of 9 pull requests
Successful merges:
- #153556 (`impl` restriction lowering)
- #153992 (bootstrap: Optionally print a backtrace if a command fails)
- #154019 (two smaller feature cleanups)
- #154059 (tests: Activate `must_not_suspend` test for `MutexGuard` dropped before `await`)
- #154075 (Rewrite `query_ensure_result`.)
- #154082 (Updates derive_where and removes workaround)
- #154084 (Preserve braces around `self` in use tree pretty printing)
- #154086 (Insert space after float literal ending with `.` in pretty printer)
- #154087 (Fix whitespace after fragment specifiers in macro pretty printing)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 19, 2026
… r=jieyouxu,kobzol
bootstrap: Optionally print a backtrace if a command fails
I found this quite useful for debugging why a command was failing eagerly (it turns out that `.delay_failure()` is ignored if `fail_fast` is enabled).
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 19, 2026
… r=jieyouxu,kobzol
bootstrap: Optionally print a backtrace if a command fails
I found this quite useful for debugging why a command was failing eagerly (it turns out that `.delay_failure()` is ignored if `fail_fast` is enabled).
rust-borsBot pushed a commit that referenced this pull request Mar 20, 2026
…uwer
Rollup of 12 pull requests
Successful merges:
- #152909 (sess: `-Zbranch-protection` is a target modifier)
- #153556 (`impl` restriction lowering)
- #154048 (Don't emit rustdoc `missing_doc_code_examples` lint on impl items)
- #153992 (bootstrap: Optionally print a backtrace if a command fails)
- #154019 (two smaller feature cleanups)
- #154059 (tests: Activate `must_not_suspend` test for `MutexGuard` dropped before `await`)
- #154075 (Rewrite `query_ensure_result`.)
- #154082 (Updates derive_where and removes workaround)
- #154084 (Preserve braces around `self` in use tree pretty printing)
- #154086 (Insert space after float literal ending with `.` in pretty printer)
- #154087 (Fix whitespace after fragment specifiers in macro pretty printing)
- #154109 (tests: Add regression test for async closures involving HRTBs)
@ZalatharZalathar mentioned this pull request Mar 20, 2026
rust-borsBot pushed a commit that referenced this pull request Mar 20, 2026
Rollup of 15 pull requests
Successful merges:
- #152909 (sess: `-Zbranch-protection` is a target modifier)
- #153556 (`impl` restriction lowering)
- #154048 (Don't emit rustdoc `missing_doc_code_examples` lint on impl items)
- #150935 (Introduce #[diagnostic::on_move(message)])
- #152973 (remove -Csoft-float)
- #153862 (Rename `cycle_check` to `find_cycle`)
- #153992 (bootstrap: Optionally print a backtrace if a command fails)
- #154019 (two smaller feature cleanups)
- #154059 (tests: Activate `must_not_suspend` test for `MutexGuard` dropped before `await`)
- #154075 (Rewrite `query_ensure_result`.)
- #154082 (Updates derive_where and removes workaround)
- #154084 (Preserve braces around `self` in use tree pretty printing)
- #154086 (Insert space after float literal ending with `.` in pretty printer)
- #154087 (Fix whitespace after fragment specifiers in macro pretty printing)
- #154109 (tests: Add regression test for async closures involving HRTBs)
@rust-bors
rust-borsBot merged commit 1f5915e into rust-lang:mainMar 20, 2026
12 checks passed
@rustbotrustbot added this to the 1.96.0 milestone Mar 20, 2026
bors-ferroceneBot added a commit to ferrocene/ferrocene that referenced this pull request Mar 25, 2026
2227: a whole bunch of signature signing improvements r=Hoverbear a=jyn514
This is a grab-bag of different small fixes, which I'm happy to split up into smaller PRs. I highly encourage reviewing commit-by-commit and reading the commit descriptions.
b770889 is being upstreamed in rust-lang/rust#153992.
Co-authored-by: Jynn Nelson <jynn.nelson@ferrous-systems.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

5 participants

@jyn514@rustbot@jieyouxu@Kobzol@JonathanBrouwer