Repository navigation
fix(distro): pacman-key --init before the arch/cachyos bootstrap upgrade - #478
Conversation
A COLD arch-base image build emits two error lines that fail charly's own
build-diagnostic gate, while a warm build passes:
==> ERROR: There is no secret key available to sign with.
==> Use 'pacman-key --init' to generate a default secret key.
error: command failed to execute correctly
Cause: the pristine quay.io/archlinux/archlinux base ships a populated keyring
but NO local secret key. Verified directly on base-20260719.0.558306 —
`gpg --homedir /etc/pacman.d/gnupg --list-secret-keys` is empty, and becomes a
"Pacman Keyring Master Key" only after `pacman-key --init`. Once the pinned base
tag ages far enough that the repos carry a newer archlinux-keyring, the
bootstrap `-Syu` upgrades that package and its post-transaction hook signs with
the local key that does not exist yet.
pacman treats the refused hook as non-fatal, so the image still builds and tags
— but the two error lines are real output, so scanStepDiagnostics fails the
step. That makes the failure time-triggered and cache-dependent: it appears on a
fresh store (CI, a new machine) and hides on a warm one.
Fix the hook rather than allowlist its error, mirroring the cachyos block that
masks the nvidia-ctk-cdi hook instead of tolerating its "command failed to
execute correctly" line. `pacman-key --init` is idempotent and creates exactly
the key the hook wants. Applied to both bootstraps: cachyos overrides
`bootstrap:` wholesale rather than deep-merging, so inheriting from arch is not
enough.
Claude-Session: https://claude.ai/code/session_016fnPmYiC6ZkqXSi6D8PAP6
Review — BLOCKHead SHA: Change class: runtime/config change — distro bootstrap Security screen: PASS — no secrets, no exfiltration, no scope mismatch, no weakened guardrails, no supply-chain change. The diff matches the description exactly. Blocks
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
Review — PASSHead SHA: Security screen: PASS — no secrets, no exfiltration, no scope mismatch (diff matches description exactly: both Checklist: All applicable rules PASS or NA. The single prior comment (github-actions[bot] BLOCK) is stale-superseded: it claimed the cachyos changed path never executed live and the tier was inflated. The CURRENT body has since been updated with a dedicated "The cachyos path, exercised in the same cold build" section — pasted Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
…04 (#1101) sdk #478 (squash 8656f7d, tag v0.2026305.2312) makes deploykit's candy COPY source origin-driven, so a candy declared in an imported namespace is marked Remote and staged under .build/_candy/<name>.<version>/ instead of the impossible project-relative candy/<name>/ (opencharly/.github#263 item (b)). plugin-build v0.2026305.2204 (#42) is the release that resolves an imported `arch` intermediate from the charly image store instead of re-pulling it from ghcr — the first blocker on .github#263. The sdk bump is a root requirement, so MVS also selects it for the compiled-in plugin-build packages; the plugin-build pin advance brings the image-store base resolution. The pin-currency PR gate fires on charly/go.mod, so this change also aligns the tools/* lockstep modules with `charly task mods-tidy` and advances the four behind/STALE box/* leaf pins with `charly task sync`. Gate (the repo's .github/workflows/ci.yml and pin-currency.yml): - go test ./charly/... rc=0 (466.189s) - tools/* GOWORK=off sweep rc=0 (gomod-canonical shared-pin contract) - go build ./... (charly module) rc=0 - go vet ./... rc=0 - gofmt -l charly tools empty - golangci-lint (go1.26.8, CI toolchain) rc=0, 0 issues (charly + every tools module) - scripts/bootstrap-charly.sh rc=0; ./bin/charly version = 2026.303.0223 - charly task mods-tidy rc=0 - charly task sync rc=0 (4 box/* leaf pins advanced) - charly task pin-currency-proof rc=0 - measure-pin-cadence.py --self-test rc=0 (PIN-CADENCE-SELF-TEST-OK) - charly task pin-current rc=0 (0 of 6 NOT current; 6 cur) Live: pod-crabbox PR #1 head d9b11549 built end to end with the rebuilt charly under CHARLY_PLUGIN_NO_PROGRESS=20m CHARLY_PLUGIN_LEAF_CAP=60m. The generated Containerfile emits COPY .build/_candy/cachyos-os-skills/ and COPY .build/_candy/cachyos-base-check/, and the image ghcr.io/opencharly/pod-crabbox:2026.305.2333 was produced (rc=0). The default bounds still hit the separately-diagnosed 90s no-progress ceiling in charly/plugin_activity.go (opencharly/.github#263 item (c)). Assisted-by: Claude Code deepseek-v4.1-flash:cloud (fully tested and validated) Co-authored-by: Andreas Trawoeger <[email protected]>
Summary
A cold arch-base image build emits two error lines that fail charly's own build-diagnostic gate. A warm build of the same tree passes. That difference is the whole bug: the failure is cache-dependent and time-triggered, so it lands on a fresh store (CI, a new machine, a wiped cache) and hides everywhere else.
Cause. The pristine
quay.io/archlinux/archlinuxbase ships a populated keyring but no local secret key. Verified directly against the pinned base:The list is empty before
--initand holds the master key after. So once the pinned base tag ages far enough that the repos carry a newerarchlinux-keyring, the bootstrap-Syuupgrades that package, and its post-transaction hook tries to sign with a local key that does not exist yet. This is why the bug appears on its own over time with no change to charly: it is a function of how stale the pinned base is relative to the repos.pacman treats the refused hook as non-fatal, so the image still builds and is tagged — but the lines are real output, so
scanStepDiagnosticsfails the step.Fix the hook, do not allowlist its error.
pacman-key --initis idempotent and creates exactly the key the hook wants. This mirrors the existing cachyos bootstrap, which masks thenvidia-ctk-cdihook with an empty override rather than tolerating itserror: command failed to execute correctlyline — same class of problem, same resolution. Allowlisting was the alternative and it is worse here: the second line is pacman's fully generic hook-failure line, so an entry claiming it would have to be conditional on something unrelated to it, and would mask real hook failures.Applied to both bootstraps.
cachyossetsinherits: archbut overridesbootstrap:wholesale rather than deep-merging (the block's own comment says so), so fixing arch alone would not reach it.How tested
Two cold builds of the same project from a wiped container store, one per binary. Store isolation via
CONTAINERS_STORAGE_CONFwith its own graphroot, wiped between runs, so both are genuinely cold — a warm store cannot reproduce this at all.Before —
charlyatorigin/main, cold store (check-punktfunk-podimage-build):Note
exited 0— the build itself succeeded; only the diagnostic gate failed it.After — this branch's binary, store wiped again, same project, same cold path:
The fix reaching the generated Containerfile:
Build of the binary under test:
The cachyos path, exercised in the same cold build. The earlier note said only "arch stages built: 2", which under-reported the run: the cold build contains four stages, and
cachyosis one of them.Inside the
cachyosstage (starting line 1000), its own bootstrap RUN carries the change — this is the cachyosinstall_cmd, not the inherited arch one:The trigger condition is present in that stage — it does upgrade the keyring package, which is what makes the hook fire — and the errors are gone:
So both changed branches executed live on a wiped store, each with the keyring upgrade actually occurring.
Rulebook compliance
pacman-key --initper bootstrap, in the existinginstall_cmdchain; no new step or hook file.Change classification
install_cmd.fully tested and validated— the changed path executed live on a cold store and the errors it fixes went to zero, with the emitted RUN line confirmed in the generated build.Assisted-by: Claude Code Anthropic Opus 5 (fully tested and validated)