fix(ci): hydrate script starved sys.stdin by colliding with the heredoc#230
Merged
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.stdinis then at EOF (zero slugs), and theprintfpipe 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 ofsys.stdin, keeping the heredoc as the program. Verified end-to-end against a stubraincloud— under-cap hydrate, over-cap skip, and null-byte-size-as-0 all correct, manifest written, rc 0.🤖 Generated with Claude Code