Repository navigation
lib: Deny (e)println! in bootc-lib, routing status output via ProgressWriter - #63
cgwalters-bot wants to merge 1 commit into
Conversation
Direct prints bypass --progress-fd and can interfere with structured output. Deny direct printing in bootc-lib, send status through the progress writer, and write command results to explicit streams. Verified with unit tests and focused Clippy. This runner hits the same workspace Clippy str::len error, Podman runtime error, and missing VM tool on unchanged main. Generated-by: AI
|
The poll stopped following this pull request: a draft with no checkpoint; mark it ready if the work is complete. It is labelled Generated-by: https://github.com/cgwalters/#llms |
|
Rebase round 1 of 2 for Generated-by: https://github.com/cgwalters/#llms |
ed19d4f to
a0fc5e6
Compare
|
Fix run report: One independent review pass found no rebase regressions but flagged existing progress-output issues outside this round’s scope. |
|
Rebase round 2 of 2 for Generated-by: https://github.com/cgwalters/#llms |
a0fc5e6 to
c742074
Compare
|
Fix run report: One independent review pass found no rebase blockers; ComposeFS progress test coverage and the original progress-output follow-ups remain open. Generated-by: https://github.com/cgwalters/#llms |
Library code printing directly to stdout/stderr bypasses --progress-fd and can corrupt machine-readable output, so this denies clippy::print_stdout and print_stderr (and anstream's print macros) in bootc-lib. User-facing status output now goes through ProgressWriter, which prints it as before and, when a progress fd is attached, also sends it as a new generic
Messageevent (protocol 0.2.0). A command's actual results go to an explicit stdout writer. Output without --progress-fd is byte-for-byte unchanged.This is the series from #1 rebased onto current main, which includes bootc-dev#2449, and supersedes #1. It also converts the prints that landed since #1's base: the UKI addon CLI, the global addon removal notice in the composefs update path, and
bootc usroverlay. The twoeprintln!calls bootc-dev#2449 added in delta_ostree.rs are in tests, which the clippy.tomlallow-print-in-testssetting covers. The fsck commit from #1 dropped out because main already writes passing checks to the provided output. Two pre-existingstr::lendisallowed-method hits in test code (ostree-ext fixture.rs, a deploy.rs test) are fixed socargo clippy --all-targetspasses.The issue asked to keep the series as small commits. This run hands back a single patch, so it lands as one commit. #1's branch keeps the per-commit split for reference.
Verified with cargo fmt --check, cargo clippy -p bootc-lib --all-targets (default lints and the Makefile's CLIPPY_CONFIG), cargo test -p bootc-lib (333 passed), and cargo check --workspace --all-targets. The tmt test change was not run.
Review: one pass, no blockers. Follow-ups it left open:
message()ignores the write error whereprintln!panicked, so that edge case now exits 0 instead of 101.message()writes to stdout/stderr.Closes #61