Skip to content

Print step stack trace when bootstrap panics#159040

Merged
rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
Kobzol:bootstrap-step-trace
Jul 10, 2026
Merged

Print step stack trace when bootstrap panics#159040
rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
Kobzol:bootstrap-step-trace

Conversation

@Kobzol

@Kobzol Kobzol commented Jul 9, 2026

Copy link
Copy Markdown
Member

This should make it easier to debug what has happened, or rather where has bootstrap failed, when a panic occurs.

I also want to print the step trace on CI when bootstrap fails, but for that I have to first clean up some things in build_helper. Nevermind, I added it to this PR.

Fixes: #159022

CC @jyn514

r? @jieyouxu

@rustbot rustbot added A-CI Area: Our Github Actions CI 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) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Jul 9, 2026
Since the bootstrap command execution redesign, build_helper no longer has to implement these functions. By moving them to boostrap, we can enrich them with bootstrap-specific information.
@rustbot

rustbot commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

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

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

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

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

Thanks, this looks useful.

I tried this locally with an inserted panic!() in compile::Assemble w/ ./x test library --stage=2 --dry-run:

Bootstrap has panicked, currently active steps:
compile::Assemble { target_compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu, forced_compiler: false } } at src/bootstrap/src/core/build_steps/compile.rs:142
compile::Assemble { target_compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu, forced_compiler: false } } at src/bootstrap/src/core/build_steps/compile.rs:2299
compile::Assemble { target_compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false } } at src/bootstrap/src/core/build_steps/compile.rs:2299
Build completed unsuccessfully in 0:00:05

@bors r+ rollup

View changes since this review

@rust-bors

rust-bors Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 762fc14 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 Jul 10, 2026
rust-bors Bot pushed a commit that referenced this pull request Jul 10, 2026
Rollup of 7 pull requests

Successful merges:

 - #155429 (Support `u128`/`i128` c-variadic arguments)
 - #158899 (Fix `unaligned_volatile_store` by removing `MemFlags::UNALIGNED`)
 - #158640 (Handle nested inline consts in const argument checks)
 - #158866 ([perf] Add explicit `Iterator::count` impl for `ChunkBy`.)
 - #158912 (Introduce new bootstrap config section for PGO configuration)
 - #159040 (Print step stack trace when bootstrap panics)
 - #159056 (Print a loud error if the configured LLDB cannot be found)
@rust-bors rust-bors Bot merged commit 878c3ce into rust-lang:main Jul 10, 2026
13 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Jul 10, 2026
rust-timer added a commit that referenced this pull request Jul 10, 2026
Rollup merge of #159040 - Kobzol:bootstrap-step-trace, r=jieyouxu

Print step stack trace when bootstrap panics

This should make it easier to debug what has happened, or rather where has bootstrap failed, when a panic occurs.

~~I also want to print the step trace on CI when bootstrap fails, but for that I have to first clean up some things in `build_helper`.~~ Nevermind, I added it to this PR.

Fixes: #159022

CC @jyn514

r? @jieyouxu
@Kobzol Kobzol deleted the bootstrap-step-trace branch July 10, 2026 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc 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) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

improve "no entry found for key" diagnostic when bootstrap fails to cache target CC

3 participants