-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
bootstrap: add wrapper macros for feature = "tracing"
-gated tracing
macros
#136392
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onur-ozkan
approved these changes
Feb 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@bors r+ |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Feb 3, 2025
bootstrap: add wrapper macros for `feature = "tracing"`-gated `tracing` macros Follow-up to rust-lang#136091 (comment). - Add wrapper macros for `error!`, `warn!`, `info!`, `debug!` and `trace!`, which `cfg(feature = "tracing")`-gates the underlying `tracing` macros. They expand to nothing if `"tracing"` feature is not enabled. - This is not done for `span!` or `event!` because they can return span guards, and you can't really wrap that. - This is also not possible for `tracing::instrument` attribute proc-macro unless you use another attribute proc-macro to wrap that. It's not *great*, because `tracing::instrument` and `tracing::{span,event}` can't be wrapped this way. Can test locally with: ```bash $ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap/ ``` r? `@onur-ozkan` (or reroll)
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 3, 2025
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#134777 (Enable more tests on Windows) - rust-lang#134807 (fix(rustdoc): always use a channel when linking to doc.rust-lang.org) - rust-lang#135621 (Move some std tests to integration tests) - rust-lang#135695 (Support raw-dylib link kind on ELF) - rust-lang#135836 (bootstrap: only build `crt{begin,end}.o` when compiling to MUSL) - rust-lang#136235 (Pretty print pattern type values with transmute if they don't satisfy their pattern) - rust-lang#136392 (bootstrap: add wrapper macros for `feature = "tracing"`-gated `tracing` macros) - rust-lang#136462 (mir_build: Simplify `lower_pattern_range_endpoint`) r? `@ghost` `@rustbot` modify labels: rollup
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Feb 3, 2025
bootstrap: add wrapper macros for `feature = "tracing"`-gated `tracing` macros Follow-up to rust-lang#136091 (comment). - Add wrapper macros for `error!`, `warn!`, `info!`, `debug!` and `trace!`, which `cfg(feature = "tracing")`-gates the underlying `tracing` macros. They expand to nothing if `"tracing"` feature is not enabled. - This is not done for `span!` or `event!` because they can return span guards, and you can't really wrap that. - This is also not possible for `tracing::instrument` attribute proc-macro unless you use another attribute proc-macro to wrap that. It's not *great*, because `tracing::instrument` and `tracing::{span,event}` can't be wrapped this way. Can test locally with: ```bash $ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap/ ``` r? ``@onur-ozkan`` (or reroll)
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 3, 2025
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#134777 (Enable more tests on Windows) - rust-lang#134807 (fix(rustdoc): always use a channel when linking to doc.rust-lang.org) - rust-lang#135621 (Move some std tests to integration tests) - rust-lang#135836 (bootstrap: only build `crt{begin,end}.o` when compiling to MUSL) - rust-lang#136235 (Pretty print pattern type values with transmute if they don't satisfy their pattern) - rust-lang#136392 (bootstrap: add wrapper macros for `feature = "tracing"`-gated `tracing` macros) - rust-lang#136462 (mir_build: Simplify `lower_pattern_range_endpoint`) r? `@ghost` `@rustbot` modify labels: rollup
jieyouxu
added a commit
to jieyouxu/rust
that referenced
this pull request
Feb 3, 2025
bootstrap: add wrapper macros for `feature = "tracing"`-gated `tracing` macros Follow-up to rust-lang#136091 (comment). - Add wrapper macros for `error!`, `warn!`, `info!`, `debug!` and `trace!`, which `cfg(feature = "tracing")`-gates the underlying `tracing` macros. They expand to nothing if `"tracing"` feature is not enabled. - This is not done for `span!` or `event!` because they can return span guards, and you can't really wrap that. - This is also not possible for `tracing::instrument` attribute proc-macro unless you use another attribute proc-macro to wrap that. It's not *great*, because `tracing::instrument` and `tracing::{span,event}` can't be wrapped this way. Can test locally with: ```bash $ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap/ ``` r? ```@onur-ozkan``` (or reroll)
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 3, 2025
Rollup of 8 pull requests Successful merges: - rust-lang#134807 (fix(rustdoc): always use a channel when linking to doc.rust-lang.org) - rust-lang#134814 (Add `kl` and `widekl` target features, and the feature gate) - rust-lang#135836 (bootstrap: only build `crt{begin,end}.o` when compiling to MUSL) - rust-lang#136022 (Port ui/simd tests to use the intrinsic macro) - rust-lang#136235 (Pretty print pattern type values with transmute if they don't satisfy their pattern) - rust-lang#136309 (set rustc dylib on manually constructed rustc command) - rust-lang#136392 (bootstrap: add wrapper macros for `feature = "tracing"`-gated `tracing` macros) - rust-lang#136462 (mir_build: Simplify `lower_pattern_range_endpoint`) r? `@ghost` `@rustbot` modify labels: rollup
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Feb 3, 2025
bootstrap: add wrapper macros for `feature = "tracing"`-gated `tracing` macros Follow-up to rust-lang#136091 (comment). - Add wrapper macros for `error!`, `warn!`, `info!`, `debug!` and `trace!`, which `cfg(feature = "tracing")`-gates the underlying `tracing` macros. They expand to nothing if `"tracing"` feature is not enabled. - This is not done for `span!` or `event!` because they can return span guards, and you can't really wrap that. - This is also not possible for `tracing::instrument` attribute proc-macro unless you use another attribute proc-macro to wrap that. It's not *great*, because `tracing::instrument` and `tracing::{span,event}` can't be wrapped this way. Can test locally with: ```bash $ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap/ ``` r? ````@onur-ozkan```` (or reroll)
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 4, 2025
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#134807 (fix(rustdoc): always use a channel when linking to doc.rust-lang.org) - rust-lang#134814 (Add `kl` and `widekl` target features, and the feature gate) - rust-lang#135836 (bootstrap: only build `crt{begin,end}.o` when compiling to MUSL) - rust-lang#136022 (Port ui/simd tests to use the intrinsic macro) - rust-lang#136309 (set rustc dylib on manually constructed rustc command) - rust-lang#136392 (bootstrap: add wrapper macros for `feature = "tracing"`-gated `tracing` macros) - rust-lang#136462 (mir_build: Simplify `lower_pattern_range_endpoint`) r? `@ghost` `@rustbot` modify labels: rollup
Failed in rollup: #136506 (comment) @bors r- |
- Add wrapper macros for `error!`, `warn!`, `info!`, `debug!` and `trace!`, which `cfg(feature = "tracing")`-gates the underlying `tracing` macros. - This is not done for `span!` or `event!` because they can return span guards, and you can't really wrap that. - This is also not possible for `tracing::instrument` attribute proc-macro unless you use another attribute proc-macro to wrap that.
acb3bab
to
53b8de1
Compare
Removed the cfg-gated intra-doc link. |
jhpratt
added a commit
to jhpratt/rust
that referenced
this pull request
Feb 4, 2025
bootstrap: add wrapper macros for `feature = "tracing"`-gated `tracing` macros Follow-up to rust-lang#136091 (comment). - Add wrapper macros for `error!`, `warn!`, `info!`, `debug!` and `trace!`, which `cfg(feature = "tracing")`-gates the underlying `tracing` macros. They expand to nothing if `"tracing"` feature is not enabled. - This is not done for `span!` or `event!` because they can return span guards, and you can't really wrap that. - This is also not possible for `tracing::instrument` attribute proc-macro unless you use another attribute proc-macro to wrap that. It's not *great*, because `tracing::instrument` and `tracing::{span,event}` can't be wrapped this way. Can test locally with: ```bash $ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap/ ``` r? `@onur-ozkan` (or reroll)
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 4, 2025
Rollup of 9 pull requests Successful merges: - rust-lang#128045 (#[contracts::requires(...)] + #[contracts::ensures(...)]) - rust-lang#136263 (rustdoc: clean up a bunch of ts-expected-error declarations in main) - rust-lang#136375 (cg_llvm: Replace some DIBuilder wrappers with LLVM-C API bindings (part 1)) - rust-lang#136392 (bootstrap: add wrapper macros for `feature = "tracing"`-gated `tracing` macros) - rust-lang#136405 (rustdoc-book: Clean up section on `--output-format`) - rust-lang#136497 (Report generic mismatches when calling bodyless trait functions) - rust-lang#136502 (Mark `std::fmt::from_fn` as `#[must_use]`) - rust-lang#136509 (Add tests for nested macro_rules edition behavior) - rust-lang#136526 (mir_build: Rename `thir::cx::Cx` to `ThirBuildCx` and remove `UserAnnotatedTyHelpers`) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 5, 2025
Rollup of 8 pull requests Successful merges: - rust-lang#128045 (#[contracts::requires(...)] + #[contracts::ensures(...)]) - rust-lang#136263 (rustdoc: clean up a bunch of ts-expected-error declarations in main) - rust-lang#136375 (cg_llvm: Replace some DIBuilder wrappers with LLVM-C API bindings (part 1)) - rust-lang#136392 (bootstrap: add wrapper macros for `feature = "tracing"`-gated `tracing` macros) - rust-lang#136396 (rustdoc-json-types: Document that crate name isn't package name.) - rust-lang#136405 (rustdoc-book: Clean up section on `--output-format`) - rust-lang#136502 (Mark `std::fmt::from_fn` as `#[must_use]`) - rust-lang#136509 (Add tests for nested macro_rules edition behavior) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 5, 2025
Rollup merge of rust-lang#136392 - jieyouxu:wrap-tracing, r=onur-ozkan bootstrap: add wrapper macros for `feature = "tracing"`-gated `tracing` macros Follow-up to rust-lang#136091 (comment). - Add wrapper macros for `error!`, `warn!`, `info!`, `debug!` and `trace!`, which `cfg(feature = "tracing")`-gates the underlying `tracing` macros. They expand to nothing if `"tracing"` feature is not enabled. - This is not done for `span!` or `event!` because they can return span guards, and you can't really wrap that. - This is also not possible for `tracing::instrument` attribute proc-macro unless you use another attribute proc-macro to wrap that. It's not *great*, because `tracing::instrument` and `tracing::{span,event}` can't be wrapped this way. Can test locally with: ```bash $ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap/ ``` r? ``@onur-ozkan`` (or reroll)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-bootstrap-tracing
Area: bootstrap tracing
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-bootstrap
Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow-up to #136091 (comment).
error!
,warn!
,info!
,debug!
andtrace!
, whichcfg(feature = "tracing")
-gates the underlyingtracing
macros. They expand to nothing if"tracing"
feature is not enabled.span!
orevent!
because they can return span guards, and you can't really wrap that.tracing::instrument
attribute proc-macro unless you use another attribute proc-macro to wrap that.It's not great, because
tracing::instrument
andtracing::{span,event}
can't be wrapped this way.Can test locally with:
r? @onur-ozkan (or reroll)