Repository navigation
fix(pacstrap): append only repositories the builder image does not already have - #494
Conversation
…ready have
The pacstrap builder template appends the distro's extra_repo block to
/etc/pacman.conf unconditionally. When the builder is based on the distro's own
image — which already carries those repositories — pacman double-registers them
and errors on every single build:
error: could not register 'omarchy' database (database already registered)
error: could not register 'multilib' database (database already registered)
And that base is not an accident. omarchy-pacstrap-builder is built on the
omarchy image PRECISELY so pacstrap resolves core/extra from Omarchy's frozen
mirror snapshot instead of upstream Arch: charly appends extra repositories but
does not repoint core/extra, so a plain-Arch builder would silently produce a
rootfs mixing Omarchy's own packages with a newer upstream snapshot. Choosing
the right base is what surfaced this.
pacstrap still completes afterwards, so `charly vm build` exits 0 and the disk
is written. Only a bed's errors-fatal log gate catches it — which is exactly how
it stayed invisible until check-omarchy-pacstrap-vm failed at [vm-build] with
those two lines as its only non-allowlisted findings.
[options] is deliberately exempt from the de-duplication. It is present in every
pacman.conf, its directives merge rather than conflict, and it is where
renderPacstrapExtraConf puts the microarch `Architecture = x86_64 x86_64_v3`
line that cachyos-family repos require. Dropping it as a duplicate would break
those silently — the same class of failure this commit fixes, in the opposite
direction.
The filter was verified in isolation before it went near a build: given a
pacman.conf with [options] [core] [omarchy] [multilib] and an extra file
offering [options]+Architecture, [omarchy], [multilib] and [newrepo], it emits
exactly [options] with its Architecture line and [newrepo].
Claude-Session: https://claude.ai/code/session_01YKF2VLqeHHbrBDz8XftaD3
Review — BLOCKHead SHA: Change class: runtime/code change — one shell filter in the pacstrap builder template ( Security screen: PASS — no scope mismatch, no secrets/exfiltration, no weakened guardrails, no supply-chain changes, no embedded directives. Blocks
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
Review — BLOCKHead SHA: Change class: runtime/code change — one shell filter in the pacstrap builder template ( Security screen: PASS — no scope mismatch, no secrets/exfiltration, no weakened guardrails, no supply-chain changes, no embedded directives. Blocks
Note: the prior Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
Review — PASSHead SHA: Change class: runtime/code change — one shell/awk filter in the pacstrap builder template ( Security screen: PASS — no scope mismatch (diff is exactly the described filter), no secrets/exfiltration, no weakened guardrails, no supply-chain changes, no embedded directives. Checklist: All applicable rules PASS or NA.
Comment intake:
Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
Review — PASSHead SHA: Security screen: PASS — no scope mismatch (diff is exactly the described awk filter in Checklist: All applicable rules PASS or NA.
Comment intake:
Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
Summary
The pacstrap builder template appends the distro's
extra_repoblock to/etc/pacman.confunconditionally. When the builder image already carries those repositories, pacman
double-registers them and errors on every build:
Why a builder would already have them — this is not a misconfiguration
omarchy-pacstrap-builderis built on theomarchyimage deliberately. pacstrap runsinside the builder and resolves against the builder's own
pacman.conf; charly appends adistro's extra repositories there but does not repoint
[core]and[extra]. On aplain-Arch base those still point at upstream Arch, so the target rootfs would come from a
mix — the ~23 Omarchy-built packages from Omarchy's repo and the ~125
core/extraones froma newer upstream snapshot than Omarchy ships. pacman succeeds either way, which is what makes
that divergence dangerous rather than merely wrong.
So choosing the correct base is exactly what surfaced this. The fix belongs in the template,
not in the box.
Why it stayed invisible
pacstrap completes after the failed registration, so
charly vm buildexits 0 and writesthe disk. Only a bed's errors-fatal log gate catches it — which is precisely how it surfaced:
check-omarchy-pacstrap-vmfailed at[vm-build]with those two lines as its onlynon-allowlisted findings (the mkinitcpio chroot messages beside them are already allowlisted).
The fix
[options]is deliberately exempt. It is present in everypacman.conf, its directivesmerge rather than conflict, and it is where
renderPacstrapExtraConfputs the microarchArchitecture = x86_64 x86_64_v3line that cachyos-family repos require. Dropping it as aduplicate would break those silently — the same class of failure this fixes, in the opposite
direction. That exemption is the part most likely to be "simplified" away later, so it is
called out in the template comment too.
How tested
The filter, in isolation, before it went near a build
Given a
pacman.confwith[options] [core] [omarchy] [multilib], and an extra file offering[options]+Architecture,[omarchy],[multilib],[newrepo]:Exactly the two things that should survive: the
[options]directives, and the repository theimage does not already have. Both duplicates dropped.
The real build, before and after
Same entity, same builder image, same host — the template is the only difference.
Before:
After:
Zero error lines of any kind, and the disk still builds — 2,430,926,848 bytes. Both halves
matter: silencing the errors by not appending at all would also have produced zero errors and
a rootfs missing Omarchy's repositories.
The bed
check-omarchy-pacstrap-vm(disposable: true) is the bed that caught this. Its[vm-build]step is the step this change fixes, and it went fromto
No
warnings=counter on either step — the remaining findings are the allowlisted mkinitcpiochroot messages, and the two
error:lines this PR removes are gone.The bed as a whole does not yet reach
PASS (steps=N). It went on to fail at[check-live]on two assertions about the guest. Both are already fixed, in a namedplace, and neither is a defect in this diff:
Exit:
opencharly/distro-omarchybranchfeat/omarchy-pacstrap-vm— pushed, commit"feat(vm): omarchy-pacstrap-vm — Omarchy built from packages, and its builder". It carries
exactly these two fixes:
omarchyadded to the VM entity'ssource.package. The pacstrapped rootfs was plain Arch(
ID=arch) because the distro'spacstrap.base_packageis a minimal bootstrap set andcarries neither
omarchynoromarchy-settings.path does not create —
efibootmgr --createruns inside the builder against a loop deviceand never reaches the guest's OVMF variable store. The guest boots limine through the
firmware's auto-created removable-media entry (
Boot0002* UEFI Misc Device {auto_created_boot_option}→/boot/EFI/BOOT/BOOTX64.EFI). The replacement asserts/proc/cmdlinecarriesrootflags=subvol=@androotfstype=btrfs, which exist only in thelimine.confcharly's template wrote — a stronger claim that holds on both paths.That branch is blocked on THIS PR: without the de-duplication its
[vm-build]fails first andneither guest-side assertion is ever reached. So this is not a deferral — it is the ordering
of a two-repo fix whose second half is already written, pushed, and re-running.
Scoping this PR's claim to
[vm-build]is the honest reading of what the diff does.Rulebook compliance
why the builder legitimately already has those repos. The "wrong base" hypothesis was
considered and rejected with evidence: the base is right, and changing it would reintroduce
the mixed-snapshot divergence it exists to prevent.
(reintroduces the mixed snapshot), and allowlist the two error lines in the bed (hides a
real misconfiguration for every future distro whose builder shares its base).
invisible.
cat >>is replaced, not kept besidethe filter.
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(after fix(pacstrap): drop a dangling template field that broke every bootstrap VM build #493 merged); no force-push, no direct push tomain.filter exercised in isolation against the case that would break cachyos.
pacman.conf;the point of the change is that it keeps what it already had.
task build:binarystamped charly fromthis branch.
Change classification
charly vm build omarchy-pacstrap-vmgoing from twoerror:lines to zero while still writing a 2.4 GB disk; thedisposable: truebed as the end-to-end gateanalysed on a live system— the before/after is measured on real builds, the filter is unit-proven on the case that would break cachyos, and the bed step this change fixes goes from FAIL to PASS. Deliberately not the tier above: the bed as a whole is still red on two unrelated guest-side defects being fixed indistro-omarchy, so no complete-bed claim is made hereAssisted-by: Claude Code claude-opus-4-6-20260401 (analysed on a live system)