-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
env:Improve GNU coreutils Compatibility & Fix env-signal-handler.sh Test #9465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Add default-signal, block-signal, and list-signal-handling options - Support specifying, tracking, and reporting signal handling changes - Update en-US and fr-FR locales to document new signal options
…nd prevent ignoring uncatchable signals.
…ment variable and `uucore`'s new handler.
…eutils into env_compatibility
Added 'Sigmask' to ignore list in env.rs and 'sighandler' in test_env.rs to suppress false positives from spell-checker on legitimate specialized words.
Remove explicit match on write result to handle BrokenPipe errors, simplifying to a direct map_err_context call. This assumes uucore's higher-level error handling will appropriately ignore BrokenPipe signals for command-line tools, reducing code duplication and improving consistency across uutils commands.
Modify the error handling in uumain to specifically catch BrokenPipe errors, display the error message via uucore::show_error!, but return Ok(()) instead of propagating the error. This ensures seq exits successfully on broken pipes, matching the behavior of GNU seq.
|
GNU testsuite comparison: |
Previously, the signal handling functions (`apply_default_signal`, `apply_ignore_signal`, and `apply_block_signal`) would return an error if `signal_from_value` got an invalid signal. This change modifies the code to skip invalid signals and continue processing, aligning with GNU env's behavior of ignoring undefined signals on certain platforms where `ALL_SIGNALS` may include invalid values. This improves compatibility and robustness.
|
GNU testsuite comparison: |
|
Any chance theres a clean way to split the compatibility fixes from the test fixes? Its just quite a big CR to review and its hard to match the tests to the code changes. Maybe at least splitting the changes in the other bins? |
separate this PR |
Key Improvements
Increased GNU coreutils compatibility by aligning behavior with upstream implementations and addressing differences in edge-case handling.
Fixed the env-signal-handler.sh test, ensuring correct signal propagation and consistent behavior across platforms.
Added minor adjustments to internal logic to better emulate GNU semantics and reduce divergence.
Why This Matters
Improving compatibility helps maintain predictable behavior for users migrating from GNU coreutils. Successfully passing the env-signal-handler.sh test strengthens signal-handling reliability and contributes to overall test suite stability.