Repository navigation
fix(pacstrap): drop a dangling template field that broke every bootstrap VM build - #493
Conversation
…rap VM build `charly vm build` of ANY bootstrap VM has been failing since #484: charly: error: command "vm": rendering bootstrap script: template: bootstrap-script:2:9: executing "bootstrap-script" at <.Distro.Pacstrap.KeyringInitCmd>: can't evaluate field KeyringInitCmd in type *spec.Pacstrap Reproduced on arch-pacstrap and omarchy-pacstrap-vm identically — the pacstrap builder template is shared, so this is every pacstrap distro, not one of them. #484 dropped `keyring_init_cmd` and `mirrorlist_url` as dead fields. It verified they had ZERO Go consumers, and that was true. What it missed is that this one also had a TEMPLATE consumer, in charly.yml's own pacstrap builder body. Go templates resolve struct fields at RENDER time, so the reference compiled, validated, and passed every test — and then failed at `charly vm build`, which no CI gate exercises. Nothing is lost by removing it: `pacstrap -K` on the next line already initialises the target keyring, which #484's own body says is all that was ever needed. TestPacstrapBuilderTemplateFieldsExist guards the CLASS rather than this string: it reflects over spec.Pacstrap and requires every `.Distro.Pacstrap.X` interpolated anywhere in charly.yml to be a real field. A hand-kept list of allowed names would have to be updated by the same person who forgot the template, which is no guard at all. Verified: with the reference removed, arch-pacstrap renders its bootstrap script and proceeds into pacstrap (the rootfs tar runs), failing only later on a free-space precondition — which is that check working, not this defect. Claude-Session: https://claude.ai/code/session_01YKF2VLqeHHbrBDz8XftaD3
Review — BLOCKHead SHA: Change class: code/config change (removes a dangling template field in Security screen: PASS — no secrets, exfiltration, scope mismatch, or weakened guardrails. The fix itself (removing Blocks
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
|
The block is based on a misreading of the diff, and the claim is checkable — so here is the
The file at this PR's head, verified from a clean detached worktree of the head commit (not And it compiles and passes from that same clean worktree: So the Nothing to change here. Re-running the validator against the same head. |
Review — PASSHead SHA: Security screen: PASS — no secrets, exfiltration, scope mismatch, or weakened guardrails. The fix (removing the dangling Checklist: All applicable rules PASS or NA. Comment intake:
Placement: CORRECT — the fix stays in the pacstrap builder config ( Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
Summary
charly vm buildof any bootstrap VM has been broken since #484 merged this afternoon.Reproduced on
arch-pacstrapandomarchy-pacstrap-vmidentically. The pacstrap buildertemplate is shared, so this is arch, cachyos and omarchy alike — not one distro's problem.
Root cause
#484 dropped
keyring_init_cmdandmirrorlist_urlas dead fields, and verified they hadzero Go consumers. That verification was correct. What it missed is that
keyring_init_cmdalso had a template consumer, in this repo's own pacstrap builder body:Go templates resolve struct fields at render time. So the reference compiled,
charly box validatepassed, every unit test passed — and the failure appeared only atcharly vm build <bootstrap-vm>, which no CI gate exercises. Agit grep KeyringInitCmdacross Go sources finds nothing; the surviving reference is in YAML.
Nothing is lost by removing it.
pacstrap -Ktwo lines below already initialises the targetkeyring — which is what #484's own body said was "all that was ever needed here".
The guard is for the class, not this string
TestPacstrapBuilderTemplateFieldsExistreflects overspec.Pacstrapand requires every.Distro.Pacstrap.Xinterpolated anywhere incharly.ymlto be a real field:A hand-kept list of allowed names would have to be updated by the same person who forgot the
template — which is no guard at all. Reflection means the next field removal is caught by the
removal itself.
How tested
Negative control — restore the exact #484 defect:
That control matters twice over: it proves the test catches the real defect, and it proves
the test is not passing vacuously — with the fix applied it reports
checked 0 references,which on its own would be indistinguishable from a broken regex or a wrong file path.
Live — the build proceeds again
arch-pacstrap, which failed at render before this change, now renders and runs pacstrap:It gets all the way into the rootfs tar and stops on a free-space precondition — that check
working, on a host whose
/tmpis a 62 GiB tmpfs with other work on it. The template render,which is what this PR fixes, is past.
With staging redirected to a filesystem that has the room, the build completes end to end:
A 2.4 GB bootable rootfs built from packages — the thing that was impossible between #484 and
this commit.
Rulebook compliance
the original verification was incomplete (Go consumers checked, template consumers not).
Reproduced on a second distro before concluding it was shared.
field is gone from schema, from authored values, and now from the one place that still read
it.
keyring_init_cmdto the schema tosatisfy the template — would resurrect a dead field to feed a line that does nothing.
deletion was incomplete, and completing it is the whole diff.
git statusinspected before the commit; the localgo.mod/go.sumreplaces used for the dev build were deliberately NOT staged; branched from a fresh
origin/main; no force-push, no direct push tomain.a real bootstrap VM disk built end to end.
renders, and the disk it produces is retained above with its rootfs sha256.
task build:binarystamped charlyfrom this branch.
check-omarchy-pacstrap-vm(disposable: true) is thebed for the VM this unblocks; it is in
opencharly/distro-omarchyand running. This PR's ownclaim — that the template renders and the disk builds — is proved above on two distros.
Change classification
go test -count=1with a negative control recreating the defect, pluscharly vm buildreaching pacstrap onarch-pacstrapand completing end to end onomarchy-pacstrap-vmfully tested and validated— the failing path was reproduced on two distros, fixed, and a real 2.4 GB bootstrap disk was built from the final treeAssisted-by: Claude Code claude-opus-4-6-20260401 (fully tested and validated)