Skip to content

Commit 26e3d69

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

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/cargo/core/compiler/mod.rs

+9
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,13 @@ fn rustc(
402402
let outfile = BufWriter::new(paths::create(&file)?);
403403
serde_json::to_writer(outfile, &sbom)?;
404404
}
405+
let span = tracing::span!(
406+
tracing::Level::TRACE,
407+
"rustc",
408+
package = name.as_str(),
409+
process = rustc.to_string()
410+
)
411+
.entered();
405412

406413
let result = exec
407414
.exec(
@@ -448,6 +455,8 @@ fn rustc(
448455
format!("could not compile {name}{errors}{warnings}")
449456
});
450457

458+
drop(span);
459+
451460
if let Err(e) = result {
452461
if let Some(diagnostic) = failed_scrape_diagnostic {
453462
state.warning(diagnostic);

0 commit comments

Comments
 (0)