Skip to content

A closed pipe reader does not turn a CLI failure into success (#1211) - #1214

Merged
Lorenzobattistela merged 2 commits into
bendlang:mainfrom
oxura:fix/cli-epipe-status
Oct 1, 2026
Merged

Lorenzobattistela merged 2 commits into
bendlang:mainfrom
oxura:fix/cli-epipe-status

Conversation

@oxura

@oxura oxura commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Fixes #1211.

cli_say no longer turns a closed output reader into process.exit(0). It ignores EPIPE and lets the command finish with its actual result. In particular, --checkup continues past its first progress header and can still discover a failing later import. Errors other than EPIPE are still rethrown.

Adds nine exit-status regressions to the existing compiled-CLI checks in gates/ping.ts: failed run, failed --check-only, the unsafe --verdict gate, invalid option, a failing second --checkup import, successful run/check/help/checkup. The reader exits before Bend starts, with the writer FD kept open, so the first-write race is excluded. Documents pipeline exit-status behavior in the guide; no caps changed.

Verification on Linux x86-64, Bun 1.3.13:

  • All nine scenarios return their expected status both normally and with a pre-closed reader, against both the source CLI and a standalone executable built with bun build bend2/main.ts --compile --outfile bin/bend.
  • Closing stdout after --checkup's first header still reaches the later type error and returns 1.
  • Closing only stderr preserves failure; a cached release notice also preserves success/failure with closed stderr.
  • A failing --check-only piped into true returns 1 with pipefail.

The full installer/hub gates/ping.ts run is unavailable here because the sibling bend-lang.com repository is absent. The unsafe verdict gate was exercised; no real Lean kernel mismatch check or macOS run is claimed.

Repository gate: bun gates/repo.ts — PASS 49/49.

@Lorenzobattistela Lorenzobattistela self-assigned this Oct 1, 2026
@Lorenzobattistela

Copy link
Copy Markdown
Collaborator

Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants