Skip to content

lib: Deny (e)println! in bootc-lib, routing status output via ProgressWriter - #63

Draft
cgwalters-bot wants to merge 1 commit into
cgwalters-forge:mainfrom
cgwalters-bot:dispatch/implement/agent-run-41165532659
Draft

cgwalters-bot wants to merge 1 commit into
cgwalters-forge:mainfrom
cgwalters-bot:dispatch/implement/agent-run-41165532659

Conversation

@cgwalters-bot

Copy link
Copy Markdown
Collaborator

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 Message event (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 two eprintln! calls bootc-dev#2449 added in delta_ostree.rs are in tests, which the clippy.toml allow-print-in-tests setting covers. The fsck commit from #1 dropped out because main already writes passing checks to the provided output. Two pre-existing str::len disallowed-method hits in test code (ostree-ext fixture.rs, a deploy.rs test) are fixed so cargo clippy --all-targets passes.

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:

  • Writes to the progress fd now block, which stalls the current-thread runtime, pull included, if the reader stops draining it. Consider a writer thread.
  • With a closed stdout, message() ignores the write error where println! panicked, so that edge case now exits 0 instead of 101.
  • install_container still uses ProgressWriter::default() for PullProgress instead of state.prog.
  • The progress-fd man page says status messages are "also sent" as Message events. Spinner text and pull step descriptions are not sent.
  • No test checks the bytes message() writes to stdout/stderr.

Closes #61

Generated by dispatch · ◷

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
@cgwalters-bot cgwalters-bot added the needs-human The poll stopped here; a person decides what is next label Oct 31, 2026
@cgwalters-bot

Copy link
Copy Markdown
Collaborator Author

The poll stopped following this pull request: a draft with no checkpoint; mark it ready if the work is complete. It is labelled needs-human; remove the label to have the poll start again on it, with fresh fix rounds.

Generated-by: https://github.com/cgwalters/#llms

@cgwalters-bot cgwalters-bot added review:deep Bot draft that needs a real review and removed needs-human The poll stopped here; a person decides what is next labels Nov 3, 2026
@cgwalters-bot

cgwalters-bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator Author

Rebase round 1 of 2 for ed19d4f46f9e: run.

Generated-by: https://github.com/cgwalters/#llms

@cgwalters-bot

cgwalters-bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator Author

✅ dispatch ended well. Result: #63

@cgwalters-bot
cgwalters-bot force-pushed the dispatch/implement/agent-run-41165532659 branch from ed19d4f to a0fc5e6 Compare December 2, 2026 00:32
@cgwalters-bot

Copy link
Copy Markdown
Collaborator Author

Fix run report:

One independent review pass found no rebase regressions but flagged existing progress-output issues outside this round’s scope.

{"schema":"agent-board/recommendation/v1","pr":63,"head":"a0fc5e6b441ce535af309ff834e40f36877299d4","action":"operator_question","reason":"The original progress writer can stall behind a slow reader and some status paths still bypass the progress fd; should a separate fix round address those before marking this draft ready?","detail":{}}

Generated by dispatch · ◷

@cgwalters-bot

Copy link
Copy Markdown
Collaborator Author

✅ dispatch ended well. Result: #63

@cgwalters-bot

cgwalters-bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator Author

Rebase round 2 of 2 for a0fc5e6b441c: run.

Generated-by: https://github.com/cgwalters/#llms

@cgwalters-bot
cgwalters-bot force-pushed the dispatch/implement/agent-run-41165532659 branch from a0fc5e6 to c742074 Compare December 2, 2026 22:01
@cgwalters-bot

Copy link
Copy Markdown
Collaborator Author

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

Generated by dispatch · ◷

@cgwalters-bot

Copy link
Copy Markdown
Collaborator Author

✅ dispatch ended well. Result: #63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:deep Bot draft that needs a real review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant