You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of #126318 - Kobzol:bootstrap-perf, r=onur-ozkan
Add a `x perf` command for integrating bootstrap with `rustc-perf`
This PR adds a new `x perf` command to bootstrap. The idea is to let rustc developers profile (`profile_local`) and benchmark (`bench_local`) a stage1/stage2 compiler directly from within `rust`.
Before, if you wanted to use `rustc-perf`, you had to clone it, set it up, copy the `rustc` sysroot after every change to `rust` etc. This is an attempt to automate that.
I opened this PR mostly for discussion. My idea is to offer an interface that looks something like this (a random sample of commands):
```bash
x perf --stage 2 profile eprintln
x perf --stage1 profile cachegrind
x perf benchmark --id baseline
x perf benchmark --id after-edit
x perf cmp baseline after-edit
```
In this PR, I'd like to only implement the simplest case (`profile_local (eprintln)`), because that only requires a single sysroot (you don't compare anything), and it's relatively easy to set up. Also, I'd like to avoid forcing developers to deal with the rustc-perf UI, so more complex use-cases (like benchmarking two sysroots and comparing the results) should probably wait for rust-lang/rustc-perf#1734 (which is hopefully coming along soon-ish).
I'm not sure if it's better to do this in bootstrap directly, or if I should create some shim tool that will receive a `rustc` sysroot, and offer a simplified CLI on top of `rustc-perf`.
## Why is a separate CLI needed?
We definitely need to add some support to bootstrap to automate preparing `rustc-perf` and the `rustc` sysroot, but in theory after that we could just let people invoke `rustc-perf` manually. While that is definitely possible, you'd need to manually figure out where is your sysroot located, which seems annoying to me. The `rustc-perf` CLI is also relatively complex, and for this use-case it makes sense to only use a subset of it. So I thought that it would be better to offer a simplified interface on top of it that would make life easier for contributors. But maybe it's not worth it.
CC `@onur-ozkan`
complete-c x.py -n"__fish_seen_subcommand_from perf"-l on-fail -d'command to run on failure'-r-f-a"(__fish_complete_command)"
641
+
complete-c x.py -n"__fish_seen_subcommand_from perf"-l stage -d'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)'-r-f
642
+
complete-c x.py -n"__fish_seen_subcommand_from perf"-l keep-stage -d'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)'-r-f
643
+
complete-c x.py -n"__fish_seen_subcommand_from perf"-l keep-stage-std -d'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)'-r-f
644
+
complete-c x.py -n"__fish_seen_subcommand_from perf"-l src -d'path to the root of the rust checkout'-r-f-a"(__fish_complete_directories)"
645
+
complete-c x.py -n"__fish_seen_subcommand_from perf"-s j -ljobs-d'number of jobs to run in parallel'-r-f
646
+
complete-c x.py -n"__fish_seen_subcommand_from perf"-l warnings -d'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour'-r-f-a"{deny '',warn '',default ''}"
complete-c x.py -n"__fish_seen_subcommand_from perf"-l reproducible-artifact -d'Additional reproducible artifacts that should be added to the reproducible artifacts archive'-r
654
+
complete-c x.py -n"__fish_seen_subcommand_from perf"-lset-d'override options in config.toml'-r-f
655
+
complete-c x.py -n"__fish_seen_subcommand_from perf"-s v -l verbose -d'use verbose output (-vv for very verbose)'
656
+
complete-c x.py -n"__fish_seen_subcommand_from perf"-s i -l incremental -d'use incremental compilation'
657
+
complete-c x.py -n"__fish_seen_subcommand_from perf"-l include-default-paths -d'include default paths in addition to the provided ones'
complete-c x.py -n"__fish_seen_subcommand_from perf"-l bypass-bootstrap-lock -d'Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel)'
662
+
complete-c x.py -n"__fish_seen_subcommand_from perf"-l llvm-profile-generate -d'generate PGO profile with llvm built for rustc'
663
+
complete-c x.py -n"__fish_seen_subcommand_from perf"-l enable-bolt-settings -d'Enable BOLT link flags'
0 commit comments