fix(installer): embed jsonc_require_python3 fallback for curl|bash (closes #11) #12
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/curl-bash-prereqs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Closes Forgejo issue #11. The canonical
curl -fsSL .../install.sh | bashinvocation crashed atinstall.sh:199withjsonc_require_python3: orden no encontradabecausejsonc_require_python3(defined inlib/jsonc.sh:87) was never sourced in the stdin path:lib/jsonc.shsourcing is gated onSCRIPT_DIRorBUNDLE_DIRbeing set (install.sh:45-49), andcmd_install's post-fetch source (line 400) runs AFTERrequire_prereqsis called (line 390).Fix
Embeds a minimal fallback for
jsonc_require_python3ininstall.shitself, guarded byif ! declare -F, mirroring the existingopenmillas:52-58pattern. Whenlib/jsonc.shIS sourced (in-tree or post-fetch) the lib version wins via the source guard atlib/jsonc.sh:50-53; in the curl|bash path the embed resolves the symbol sorequire_prereqsno longer crashes.Error message matches
openmillas:52-58verbatim ("python3 is required for JSONC operations (apt: python3, brew: python, dnf: python3).") so users get the same friendly diagnostic from either entry point.Test
Adds
do_test_install_curl_pipe_stdin_prereqsto close the gap indo_test_install_curl_pipe_stdin(which only tested--helpand therefore never reached line 199). The new test exercises both paths through stdin:python3on PATH: asserts the script reachesfetch_bundle_to_tmpdir(curl stubbed) and that noorden no encontrada/command not foundappears.python3absent: asserts the embedded fallback emits the friendly error message and noorden no encontradaappears.Test design adds
dateto the PATH stub for Case B (required byinstall.sh:71TIMESTAMP="$(date +%Y%m%d-%H%M%S)"beforerequire_prereqs).Also included
0.3.3→0.3.4ininstall.sh,openmillas,AGENTS.md §1, andCHANGELOG.md. New dated section per the project's release discipline (no[Unreleased], dated[X.Y.Z] - YYYY-MM-DDat merge time).AGENTS.md §5.9(rewritten): cross-reference to.opencode/agents.mdfor host-specific setup notes (credential helper paths, env file locations, local tool versions, etc.). The Forgejo helper rule itself is NO LONGER inAGENTS.md(which ships to the public repo); it lives in.opencode/agents.md, which isgitignoredper the new.gitignoreentry. Each contributor keeps their own local copy..gitignore: adds.opencode/so the local-only host setup directory never ships.Deferred
TD-26 (follow-up):
install.shcmd_doctorhas the same latent pattern (now at line 567), but is only reachable viabash <(cat install.sh) --doctor(not via the issue #11 trace). No-op for the normal curl|bash install becausecmd_install's post-fetch source runs first. Tracked separately.Validation
bash workspace/opencode/deploy.sh --check— PASSbash workspace/opencode/tests/test_install.sh—PASS: 28 FAIL: 0(27 pre-existing + 1 new). Note:do_test_install_idempotenthas a pre-existing timing flake (mtime resolved at 1-second granularity, no sleep between installs) — not related to this fix.Spec
Internal:
.internal/specs/fix-issue-11-curl-bash-prereqs.md(gitignored).Issue
Verbatim body of Forgejo issue #11:
Reported 2026-09-06 09:11:58 by millaredos (owner).
Closes #11
3be97a02b6toafc152c0d7