about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/query/mod.rs
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2025-01-13 01:05:11 -0500
committerGitHub <noreply@github.com>2025-01-13 01:05:11 -0500
commitcc00936dda2fa8aa15558689ef697be46a9b1d2d (patch)
tree8a23bdebb6110e3d76fa7ad8edce84d08cfa81f4 /compiler/rustc_middle/src/query/mod.rs
parentabdd40d84de68cf4091ada0b172836a46f77b292 (diff)
parent3ae724e6a0bb0dd98ff280494f8004b52e9f46c3 (diff)
downloadrust-cc00936dda2fa8aa15558689ef697be46a9b1d2d.tar.gz
rust-cc00936dda2fa8aa15558689ef697be46a9b1d2d.zip
Rollup merge of #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: https://github.com/rust-lang/rust/pull/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)
Diffstat (limited to 'compiler/rustc_middle/src/query/mod.rs')
0 files changed, 0 insertions, 0 deletions