Skip to content

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

Open
jyn514 wants to merge 1 commit intorust-lang:mainfrom
ferrocene:jyn/bootstrap-backtrace
Open

bootstrap: Optionally print a backtrace if a command fails#153992
jyn514 wants to merge 1 commit intorust-lang:mainfrom
ferrocene:jyn/bootstrap-backtrace

Conversation

@jyn514
Copy link
Member

@jyn514 jyn514 commented Mar 17, 2026

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
@rustbot rustbot 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
Collaborator

rustbot commented Mar 17, 2026

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

@rustbot rustbot 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
Copy link
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.

Makes sense, thanks

View changes since this review

@jieyouxu
Copy link
Member

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 17, 2026

📌 Commit e1186d2 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 Mar 17, 2026
@Kobzol
Copy link
Member

Kobzol commented Mar 17, 2026

@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-bors rust-bors bot 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
Member Author

jyn514 commented Mar 17, 2026

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
Member

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

@Kobzol
Copy link
Member

Kobzol commented Mar 17, 2026

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.

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. 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