Skip to content

Added tracing spans for rustc invocations #15464

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

Merged
merged 1 commit into from
Apr 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/cargo/core/compiler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ use std::sync::Arc;

use anyhow::{Context as _, Error};
use lazycell::LazyCell;
use tracing::{debug, trace};
use tracing::{debug, instrument, trace};

pub use self::build_config::{BuildConfig, CompileMode, MessageFormat, TimingOutput};
pub use self::build_context::{
Expand Down Expand Up @@ -140,10 +140,11 @@ pub trait Executor: Send + Sync + 'static {
pub struct DefaultExecutor;

impl Executor for DefaultExecutor {
#[instrument(name = "rustc", skip_all, fields(package = id.name().as_str(), process = cmd.to_string()))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just note that this is at INFO log level.

Our instruments are all like this, but I feel like we might want to downgrade to debug or trace. Not a blocker though.

fn exec(
&self,
cmd: &ProcessBuilder,
_id: PackageId,
id: PackageId,
_target: &Target,
_mode: CompileMode,
on_stdout_line: &mut dyn FnMut(&str) -> CargoResult<()>,
Expand Down