report: add BuildView/Prompter ports and drive pkh build through them

Core flows no longer reach into the terminal UI: build_source_package
takes a BuildSourceOptions struct (source tree, domain options, view,
prompter) and reports phases, messages and outcomes through the
environment-agnostic ports in the new report module. The classifiers
move from ui/logfmt to the core logfmt module, DebUi becomes a
BuildView adapter, the re-vendor retry asks the prompter instead of
checking for a TTY, and artifact/success printing moves to the CLI.

Headless consumers pass report::Quiet; an embedding (e.g. a builder
server forwarding events to a web frontend) implements BuildView and
maps the plain-data events onto its own wire format.
This commit is contained in:
2026-09-18 20:02:56 +02:00
parent a7d2cfdc6e
commit 27b1083b15
11 changed files with 335 additions and 179 deletions
+3 -3
View File
@@ -819,7 +819,7 @@ mod tests {
let output = crate::build::run_source_build(
&source,
&crate::build::SourceBuildOptions::default(),
None,
&crate::report::Quiet,
)
.unwrap();
let dsc = std::fs::read_to_string(&output.dsc).unwrap();
@@ -885,7 +885,7 @@ mod tests {
let output = crate::build::run_source_build(
&dir.path().join("mytool"),
&crate::build::SourceBuildOptions::default(),
None,
&crate::report::Quiet,
)
.unwrap();
@@ -916,7 +916,7 @@ mod tests {
let output = crate::build::run_source_build(
&dir.path().join("mytool"),
&crate::build::SourceBuildOptions::default(),
None,
&crate::report::Quiet,
)
.unwrap();
assert!(output.dsc.exists(), "{:?} missing", output.dsc);