coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

fix(seq):GNU seq-epipe.sh

Open mattsu2020 opened this issue 1 month ago • 8 comments

Summary

Add a constructor hook that records whether SIGPIPE was already set to SIG_IGN before the std runtime mutates it, so seq can detect when the shell explicitly ignores the signal. Have sigpipe_is_ignored() simply read the captured flag, letting the utility treat EPIPE as a write error only when SIGPIPE is being ignored externally (matching the GNU seq expectation and the seq-epipe.sh test). Document the safety of the capture_sigpipe_state initializer so Clippy is satisfied.

Testing

cargo build -p uu_seq --bin seq trap "" PIPE && { ./target/debug/seq inf 2>err; echo $? >code; } | head -n1

related https://github.com/uutils/coreutils/issues/9127

mattsu2020 avatar Nov 08 '25 08:11 mattsu2020

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/seq/seq-epipe is no longer failing!

github-actions[bot] avatar Nov 08 '25 08:11 github-actions[bot]

i guess it is pretty but would it be possible to add a test? thanks

sylvestre avatar Nov 08 '25 08:11 sylvestre

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/seq/seq-epipe is no longer failing!

github-actions[bot] avatar Nov 08 '25 09:11 github-actions[bot]

some lints are failing

sylvestre avatar Nov 08 '25 10:11 sylvestre

CodSpeed Performance Report

Merging #9184 will not alter performance

Comparing mattsu2020:seq_compatibility (02875d0) with main (5be7f83)

Summary

✅ 126 untouched
⏩ 6 skipped[^skipped]

[^skipped]: 6 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

codspeed-hq[bot] avatar Nov 08 '25 11:11 codspeed-hq[bot]

GNU testsuite comparison:

Congrats! The gnu test tests/seq/seq-epipe is no longer failing!

github-actions[bot] avatar Nov 08 '25 11:11 github-actions[bot]

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)

github-actions[bot] avatar Nov 29 '25 08:11 github-actions[bot]

GNU testsuite comparison:

Congrats! The gnu test tests/seq/seq-epipe is no longer failing!

github-actions[bot] avatar Nov 29 '25 10:11 github-actions[bot]