Skip to content

fix(ci): hydrate script starved sys.stdin by colliding with the heredoc#230

Merged
dfa1 merged 1 commit into
mainfrom
fix/hydrate-stdin-plumbing
Jul 7, 2026
Merged

fix(ci): hydrate script starved sys.stdin by colliding with the heredoc#230
dfa1 merged 1 commit into
mainfrom
fix/hydrate-stdin-plumbing

Conversation

@dfa1

@dfa1 dfa1 commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Second (and root) fix for the Raincloud conformance workflow (#205) hydrate-step failure. After the null-bytes fix (#229), the step still failed with hydrated=0 skipped=0 + printf: write error: Broken pipe.

Cause: the step ran printf '%s\n' "${SLUGS[@]}" | python - <<'PY'. python - reads its program from stdin, and the <<'PY' heredoc overrides the pipe as that stdin — so Python reads the script from the heredoc, sys.stdin is then at EOF (zero slugs), and the printf pipe has no reader (broken pipe → pipefail → exit 1). Undefined either way (locally the pipe won and tried to execute slug names as Python). It never worked; local conformance runs always used a pre-built manifest, so this was the workflow's first real execution.

Fix: write the slug list to a temp file (SLUGFILE, cleaned up on EXIT) and read that in the program instead of sys.stdin, keeping the heredoc as the program. Verified end-to-end against a stub raincloud — under-cap hydrate, over-cap skip, and null-byte-size-as-0 all correct, manifest written, rc 0.

🤖 Generated with Claude Code

… the heredoc program

The hydrate step ran python via `python - <<'PY'`, which reads the PROGRAM
from stdin — so piping the slug list into the same stdin collided: the
interpreter either sees an empty sys.stdin (CI: heredoc wins → hydrated=0,
printf broken pipe → pipefail exit 1) or tries to execute the slugs as
source. Never worked; the conformance workflow's first real runs both died
here. Pass the slug list in a temp file (SLUGFILE) and read that instead of
sys.stdin, keeping the heredoc as the program. Verified end-to-end against a
stub raincloud (under-cap hydrate, over-cap skip, null-size-as-0 all correct).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dfa1 dfa1 merged commit 9b66746 into main Jul 7, 2026
6 checks passed
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.

1 participant