Skip to content

Commit addc570

Browse files
committed
feat(build): Added tracing spans for rustc invocations
1 parent 8ddf367 commit addc570

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/cargo/core/compiler/mod.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ use std::sync::Arc;
6767

6868
use anyhow::{Context as _, Error};
6969
use lazycell::LazyCell;
70-
use tracing::{debug, trace};
70+
use tracing::{debug, instrument, trace};
7171

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

142142
impl Executor for DefaultExecutor {
143+
#[instrument(name = "rustc", skip_all, fields(package = id.name().as_str(), process = cmd.to_string()))]
143144
fn exec(
144145
&self,
145146
cmd: &ProcessBuilder,
146-
_id: PackageId,
147+
id: PackageId,
147148
_target: &Target,
148149
_mode: CompileMode,
149150
on_stdout_line: &mut dyn FnMut(&str) -> CargoResult<()>,

0 commit comments

Comments
 (0)