Add some tracing to core bootstrap logic by jieyouxu · Pull Request #136091 · rust-lang/rust (original) (raw)
Follow-up to #135391.
Summary
Add some initial tracing logging to bootstrap, focused on the core logic (in this PR).
Also:
- Adjusted tracing-tree style to not use indent lines (I found that more distracting than helpful).
- Avoid glob-importing
tracing
items. - Improve the rustc-dev-guide docs on bootstrap tracing.
Example output
$ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap
r? bootstrap
The rustc-dev-guide subtree was changed. If this PR only touches the dev guide consider submitting a PR directly to rust-lang/rustc-dev-guide otherwise thank you for updating the dev guide with your changes.
cc @BoxyUwU, @jieyouxu, @Kobzol
This PR modifies src/bootstrap/src/core/config
.
If appropriate, please update CONFIG_CHANGE_HISTORY
in src/bootstrap/src/utils/change_tracker.rs
.
Looks like helpful improvements, r=me with nit
📌 Commit 97efda6 has been approved by clubby789
It is now in the queue for this repository.
bors added S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
jhpratt added a commit to jhpratt/rust that referenced this pull request
Add some tracing to core bootstrap logic
Follow-up to rust-lang#135391.
Summary
Add some initial tracing logging to bootstrap, focused on the core logic (in this PR).
Also:
- Adjusted tracing-tree style to not use indent lines (I found that more distracting than helpful).
- Avoid glob-importing
tracing
items. - Improve the rustc-dev-guide docs on bootstrap tracing.
Example output
$ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap
r? bootstrap
bors added a commit to rust-lang-ci/rust that referenced this pull request
Rollup of 5 pull requests
Successful merges:
- rust-lang#135807 (Implement phantom variance markers)
- rust-lang#136091 (Add some tracing to core bootstrap logic)
- rust-lang#136094 (Upgrade elsa to the newest version.)
- rust-lang#136097 (rustc_ast: replace some len-checks + indexing with slice patterns etc.)
- rust-lang#136101 (triagebot: set myself on vacation)
r? @ghost
@rustbot
modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request
Comment on lines +32 to +33
#[cfg(feature = "tracing")] |
---|
debug!("parsing flags"); |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would simplify this by creating a logging wrapper macro (tracing_debug
?) gated from tracing
feature, which doesn't do anything on #[cfg(not(feature = "tracing")])
and uses debug
macro on #[cfg(feature = "tracing")]
, so you don't need to add this conditional checks everywhere.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I forgor you could just forward via $($tokens:tt)*
. I'll send a follow-up.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Rollup merge of rust-lang#136091 - jieyouxu:core-tracing, r=clubby789
Add some tracing to core bootstrap logic
Follow-up to rust-lang#135391.
Summary
Add some initial tracing logging to bootstrap, focused on the core logic (in this PR).
Also:
- Adjusted tracing-tree style to not use indent lines (I found that more distracting than helpful).
- Avoid glob-importing
tracing
items. - Improve the rustc-dev-guide docs on bootstrap tracing.
Example output
$ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap
r? bootstrap
@bors r- ('fixing' desync)
bors added S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
and removed S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
labels
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request
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!
andtrace!
, whichcfg(feature = "tracing")
-gates the underlyingtracing
macros. They expand to nothing if"tracing"
feature is not enabled. - This is not done for
span!
orevent!
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:
$ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap/
r? @onur-ozkan
(or reroll)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request
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!
andtrace!
, whichcfg(feature = "tracing")
-gates the underlyingtracing
macros. They expand to nothing if"tracing"
feature is not enabled. - This is not done for
span!
orevent!
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:
$ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap/
r? @onur-ozkan
(or reroll)
jieyouxu added a commit to jieyouxu/rust that referenced this pull request
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!
andtrace!
, whichcfg(feature = "tracing")
-gates the underlyingtracing
macros. They expand to nothing if"tracing"
feature is not enabled. - This is not done for
span!
orevent!
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:
$ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap/
r? @onur-ozkan
(or reroll)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request
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!
andtrace!
, whichcfg(feature = "tracing")
-gates the underlyingtracing
macros. They expand to nothing if"tracing"
feature is not enabled. - This is not done for
span!
orevent!
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:
$ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap/
r? @onur-ozkan
(or reroll)
jhpratt added a commit to jhpratt/rust that referenced this pull request
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!
andtrace!
, whichcfg(feature = "tracing")
-gates the underlyingtracing
macros. They expand to nothing if"tracing"
feature is not enabled. - This is not done for
span!
orevent!
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:
$ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap/
r? @onur-ozkan
(or reroll)
fmease added a commit to fmease/rust that referenced this pull request
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!
andtrace!
, whichcfg(feature = "tracing")
-gates the underlyingtracing
macros. They expand to nothing if"tracing"
feature is not enabled. - This is not done for
span!
orevent!
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:
$ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap/
r? @onur-ozkan
(or reroll)
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
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!
andtrace!
, whichcfg(feature = "tracing")
-gates the underlyingtracing
macros. They expand to nothing if"tracing"
feature is not enabled. - This is not done for
span!
orevent!
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:
$ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap/
r? @onur-ozkan
(or reroll)
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request
bootstrap: add wrapper macros for feature = "tracing"
-gated tracing
macros
Follow-up to rust-lang/rust#136091 (comment).
- Add wrapper macros for
error!
,warn!
,info!
,debug!
andtrace!
, whichcfg(feature = "tracing")
-gates the underlyingtracing
macros. They expand to nothing if"tracing"
feature is not enabled. - This is not done for
span!
orevent!
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:
$ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap/
r? @onur-ozkan
(or reroll)
github-actions bot pushed a commit to tautschnig/verify-rust-std that referenced this pull request