Skip to content

Commit 6d94e24

Browse files
Rollup merge of #144779 - Kobzol:bootstrap-dot, r=jieyouxu
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```
2 parents 18b4188 + f88f956 commit 6d94e24

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/building/bootstrapping/debugging-bootstrap.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ if [#96176][cleanup-compiler-for] is resolved.
123123

124124
[cleanup-compiler-for]: https://github.com/rust-lang/rust/issues/96176
125125

126+
### Rendering step graph
127+
128+
When you run bootstrap with the `BOOTSTRAP_TRACING` environment variable configured, bootstrap will automatically output a DOT file that shows all executed steps and their dependencies. The files will have a prefix `bootstrap-steps`. You can use e.g. `xdot` to visualize the file or e.g. `dot -Tsvg` to convert the DOT file to a SVG file.
129+
130+
A separate DOT file will be outputted for dry-run and non-dry-run execution.
131+
126132
### Using `tracing` in bootstrap
127133

128134
Both `tracing::*` macros and the `tracing::instrument` proc-macro attribute need to be gated behind `tracing` feature. Examples:

0 commit comments

Comments
 (0)