Skip to content

fix(arch): --needed in the bootstrap, so it stops reinstalling curl - #481

Merged
github-actions[bot] merged 1 commit into
mainfrom
fix/arch-bootstrap-needed
Aug 30, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
fix/arch-bootstrap-needed

Conversation

@atrawog

@atrawog atrawog commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

The arch distro entity's container bootstrap ran

pacman-key --init && pacman -Syu --noconfirm

with no --needed. The base image already ships curl and ca-certificates at the
target version, so pacman reinstalled both on every single build of every Arch-family
image
:

warning: curl-8.21.0-1 is up to date -- reinstalling
warning: ca-certificates-20240618-1 is up to date -- reinstalling

Wasted work in the first layer of every build, and two warnings in every build log that
no allowlist claims — the existing pacman-needed-package-already-current rule covers
-- skipping, which is the message pacman prints with --needed.

Every file in the diff

File What changed
charly/charly.yml arch.distro.bootstrap.install_cmd gains --needed, with the measurement recorded inline

Why this is the right fix rather than an allowlist entry

--needed is the flag that makes a repeated install idempotent instead of a reinstall —
which is R4, and which the allowlist rule's own comment already says. Adding
-- reinstalling to the allowlist would have silenced the message while leaving the wasted
reinstall in place on every build.

Every other pac install path in charly already passes it: the generated install template
three hundred lines further down reads
pacman -Syu --noconfirm --needed{{range .Options}}…, and the cachyos bootstrap in the
next block has it too. arch was the outlier.

How tested

Measured on the exact base image the bootstrap runs against
(quay.io/archlinux/archlinux:base-20260719.0.558306), both ways:

$ podman run --rm quay.io/archlinux/archlinux:base-20260719.0.558306 sh -c '
    pacman-key --init >/dev/null 2>&1
    pacman -Syu --noconfirm curl ca-certificates 2>&1 | grep -cE "is up to date -- reinstalling"'
--- WITHOUT --needed (charly today) ---
2
$ podman run --rm quay.io/archlinux/archlinux:base-20260719.0.558306 sh -c '
    pacman-key --init >/dev/null 2>&1
    out=$(pacman -Syu --noconfirm --needed curl ca-certificates 2>&1)
    echo "reinstalling lines: $(printf "%s" "$out" | grep -cE "is up to date -- reinstalling")"
    echo "skipping lines:     $(printf "%s" "$out" | grep -cE "is up to date -- skipping")"
    echo "curl present:       $(command -v curl >/dev/null && echo yes)"'
--- WITH --needed (this fix) ---
reinstalling lines: 0
skipping lines:     2
curl present:       yes

2 reinstalls → 0, the two remaining lines are the -- skipping class that is
allowlisted, and curl is still present — so the fix removes the work without removing
the outcome. That last line matters: a --needed that skipped a package the bootstrap
actually needs would be a regression, and this asserts it does not.

How it was found

Not by reading the entity. By auditing a real bed's warning accounting in
.check/<bed>/<ts>/summary.yml, where each finding carries the allowlisted: rule ID that
claimed it. Two findings had no rule, and their text differed from the 23 that did by a
single word: reinstalling instead of skipping. Following that word back reached this
missing flag.

Rulebook compliance

  • R0 — skills first. /charly-internals:git-workflow.
  • R1 — RCA every anomaly. Two un-allowlisted warnings were root-caused to a missing flag
    rather than allowlisted. The tempting fix — adding -- reinstalling to the allowlist rule
    — would have hidden the symptom and kept the waste.
  • R2 — finish the whole cutover. One flag; there is no second half.
  • R3 — no duplication. The fix aligns arch with the install template and the cachyos
    bootstrap that already do this, rather than adding a third spelling.
  • R4 — no workarounds. --needed is precisely the idempotence flag R4 asks for.
  • R5 — delete legacy completely. N/A — one flag added; nothing removed.
  • R6 — preserve user work and Git safety. Feature branch off current main, PR-only, no
    force-push, no direct push to main, no hook bypass.
  • R7 — prove behavior, not compilation. Both runs execute the real command against the
    real base image and count real output, including the assertion that curl still arrives.
  • R8 — preserve emitted artifacts. N/A — no artifact.
  • R9 — binary equals source. N/A — the evidence is pacman's own output, not charly's.
  • R10 — fresh disposable proof. Each measurement runs in its own --rm container from
    the pinned base image, so neither can be contaminated by the other.
  • ADE / SDD / concurrency mandate. N/A — one flag in a distro entity.

Change classification

  • Change class: one flag in the arch distro entity's bootstrap. No Go, no schema.
  • Verification gate: the before/after measurement above, on the pinned base image.
  • Attribution tier: fully tested and validated — the changed command was executed live in
    both forms, and the outcome it must preserve was asserted.

Assisted-by: Claude Code claude-opus-5[1m] (fully tested and validated)

The arch distro entity's container bootstrap ran

  pacman-key --init && pacman -Syu --noconfirm

with no --needed. The base image already ships curl and ca-certificates
at the target version, so pacman REINSTALLED both on every single build
of every Arch-family image:

  warning: curl-8.21.0-1 is up to date -- reinstalling
  warning: ca-certificates-20240618-1 is up to date -- reinstalling

Wasted work in the first layer of every build, and two warnings in every
build log that no allowlist claims -- the existing
`pacman-needed-package-already-current` rule covers `-- skipping`, which
is the message pacman prints WITH --needed.

--needed is the flag that makes a repeated install idempotent instead of
a reinstall (R4). Every other pac install path in charly already passes
it, including the generated install template three hundred lines down
and the cachyos bootstrap in the next block. arch was the outlier.

Measured on the exact base image the bootstrap runs against:

  without --needed:  2 reinstalling, 0 skipping
  with --needed:     0 reinstalling, 2 skipping, curl still present

Claude-Session: https://claude.ai/code/session_01YKF2VLqeHHbrBDz8XftaD3
@github-actions

Copy link
Copy Markdown
Contributor

Review — PASS

Head SHA: c703cfa17f50 (branch: fix/arch-needed)

Security screen: PASS — single config-string change (--needed added to the arch bootstrap install_cmd); no secrets, exfiltration, scope mismatch, guardrail weakening, or supply-chain change. Description matches the diff exactly.

Checklist: All applicable rules PASS or NA.

  • A1/A2/A3 — Body fully accounts for the one file, supplies pasted before/after output, names the change-class gate (live command execution on the pinned base image), and the fully tested and validated tier is justified (the changed command executed live in both forms with the outcome asserted). Assisted-by: line present in the required form.
  • R1 — The two un-allowlisted reinstalling warnings are root-caused to the missing flag and eliminated by the fix (2 → 0, remaining lines are the allowlisted -- skipping class). No forbidden framing.
  • R2/R3/R4/R5 — No split, no duplication (aligns with the existing install template and cachyos bootstrap), --needed is the idempotence flag R4 asks for (not a workaround), nothing removed.
  • R10 — Disposable --rm containers from the pinned base image, pasted output internally consistent (2 reinstalls → 0, curl still present). Tool-limited: the body's claims about the cachyos block and install template are outside the diff and unverifiable here, but they are supporting context, not the core fix, and are not contradicted by the diff.
  • B16 placement — CORRECT: a config value in the arch distro entity's bootstrap; no core/sdk/candy layer issue.
  • B15 — Single atomic commit.

Verdict: PASS


ollama/deepseek-v4-flash — pi-review-action.

View action run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant