From 4ec9a4b7dfb7a22fca39715e20f4973d299fd7fa Mon Sep 17 00:00:00 2001 From: Vova Kryachko Date: Fri, 1 Nov 2024 10:57:42 -0400 Subject: [PATCH] fix(tvix/tracing): Enable tracing in tvix-build. Change-Id: Ica9734d7774da4d5e2a5cacab6b9feb27becc3e2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12720 Tested-by: BuildkiteCI Reviewed-by: flokli --- tvix/build/src/bin/tvix-build.rs | 4 +++- tvix/cli/src/main.rs | 2 +- tvix/tracing/src/lib.rs | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tvix/build/src/bin/tvix-build.rs b/tvix/build/src/bin/tvix-build.rs index cb92f333e..ffdbc3ca4 100644 --- a/tvix/build/src/bin/tvix-build.rs +++ b/tvix/build/src/bin/tvix-build.rs @@ -50,7 +50,9 @@ enum Commands { async fn main() -> Result<(), Box> { let cli = Cli::parse(); - let _ = tvix_tracing::TracingBuilder::default().enable_progressbar(); + tvix_tracing::TracingBuilder::default() + .enable_progressbar() + .build()?; match cli.command { Commands::Daemon { diff --git a/tvix/cli/src/main.rs b/tvix/cli/src/main.rs index 338486195..e16127692 100644 --- a/tvix/cli/src/main.rs +++ b/tvix/cli/src/main.rs @@ -57,7 +57,7 @@ fn lint(code: &str, path: Option, args: &Args) -> bool { fn main() { let args = Args::parse(); - let _ = tvix_tracing::TracingBuilder::default() + tvix_tracing::TracingBuilder::default() .enable_progressbar() .build() .expect("unable to set up tracing subscriber"); diff --git a/tvix/tracing/src/lib.rs b/tvix/tracing/src/lib.rs index 41f294cf4..1305778a3 100644 --- a/tvix/tracing/src/lib.rs +++ b/tvix/tracing/src/lib.rs @@ -145,6 +145,7 @@ impl TracingHandle { } } +#[must_use = "Don't forget to call build() to enable tracing."] #[derive(Default)] pub struct TracingBuilder { progess_bar: bool,