diff --git a/src/cargo/core/compiler/mod.rs b/src/cargo/core/compiler/mod.rs index 2a0fd8b40f3..37456b12aff 100644 --- a/src/cargo/core/compiler/mod.rs +++ b/src/cargo/core/compiler/mod.rs @@ -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::{ @@ -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()))] fn exec( &self, cmd: &ProcessBuilder, - _id: PackageId, + id: PackageId, _target: &Target, _mode: CompileMode, on_stdout_line: &mut dyn FnMut(&str) -> CargoResult<()>,