Repository navigation
fix(cli): handle closed stdout pipes - #1136
Merged
Merged
Conversation
Preserve normal output, diagnostics, and exit statuses when a downstream reader closes stdout. Cover compiler help and print commands and tooling help and exec with anonymous-pipe regressions. Refs wavefnd#1099 Signed-off-by: Tharunpranaav <pranavsivrem@gmail.com>
Refs wavefnd#1099 Signed-off-by: Tharunpranaav <pranavsivrem@gmail.com>
LunaStev
requested changes
Dec 4, 2026
LunaStev
left a comment
Member
There was a problem hiding this comment.
Thank you for the contribution. The shared CliStdout abstraction and deterministic closed-reader regression tests are a good approach to resolving #1099.
Before merging, please address the following:
Required changes
- Investigate and fix the non-BrokenPipe stdout error handling on Unix. The current CI results show that writing to read-only stdout can incorrectly return success without a diagnostic. Rust's standard stdout implementation may suppress EBADF.
- Ensure that only BrokenPipe is silently ignored and that other stdout errors are reported correctly.
- Fix the failing
help_reports_other_stdout_errorsandexec_preserves_child_status_and_stderr_when_stdout_closesregression tests without weakening their expected behavior. - Add regression coverage for
wavec --version, which is also modified by this PR. - Verify the behavior on Linux, macOS, and Windows.
Additional considerations
- Consider preserving child process status and diagnostics consistently between streaming and capture modes when stdout encounters a non-BrokenPipe error.
- Consider explicit flush handling at CLI output boundaries and direct unit tests for
CliStdout.
The overall implementation direction is appropriate. Please keep the deterministic OS-pipe regression approach.
Once these issues are addressed and the relevant CI checks pass, the PR can be reconsidered for approval.
Refs wavefnd#1099 Signed-off-by: Tharunpranaav <pranavsivrem@gmail.com>
LunaStev
marked this pull request as ready for review
December 5, 2026 06:03
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.
Summary
wavechelp, version, and print output and inwave-toolshelp and exec output.Testing
utilstests passed.utilswith the existingmanual_is_multiple_oflint allowed. Strict Clippy flagged that lint in unchanged code.wavecCLI regressions could not run locally because the LLVM 21.1 SDK andllvm-mcwere unavailable.wave-toolsCLI regressions could not run locally because GNU import-library tooling was incomplete and the MSVC linker (link.exe) was unavailable.This PR is a draft pending full CLI regression results.
Closes #1099