Skip to content

tail: exit silently once the stdout reader goes away under wasi - #16638

Merged
sylvestre merged 1 commit into
uutils:mainfrom
eduardomourar:tail/exit-on-closed-pipe
Nov 26, 2026
Merged

sylvestre merged 1 commit into
uutils:mainfrom
eduardomourar:tail/exit-on-closed-pipe

Conversation

@eduardomourar

Copy link
Copy Markdown
Contributor

Unix reports a closed pipe reader as SIGPIPE; WASI has no signals, so tail prints a noisy "I/O error" or "Broken pipe" message instead. Wrap stdout so a write past a closed reader exits with the same status a SIGPIPE death reports, matching the existing Windows handling for the same condition.

Comment thread tests/by-util/test_tail.rs Resolved
Comment thread tests/by-util/test_tail.rs Resolved
Comment thread src/uu/tail/src/tail.rs Resolved
Comment thread src/uu/tail/src/tail.rs Resolved
@eduardomourar
eduardomourar force-pushed the tail/exit-on-closed-pipe branch from 9115ea0 to fe0f35d Compare November 17, 2026 23:40
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Binary size comparison:

Individual binary size comparison VS main (threshold: >=5% AND >=4 KB).

Total size of compared binaries: 155.48 MB (+100 KB, +0.06%)

Significant per-binary changes:
  env     1.20 MB ->    1.28 MB  (+80 KB, +6.51%)

Comment thread src/uu/tail/src/tail.rs Resolved
Comment thread src/uu/tail/src/tail.rs Resolved
Comment thread src/uu/tail/src/tail.rs Resolved
Comment thread tests/by-util/test_tail.rs Resolved
@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Congrats! The gnu test tests/tail/follow-name is no longer failing!
Congrats! The gnu test tests/tail/pid-pipe is no longer failing!

Comment thread src/uu/tail/src/tail.rs Resolved
Comment thread src/uu/tail/src/paths.rs Resolved
@eduardomourar
eduardomourar force-pushed the tail/exit-on-closed-pipe branch from 9f26725 to cc3c80c Compare November 25, 2026 03:55
@sylvestre
sylvestre merged commit 9b889a3 into uutils:main Nov 26, 2026
103 checks passed
@eduardomourar
eduardomourar deleted the tail/exit-on-closed-pipe branch November 26, 2026 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants