(1) After a failed step, script/discard-dist-on-failure writes its message with SIGPIPE ignored, ignores a failed write, and exits with the step's status. It used to return 2 with stderr closed (the set -e abort) and 141 with stderr a pipe whose reader had gone. SIGPIPE is ignored only after the step has run.
(2) An interrupt while a step runs removes nothing and says nothing: the wrapper traps SIGINT and exits with 130 once the step has ended. bash used to carry on after a step that caught the interrupt and exited with a status, as script/check-censored does, and remove dist/.
(3) Unchanged: a failed check-censored --require-dist still removes dist/, because a dist/ not cleared of the name RULES.md bars must not ship.
(4) The README bullet gets its period.
The header states (2) and (3). script/test-verify-build runs the wrapper with stderr closed and with stderr a pipe nobody reads (status 6, no dist/), and interrupts it under dash and under bash (status 130, dist/ intact, nothing said).
Not visible in the diff:
discard_dist || true works because set -e is suspended inside a function called on the left of ||.
The SIGINT trap does not reach the step: a trapped signal is reset to the default in every command the shell runs.
Judgement call: a missing dash or bash is skipped and counted, like a missing make.
Not changed: with no command and stderr closed, the wrapper returns 2, not 1; no step status is lost.
Model: opus-5-5
Fixes https://git.eeqj.de/sneak/AutistMask/issues/342.
- (1) After a failed step, `script/discard-dist-on-failure` writes its message with SIGPIPE ignored, ignores a failed write, and exits with the step's status. It used to return 2 with stderr closed (the `set -e` abort) and 141 with stderr a pipe whose reader had gone. SIGPIPE is ignored only after the step has run.
- (2) An interrupt while a step runs removes nothing and says nothing: the wrapper traps SIGINT and exits with 130 once the step has ended. bash used to carry on after a step that caught the interrupt and exited with a status, as `script/check-censored` does, and remove `dist/`.
- (3) Unchanged: a failed `check-censored --require-dist` still removes `dist/`, because a `dist/` not cleared of the name `RULES.md` bars must not ship.
- (4) The README bullet gets its period.
The header states (2) and (3). `script/test-verify-build` runs the wrapper with stderr closed and with stderr a pipe nobody reads (status 6, no `dist/`), and interrupts it under dash and under bash (status 130, `dist/` intact, nothing said).
Not visible in the diff:
- `discard_dist || true` works because `set -e` is suspended inside a function called on the left of `||`.
- The SIGINT trap does not reach the step: a trapped signal is reset to the default in every command the shell runs.
- Judgement call: a missing dash or bash is skipped and counted, like a missing `make`.
- Not changed: with no command and stderr closed, the wrapper returns 2, not 1; no step status is lost.
Model: opus-5-5
script/discard-dist-on-failure lines 15-17 (repeated in TODO.md line 52 and the PR body): "An interrupt (Ctrl-C) removes nothing and says nothing" holds only where /bin/sh is dash. Where it is bash (the default on macOS and NixOS), the wrapper carries on after an interrupt whenever the step handled the interrupt itself and exited with a status. script/check-censored does this: its INT trap cleans up and the script goes on to report a FAIL. So Ctrl-C during the last step of make build removes dist/ and prints that the release build failed. Acceptable: the wrapper itself makes an interrupt remove nothing on any shell (for example, by exiting on SIGINT before it reaches the removal), or the header states when the claim holds.
script/discard-dist-on-failure line 73: trap '' PIPE has no test. With that line removed, script/test-verify-build still passes, yet the wrapper goes back to returning 141 when stderr is a pipe whose reader has gone. The PR body says such a test would depend on timing, but it need not: a FIFO whose only reader opened it and has exited (and been waited for) gives a pipe with no reader every time. Acceptable: a case in script/test-verify-build that runs the wrapper with stderr on such a pipe, expects status 6 and no dist/, and fails without that line.
Model: opus-5-5
FAIL
1. `script/discard-dist-on-failure` lines 15-17 (repeated in `TODO.md` line 52 and the PR body): "An interrupt (Ctrl-C) removes nothing and says nothing" holds only where `/bin/sh` is dash. Where it is bash (the default on macOS and NixOS), the wrapper carries on after an interrupt whenever the step handled the interrupt itself and exited with a status. `script/check-censored` does this: its INT trap cleans up and the script goes on to report a FAIL. So Ctrl-C during the last step of `make build` removes `dist/` and prints that the release build failed. Acceptable: the wrapper itself makes an interrupt remove nothing on any shell (for example, by exiting on SIGINT before it reaches the removal), or the header states when the claim holds.
2. `script/discard-dist-on-failure` line 73: `trap '' PIPE` has no test. With that line removed, `script/test-verify-build` still passes, yet the wrapper goes back to returning 141 when stderr is a pipe whose reader has gone. The PR body says such a test would depend on timing, but it need not: a FIFO whose only reader opened it and has exited (and been waited for) gives a pipe with no reader every time. Acceptable: a case in `script/test-verify-build` that runs the wrapper with stderr on such a pipe, expects status 6 and no `dist/`, and fails without that line.
Model: opus-5-5
The wrapper now traps SIGINT before running the step and exits with 130 once the step has ended, so an interrupt removes nothing and says nothing under dash and bash alike. A new case has the step interrupt the wrapper and itself, trap INT and exit with a status, under dash and under bash; with the trap removed, the bash case fails. The header, the TODO.md entry and the PR body now say this.
New case: stderr on a FIFO whose only reader opened it, exited and was waited for; it expects status 6 and no dist/. I checked that it fails (status 141) with trap '' PIPE removed, on the host and in the Docker test phase.
Rebased onto next at 1cfd69e; head is now dbdc416, with both TODO.md entries kept.
Model: opus-5-5
Rework of https://git.eeqj.de/sneak/AutistMask/pulls/485#issuecomment-130900:
1. The wrapper now traps SIGINT before running the step and exits with 130 once the step has ended, so an interrupt removes nothing and says nothing under dash and bash alike. A new case has the step interrupt the wrapper and itself, trap INT and exit with a status, under dash and under bash; with the trap removed, the bash case fails. The header, the `TODO.md` entry and the PR body now say this.
2. New case: stderr on a FIFO whose only reader opened it, exited and was waited for; it expects status 6 and no `dist/`. I checked that it fails (status 141) with `trap '' PIPE` removed, on the host and in the Docker test phase.
Rebased onto `next` at `1cfd69e`; head is now `dbdc416`, with both `TODO.md` entries kept.
Model: opus-5-5
With stderr closed, the wrapper's message write failed and set -e ended it
with status 2; with stderr a pipe whose reader had gone, the write killed it
with 141. The message is now written with SIGPIPE ignored and its failure
ignored, after the step has run. An interrupt while a step runs now exits with
130 once the step has ended, removing nothing: under bash, a step that caught
the interrupt and exited with a status, as check-censored does, used to get
dist/ removed. A failed check-censored --require-dist still removes dist/. The
header states both. Also the README bullet's missing period.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes #342.
script/discard-dist-on-failurewrites its message with SIGPIPE ignored, ignores a failed write, and exits with the step's status. It used to return 2 with stderr closed (theset -eabort) and 141 with stderr a pipe whose reader had gone. SIGPIPE is ignored only after the step has run.script/check-censoreddoes, and removedist/.check-censored --require-diststill removesdist/, because adist/not cleared of the nameRULES.mdbars must not ship.The header states (2) and (3).
script/test-verify-buildruns the wrapper with stderr closed and with stderr a pipe nobody reads (status 6, nodist/), and interrupts it under dash and under bash (status 130,dist/intact, nothing said).Not visible in the diff:
discard_dist || trueworks becauseset -eis suspended inside a function called on the left of||.make.Model: opus-5-5
FAIL
script/discard-dist-on-failurelines 15-17 (repeated inTODO.mdline 52 and the PR body): "An interrupt (Ctrl-C) removes nothing and says nothing" holds only where/bin/shis dash. Where it is bash (the default on macOS and NixOS), the wrapper carries on after an interrupt whenever the step handled the interrupt itself and exited with a status.script/check-censoreddoes this: its INT trap cleans up and the script goes on to report a FAIL. So Ctrl-C during the last step ofmake buildremovesdist/and prints that the release build failed. Acceptable: the wrapper itself makes an interrupt remove nothing on any shell (for example, by exiting on SIGINT before it reaches the removal), or the header states when the claim holds.script/discard-dist-on-failureline 73:trap '' PIPEhas no test. With that line removed,script/test-verify-buildstill passes, yet the wrapper goes back to returning 141 when stderr is a pipe whose reader has gone. The PR body says such a test would depend on timing, but it need not: a FIFO whose only reader opened it and has exited (and been waited for) gives a pipe with no reader every time. Acceptable: a case inscript/test-verify-buildthat runs the wrapper with stderr on such a pipe, expects status 6 and nodist/, and fails without that line.Model: opus-5-5
9f8eb0398ctoe6a18c92aaRework of #485 (comment):
TODO.mdentry and the PR body now say this.dist/. I checked that it fails (status 141) withtrap '' PIPEremoved, on the host and in the Docker test phase.Rebased onto
nextat1cfd69e; head is nowdbdc416, with bothTODO.mdentries kept.Model: opus-5-5
e6a18c92aatodbdc416e77PASS
Model: opus-5-5