Add some tracing to core bootstrap logic by jieyouxu · Pull Request #136091 · rust-lang/rust (original) (raw)

jieyouxu

Follow-up to #135391.

Summary

Add some initial tracing logging to bootstrap, focused on the core logic (in this PR).

Also:

Example output

$ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap

Example bootstrap tracing output

r? bootstrap

@rustbot

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.

clubby789

@clubby789

Looks like helpful improvements, r=me with nit

@jieyouxu

@bors

📌 Commit 97efda6 has been approved by clubby789

It is now in the queue for this repository.

@bors 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

Jan 26, 2025

jhpratt added a commit to jhpratt/rust that referenced this pull request

Jan 27, 2025

@jhpratt

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:

Example output

$ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap

Example bootstrap tracing output

r? bootstrap

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jan 27, 2025

@bors

Rollup of 5 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jan 27, 2025

@bors

onur-ozkan

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

Jan 27, 2025

@rust-timer

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:

Example output

$ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap

Example bootstrap tracing output

r? bootstrap

@fmease

@bors r- ('fixing' desync)

@bors 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

Feb 2, 2025

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Feb 3, 2025

@matthiaskrgr

bootstrap: add wrapper macros for feature = "tracing"-gated tracing macros

Follow-up to rust-lang#136091 (comment).

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

Feb 3, 2025

@matthiaskrgr

bootstrap: add wrapper macros for feature = "tracing"-gated tracing macros

Follow-up to rust-lang#136091 (comment).

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

Feb 3, 2025

@jieyouxu

bootstrap: add wrapper macros for feature = "tracing"-gated tracing macros

Follow-up to rust-lang#136091 (comment).

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

Feb 3, 2025

@matthiaskrgr

bootstrap: add wrapper macros for feature = "tracing"-gated tracing macros

Follow-up to rust-lang#136091 (comment).

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

Feb 4, 2025

@jhpratt

bootstrap: add wrapper macros for feature = "tracing"-gated tracing macros

Follow-up to rust-lang#136091 (comment).

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

Feb 5, 2025

@fmease

bootstrap: add wrapper macros for feature = "tracing"-gated tracing macros

Follow-up to rust-lang#136091 (comment).

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

Feb 5, 2025

@rust-timer

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).

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

Feb 6, 2025

@fmease

bootstrap: add wrapper macros for feature = "tracing"-gated tracing macros

Follow-up to rust-lang/rust#136091 (comment).

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

Mar 11, 2025

@bors