Repository navigation
lib: Deny (e)println! in bootc-lib, routing status output via ProgressWriter - #63
Draft
cgwalters-bot wants to merge 1 commit into
Draft
cgwalters-bot wants to merge 1 commit into
cgwalters-bot wants to merge 1 commit into
Conversation
…sWriter 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. Generated-by: https://github.com/cgwalters/#llms
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 Generated-by: https://github.com/cgwalters/#llms |
This was referenced Nov 1, 2026
bootc: Use containers-image-proxy Error::is_retryable() for pull retries
cgwalters-forge/tracker#208
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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