-
Notifications
You must be signed in to change notification settings - Fork 13k
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
[EXPERIMENTAL] bootstrap: add structured tracing to ./x test tests/ui
and ./x build compiler/rustc_codegen_gcc
flows
#135299
Conversation
This comment has been minimized.
This comment has been minimized.
Maybe it would be possible to add it behind a cargo feature? |
add32df
to
dfc65bc
Compare
Possibly. All the
but tbh I would personally want that for debugging even if that is the case. EDIT: implemented in #135391 |
cf. https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Conditional.20.60tracing.60.20dep.3F, I also measured not gating behind conditionally and just measure the build time impact of taking on direct Build time measurementsProcedurePreparation: rebase against latest master, commit 12445e0, The exploratory PR adds 3 (root) deps to bootstrap: tracing = { version = "0.1.41", features = ["attributes"] }
tracing-subscriber = { version = "0.3.19", features = ["env-filter", "fmt", "registry", "std"] }
tracing-tree = "0.4.0" Measured locally via $ hyperfine --runs 5 --ignore-failure --prepare="./x clean" "./x build bootstrap" --show-output
Before
|
☔ The latest upstream changes (presumably #135281) made this pull request unmergeable. Please resolve the merge conflicts. |
…i` and `./x build compiler/rustc_codegen_gcc` flows Example usages: ```bash $ BOOTSTRAP_LOG=bootstrap=TRACE,STEPS_TO_RUN=TRACE ./x build ./compiler/rustc_codegen_gcc/ --stage 1 $ BOOTSTRAP_LOG=bootstrap=TRACE ./x build ./compiler/rustc_codegen_gcc/ --stage 1 $ BOOTSTRAP_LOG=bootstrap=TRACE ./x test tests/ui --stage 1 $ BOOTSTRAP_LOG=bootstrap=TRACE ./x test tests/ui src/tools/run-make-support --stage 1 ```
dfc65bc
to
9ba7037
Compare
…ur-ozkan bootstrap: Implement conditional `tracing` infra Add a conditional `tracing` setup that is gated behind `BOOTSTRAP_TRACING` env var. This `tracing` infra is implemented by: - Introducing an optional `tracing` cargo feature in bootstrap. - Added optional `tracing*` dependencies which are gated behind the `tracing` cargo feature. - When `BOOTSTRAP_TRACING` is set, `bootstrap.py` will build bootstrap with `--features=tracing`. There is a small trick here to share `BOOTSTRAP_TRACING` env var without having to add a separate env var: - `BOOTSTRAP_TRACING=1` is not a registered `tracing` filter target, so that can be used to enable the `tracing` cargo feature yet not actually enable any tracing logs (useful for editor r-a setups without actually outputting any tracing logs). - `BOOTSTRAP_TRACING=TRACE` and such are actually valid `tracing` filters, but that sets `BOOTSTRAP_TRACING` anyway. Example usage: rust-lang#135299 (that experimental PR is not conditionally gated) This PR is intentionally kept minimal to focus on the infra itself. To get actual mileage, instrumentations will need to be added to individual `Step`s and such. r? `@onur-ozkan` (or reroll)
Rollup merge of rust-lang#135391 - jieyouxu:conditional-tracing, r=onur-ozkan bootstrap: Implement conditional `tracing` infra Add a conditional `tracing` setup that is gated behind `BOOTSTRAP_TRACING` env var. This `tracing` infra is implemented by: - Introducing an optional `tracing` cargo feature in bootstrap. - Added optional `tracing*` dependencies which are gated behind the `tracing` cargo feature. - When `BOOTSTRAP_TRACING` is set, `bootstrap.py` will build bootstrap with `--features=tracing`. There is a small trick here to share `BOOTSTRAP_TRACING` env var without having to add a separate env var: - `BOOTSTRAP_TRACING=1` is not a registered `tracing` filter target, so that can be used to enable the `tracing` cargo feature yet not actually enable any tracing logs (useful for editor r-a setups without actually outputting any tracing logs). - `BOOTSTRAP_TRACING=TRACE` and such are actually valid `tracing` filters, but that sets `BOOTSTRAP_TRACING` anyway. Example usage: rust-lang#135299 (that experimental PR is not conditionally gated) This PR is intentionally kept minimal to focus on the infra itself. To get actual mileage, instrumentations will need to be added to individual `Step`s and such. r? `@onur-ozkan` (or reroll)
☔ The latest upstream changes (presumably #135430) made this pull request unmergeable. Please resolve the merge conflicts. |
bootstrap: Implement conditional `tracing` infra Add a conditional `tracing` setup that is gated behind `BOOTSTRAP_TRACING` env var. This `tracing` infra is implemented by: - Introducing an optional `tracing` cargo feature in bootstrap. - Added optional `tracing*` dependencies which are gated behind the `tracing` cargo feature. - When `BOOTSTRAP_TRACING` is set, `bootstrap.py` will build bootstrap with `--features=tracing`. There is a small trick here to share `BOOTSTRAP_TRACING` env var without having to add a separate env var: - `BOOTSTRAP_TRACING=1` is not a registered `tracing` filter target, so that can be used to enable the `tracing` cargo feature yet not actually enable any tracing logs (useful for editor r-a setups without actually outputting any tracing logs). - `BOOTSTRAP_TRACING=TRACE` and such are actually valid `tracing` filters, but that sets `BOOTSTRAP_TRACING` anyway. Example usage: rust-lang/rust#135299 (that experimental PR is not conditionally gated) This PR is intentionally kept minimal to focus on the infra itself. To get actual mileage, instrumentations will need to be added to individual `Step`s and such. r? `@onur-ozkan` (or reroll)
Intended for bootstrap reading club's core infra session, to make it easier to play around with bootstrap to visualize the execution flow.
Not intended for merge because
tracing
+tracing_subscriber
+tracing_tree
are quite heavy dependencies for build times.Example usage
Screenshots
./x test tests --stage 1
:./x build compiler/rustc_codegen_gcc --stage 1
:r? @ghost