fix: extract seed-local-community Python/SQL so it parses under bash 3.2#1362
Open
cameronhotchkies wants to merge 1 commit into
Open
fix: extract seed-local-community Python/SQL so it parses under bash 3.2#1362cameronhotchkies wants to merge 1 commit into
cameronhotchkies wants to merge 1 commit into
Conversation
seed-local-community.sh inlined its host-derivation Python as a heredoc
inside $(...) command substitution. Stock macOS /bin/bash (3.2) does not
treat a heredoc body as literal there, so quotes/apostrophes in the Python
flipped its quote state and the whole script failed to parse ("unexpected
EOF while looking for matching"), breaking just relay / just setup on a
default macOS toolchain.
Move host derivation to scripts/seed-hosts.py and the upsert to
scripts/seed-communities.sql; the shell now only wires them together and
never parses their source. Seeded loopback authorities are unchanged.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
wesbillman
approved these changes
Jun 29, 2026
wesbillman
left a comment
Collaborator
There was a problem hiding this comment.
Adversarial pass found no blockers.
What I checked:
- The extracted
scripts/seed-hosts.pypreserves the old host derivation behavior for default loopback,127.0.0.1, default ws/wss ports, non-loopback hosts, IPv6 loopback-shaped hosts, and invalid/emptyRELAY_URLcases. /bin/bash3.2 parses the wrapper now (/bin/bash -n scripts/seed-local-community.sh).scripts/seed-hosts.pycompiles withpy_compile.scripts/seed-communities.sqlcorrectly consumes the newline-separated:hostspsql variable via both directpsql -fand docker-stdin style, and remains idempotent.- Full isolated migration + seed against a temporary Postgres DB succeeded; second seed was
INSERT 0 0and the resulting rows were the expected four loopback authorities.
Validation:
/bin/bash -n scripts/seed-local-community.shpython3 -m py_compile scripts/seed-hosts.pygit diff --check origin/main...HEAD- isolated
buzz-admin migrate+scripts/seed-local-community.shtwice on a temp DB
No CHANGE comments from me.
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.
scripts/seed-local-community.shinlined its host-derivation Python as a heredoc inside$(...)command substitution. Stock macOS/bin/bash(3.2) does not treat a heredoc body as literal there, so quotes/apostrophes in the Python flip its quote state and the whole script fails to parse (unexpected EOF while looking for matching "). That breaksjust relay/just setup(via the_ensure-migrationsrecipe) on a default macOS toolchain — no modern bash on PATH.Fix: split the logic out so the shell never parses Python or SQL source.
scripts/seed-hosts.py— host derivation (unchanged logic)scripts/seed-communities.sql— the upsert, taking the host list via a:hostspsql varseed-local-community.sh— now only wires them togetherSeeded loopback authorities are identical to before.
Verified locally: parses under
/bin/bash3.2;just _ensure-migrationsgreen; both idempotent (INSERT 0 0) and insert (INSERT 0 1) paths exercised.🤖 Generated with Claude Code