Skip to content

Implement debugging output of the bootstrap Step graph into a DOT file #144779

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Kobzol
Copy link
Member

@Kobzol Kobzol commented Aug 1, 2025

There are already a bunch of ways how we can debug bootstrap, so why not add one more =D (ideally I'd like to consolidate these approaches somewhat, @Shourya742 is looking into that, but I think that this specific debugging tool is orthogonal to the rest of them, and is quite useful).

This PR adds the option to render the bootstrap step graph into the DOT format, in order to understand what steps were executed, along with their fields (Debug output).

Here you can see an example of the generated DOT files for the BOOTSTRAP_TRACING=1 ./x build compiler --stage 2 --dry-run command on x64 Linux. One is with cached deps (what this PR does), the other one without.

bootstrap-dot.zip

Visual example:
image

r? @jieyouxu

@rustbot
Copy link
Collaborator

rustbot commented Aug 1, 2025

jieyouxu is currently at their maximum review capacity.
They may take a while to respond.

@rustbot rustbot added A-rustc-dev-guide Area: rustc-dev-guide 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 Aug 1, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 1, 2025

The rustc-dev-guide subtree was changed. If this PR only touches the dev guide consider submitting a PR directly to rust-lang/rustc-dev-guide otherwise thank you for updating the dev guide with your changes.

cc @BoxyUwU, @jieyouxu, @Kobzol, @tshepang

@jieyouxu
Copy link
Member

jieyouxu commented Aug 1, 2025

Oo yes, this is very nice :D I ran out of bandwidth today, so I'll take a closer look tmrw.

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.

Thanks

@jieyouxu
Copy link
Member

jieyouxu commented Aug 2, 2025

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Aug 2, 2025

📌 Commit ac9a689 has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors 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 Aug 2, 2025
Zalathar added a commit to Zalathar/rust that referenced this pull request Aug 3, 2025
Implement debugging output of the bootstrap Step graph into a DOT file

There are already a bunch of ways how we can debug bootstrap, so why not add one more =D (ideally I'd like to consolidate these approaches somewhat, `@Shourya742` is looking into that, but I think that this specific debugging tool is orthogonal to the rest of them, and is quite useful).

This PR adds the option to render the bootstrap step graph into the DOT format, in order to understand what steps were executed, along with their fields (`Debug` output).

Here you can see an example of the generated DOT files for the `BOOTSTRAP_TRACING=1 ./x build compiler --stage 2 --dry-run` command on x64 Linux. One is with cached deps (what this PR does), the other one without.

[bootstrap-dot.zip](https://github.com/user-attachments/files/21548679/bootstrap-dot.zip)

Visual example:
<img width="1899" height="445" alt="image" src="https://github.com/user-attachments/assets/ae40e6d2-0ea8-48bb-b77e-6b21700b95ee" />

r? `@jieyouxu`
bors added a commit that referenced this pull request Aug 3, 2025
Rollup of 14 pull requests

Successful merges:

 - #143857 (Port #[macro_export] to the new attribute parsing infrastructure)
 - #143900 ([rustdoc] Correctly handle `should_panic` doctest attribute and fix `--no-run` test flag on the 2024 edition)
 - #144070 (Implement `hash_map` macro )
 - #144322 (Add lint against dangling pointers from local variables)
 - #144443 (Make target pointer width in target json an integer)
 - #144667 (`AlignmentEnum` should just be `repr(usize)` now)
 - #144779 (Implement debugging output of the bootstrap Step graph into a DOT file)
 - #144790 (Multiple bounds checking elision failures)
 - #144794 (Port `#[coroutine]` to the new attribute system)
 - #144808 (`Interner` arg to `EarlyBinder` does not affect auto traits)
 - #144816 (Update E0562 to account for the new impl trait positions)
 - #144822 (Return a struct with named fields from `hash_owner_nodes`)
 - #144824 (Updated test links in compiler)
 - #144829 (Use full flag name in strip command for Darwin)

r? `@ghost`
`@rustbot` modify labels: rollup
@Zalathar
Copy link
Contributor

Zalathar commented Aug 3, 2025

Failed in rollup: #144844 (comment)

@bors r-

@bors bors 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 Aug 3, 2025
@Zalathar
Copy link
Contributor

Zalathar commented Aug 3, 2025

@bors try jobs=aarch64-gnu-llvm-19-2

@rust-bors
Copy link

rust-bors bot commented Aug 3, 2025

⌛ Trying commit ac9a689 with merge a3dee25

To cancel the try build, run the command @bors try cancel.

rust-bors bot added a commit that referenced this pull request Aug 3, 2025
Implement debugging output of the bootstrap Step graph into a DOT file

try-job: aarch64-gnu-llvm-19-2
@rust-bors
Copy link

rust-bors bot commented Aug 3, 2025

💔 Test failed (CI). Failed jobs:

@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-19-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@Kobzol
Copy link
Member Author

Kobzol commented Aug 3, 2025

Heh, a logical git conflict with another PR, doesn't happen that often.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustc-dev-guide Area: rustc-dev-guide 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.

6 participants