deb,report,ui: report the staged-tree copy while a record forks

Forking an incremental base copies its whole staged tree — bounded,
and without reflinks a matter of minutes — but the copy emitted no
build events: the live view showed the target line with nothing below
it, and an interrupt there printed raw cp errors with no hint of what
was running (the fork happens before the first bootstrap phase owns
the view).

Announce the copy through a new BuildView::byte_progress port. The
fork sizes the source up front (the copy's total), re-measures the
growing destination from a scoped thread while cp runs (cp has no
progress output to tap), and reports the completed copy when it
returns; unmeasurable or empty sources copy unreported. The terminal
view renders it like the other determinate bars, with byte-unit
counters.
This commit is contained in:
2026-10-03 01:28:30 +02:00
parent 83a853d259
commit f6f2b882a8
4 changed files with 227 additions and 16 deletions
+6
View File
@@ -92,6 +92,12 @@ pub trait BuildView: Send + Sync {
/// retrieval); `pos` runs from 0 to `total`.
fn progress(&self, _label: &str, _pos: usize, _total: usize) {}
/// Determinate progress of a byte transfer within the current phase
/// (e.g. the staged-tree copy forked from an incremental base):
/// `pos` of `total` bytes. Like [`BuildView::progress`], but adapters
/// render byte units for it.
fn byte_progress(&self, _label: &str, _pos: u64, _total: u64) {}
/// Sink receiving every raw subprocess line while a build command runs,
/// when this view consumes the lines itself (live rewriting, tee to a
/// log file, forwarding over the network). `None` lets the caller fall