Conversation
Test Results 3 files 32 suites 11m 4s ⏱️ Results for commit 5793756. |
Public API changes for crate: brush-coreAdded itemsPerformance Benchmark Report
Code Coverage Report: Only Changed Files listed
Minimum allowed coverage is Test Summary: bash-completion test suite
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR standardizes how broken pipe (SIGPIPE) conditions from builtins are handled, ensuring they translate into the expected exit status (141) and do not surface as fatal or noisy errors in pipelines.
Changes:
- Add a dedicated
ExecutionExitCode::BrokenPipevariant and wire it into exit-code conversions, including fromstd::io::Error. - Extend the builtin error infrastructure (
BuiltinErrorandError) to expose underlyingstd::io::Errors so broken pipe causes can be detected centrally inexecute_builtin_command. - Update
printfto propagate I/O errors directly and add compat test cases to validate broken pipe behavior in pipelines andPIPESTATUS.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
brush-shell/tests/cases/compat/pipeline.yaml |
Unskips a previously TODO’d broken-pipe case and adds a new printf pipeline test to assert exit code 141 and correct PIPESTATUS. |
brush-core/src/results.rs |
Introduces ExecutionExitCode::BrokenPipe and maps it to/from numeric code 141, integrating SIGPIPE into the unified exit-code model. |
brush-core/src/error.rs |
Enhances the error model with BuiltinError::as_io_error, Error::as_io_error, and an impl From<&std::io::Error> for ExecutionExitCode, so I/O errors (notably broken pipes) can be converted into appropriate exit codes. |
brush-core/src/commands.rs |
Adjusts builtin execution to intercept broken-pipe I/O errors, turning them into a normal ExecutionResult with exit code 141 instead of propagating a fatal or noisy error. |
brush-builtins/src/printf.rs |
Changes printf to propagate underlying I/O errors as brush_core::Error (rather than wrapping them as usage errors), allowing broken pipes from printf to be recognized and mapped to 141. |
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.
This should, among other things, resolve some of the flaky tests we've seen very recently. Those were cases where a pipe error was sometimes getting returned by the
printfbuiltin.