diff options
| author | bit-aloo <sshourya17@gmail.com> | 2025-07-12 14:52:34 +0530 |
|---|---|---|
| committer | bit-aloo <sshourya17@gmail.com> | 2025-07-12 14:52:34 +0530 |
| commit | acbbc18599e5b14abb9ec1226b611fcfe4f85bb3 (patch) | |
| tree | 474b763a7a8a047d6e70a4315816a6c8588a7743 /src/bootstrap | |
| parent | 855e0fe46e68d94e9f6147531b75ac2d488c548e (diff) | |
| download | rust-acbbc18599e5b14abb9ec1226b611fcfe4f85bb3.tar.gz rust-acbbc18599e5b14abb9ec1226b611fcfe4f85bb3.zip | |
fix span for deferred command execution
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/src/utils/exec.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/bootstrap/src/utils/exec.rs b/src/bootstrap/src/utils/exec.rs index c5bafda88c4..453a4b056b2 100644 --- a/src/bootstrap/src/utils/exec.rs +++ b/src/bootstrap/src/utils/exec.rs @@ -593,6 +593,8 @@ enum CommandState<'a> { executed_at: &'a Location<'a>, fingerprint: CommandFingerprint, start_time: Instant, + #[cfg(feature = "tracing")] + _span_guard: tracing::span::EnteredSpan, }, } @@ -693,6 +695,9 @@ impl ExecutionContext { ) -> DeferredCommand<'a> { let fingerprint = command.fingerprint(); + #[cfg(feature = "tracing")] + let span_guard = trace_cmd!(command); + if let Some(cached_output) = self.command_cache.get(&fingerprint) { command.mark_as_executed(); self.verbose(|| println!("Cache hit: {command:?}")); @@ -713,13 +718,12 @@ impl ExecutionContext { executed_at, fingerprint, start_time: Instant::now(), + #[cfg(feature = "tracing")] + _span_guard: span_guard, }, }; } - #[cfg(feature = "tracing")] - let _run_span = trace_cmd!(command); - self.verbose(|| { println!("running: {command:?} (created at {created_at}, executed at {executed_at})") }); @@ -741,6 +745,8 @@ impl ExecutionContext { executed_at, fingerprint, start_time, + #[cfg(feature = "tracing")] + _span_guard: span_guard, }, } } @@ -841,6 +847,7 @@ impl<'a> DeferredCommand<'a> { executed_at, fingerprint, start_time, + .. } => { let exec_ctx = exec_ctx.as_ref(); |
