feat(progress): report uncounted status through the sink

A run blocked on the cache-entry flock was silent: the wait went to
the log sink, which renders nowhere by default, so the CLI read as
a hang. The Progress trait gains message() - a status line outside
the counted-operation protocol, defaulting to a no-op so existing
sinks keep compiling - and the flock wait reports what it is
waiting for. The CLI renders messages on the active bar and spins
one up when no operation is active.
This commit is contained in:
vhaudiquet committed 2026-10-30 01:04:20 +01:00
1 parent 89a1028d46
commit c2e8d82cd3
5 files changed
+42 -7

No files matched your search

+20
View File
@@ -88,4 +88,24 @@ impl Progress for TermProgress {
bar.finish_and_clear();
}
}
fn message(&self, text: &str) {
let mut slot = self.bar.lock().unwrap();
if slot.is_none() {
// No operation is active: the message becomes a spinner
// until the next `begin` replaces it.
let pb = ProgressBar::new_spinner();
pb.set_style(
ProgressStyle::default_spinner()
.template("{spinner:.green} {msg}")
.unwrap(),
);
pb.set_message(text.to_string());
*slot = Some(pb);
return;
}
if let Some(bar) = &*slot {
bar.set_message(text.to_string());
}
}
}