diff options
Diffstat (limited to 'tvix/cli')
-rw-r--r-- | tvix/cli/Cargo.toml | 1 | ||||
-rw-r--r-- | tvix/cli/src/main.rs | 10 |
2 files changed, 10 insertions, 1 deletions
diff --git a/tvix/cli/Cargo.toml b/tvix/cli/Cargo.toml index d91da42864ad..434e4045e90f 100644 --- a/tvix/cli/Cargo.toml +++ b/tvix/cli/Cargo.toml @@ -23,6 +23,7 @@ rnix = "0.11.0" thiserror = "1.0.38" tokio = "1.28.0" tracing = "0.1.40" +tracing-indicatif = "0.3.6" [dependencies.wu-manber] git = "https://github.com/tvlfyi/wu-manber.git" diff --git a/tvix/cli/src/main.rs b/tvix/cli/src/main.rs index bb0b9b768b02..5e0b8c41819d 100644 --- a/tvix/cli/src/main.rs +++ b/tvix/cli/src/main.rs @@ -4,7 +4,8 @@ use clap::Parser; use repl::Repl; use std::rc::Rc; use std::{fs, path::PathBuf}; -use tracing::Level; +use tracing::{instrument, Level, Span}; +use tracing_indicatif::span_ext::IndicatifSpanExt; use tvix_build::buildservice; use tvix_eval::builtins::impure_builtins; use tvix_eval::observer::{DisassemblingObserver, TracingObserver}; @@ -152,6 +153,7 @@ struct IncompleteInput; /// Interprets the given code snippet, printing out warnings, errors /// and the result itself. The return value indicates whether /// evaluation succeeded. +#[instrument(skip_all, fields(indicatif.pb_show=1))] fn interpret( tvix_store_io: Rc<TvixStoreIO>, code: &str, @@ -160,6 +162,11 @@ fn interpret( explain: bool, allow_incomplete: AllowIncomplete, ) -> Result<bool, IncompleteInput> { + let span = Span::current(); + span.pb_start(); + span.pb_set_style(&tvix_tracing::PB_SPINNER_STYLE); + span.pb_set_message("Setting up evaluator…"); + let mut eval = tvix_eval::Evaluation::new( Box::new(TvixIO::new(tvix_store_io.clone() as Rc<dyn EvalIO>)) as Box<dyn EvalIO>, true, @@ -187,6 +194,7 @@ fn interpret( eval.runtime_observer = Some(&mut runtime_observer); } + span.pb_set_message("Evaluating…"); eval.evaluate(code, path) }; |