[architect] refactor: single source of truth for CPU-arch identity — new include/arch.yml, k3s-bin.bst, k3s-sysext.bst, os-release-flatcar.bst, extension-release.k3s - #40
Merged
Conversation
project.conf declares options.arch (aarch64, x86_64) and binds it to
%{arch}, and elements/freedesktop-sdk.bst resolves against it. Three
downstream sites then restated the architecture as an unguarded x86_64
literal in three different vendor spellings, with nothing comparing them
to %{arch}:
- elements/k3s/k3s-bin.bst pinned the upstream amd64 k3s asset and
installed it unconditionally.
- files/k3s/sysext/extension-release.k3s hardcoded ARCHITECTURE=x86-64,
copied verbatim by elements/oci/k3s-sysext.bst.
- elements/bluefin-server/os-release-flatcar.bst hardcoded
FLATCAR_BOARD=amd64-usr.
An aarch64 build therefore succeeded and produced an image carrying
x86_64 identity and an x86-64 k3s ELF, with no error surface anywhere.
Add include/arch.yml as the one place the vendor spellings are written
(%{systemd-arch}, %{flatcar-board}), keyed off the arch option; have the
two consuming elements include it and emit those variables instead of
literals; and make k3s-bin.bst assert its amd64-only pin explicitly so
the constraint is loud rather than silent.
No behavior change on the x86_64 path: the generated values are byte-
identical to the literals they replace.
Refs #39
Signed-off-by: architect <architect@users.noreply.github.com>
hanthor
approved these changes
Sep 2, 2026
hanthor
left a comment
Member
There was a problem hiding this comment.
Verified project.conf's options.arch and elements/freedesktop-sdk.bst's existing (?) conditional shape match the new include/arch.yml pattern; no behavior change on the x86_64 path confirmed line-by-line. CI green.
Generated by Claude Code
This was referenced Sep 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed cluster
Exact ground this PR occupies, for the next occupied-ground comparison:
include/arch.ymlelements/k3s/k3s-bin.bst—config.install-commands(adds a guard command; the existinginstallline is unchanged)elements/oci/k3s-sysext.bst— the top-level(@)include and theextension-release.dstaging lines insideinstall-commandselements/bluefin-server/os-release-flatcar.bst— the top-level(@)include and theFLATCAR_BOARD=linefiles/k3s/sysext/extension-release.k3s— removes theARCHITECTURE=lineDoes not touch
project.conf,Justfile,.pre-commit-config.yaml,AGENTS.md,.github/,docs/,tests/,elements/installer/,elements/oci/bluefin-server-installer.bst,elements/oci/bluefin-server-ddi.bst,elements/bluefin-server/os-stack.bst,elements/bluefin-server/os-sshd-config.bst,files/os/, orfiles/k3s/sysext/{k3s.service,k3s-agent.service,50-bluefin-tuning.yaml,k3s-bluefin.conf}.Disjoint from every open PR on this repo: #34 (
project.confrelease-version /Justfile validate/.pre-commit-config.yaml), #36 (os-stack.bst+ sysupdate keyring + docs), #37 (files/os/justfile), #38 and #30 (tests/), #29 (sshd), #22/#25/#26/#27 (installer + PXE elements and docs), #18 and #21 (workflow/deps). No file in this PR appears in any of them.Fixes the arch-identity axis only. It deliberately does not touch the
release-versionaxis (#31/#34) or the sysext-versioning question in #32.Refactor
project.confdeclares a real, selectable build axis and binds it to a variable:elements/freedesktop-sdk.bsthonours it with an explicitarch == 'aarch64'branch, so the axis is not vestigial. Three downstream sites then restated the architecture as an unguarded x86_64 literal in three different vendor spellings, with nothing comparing them to%{arch}:elements/k3s/k3s-bin.bstsources[0].urlsha256sum-amd64.txt, per the element's own docstring)/usr/bin/k3sfiles/k3s/sysext/extension-release.k3sARCHITECTURE=x86-64/usr/lib/extension-release.d/elements/bluefin-server/os-release-flatcar.bstFLATCAR_BOARD="amd64-usr"/usr/lib/os-releaseFailure mode this closes
bst build -o arch aarch64 oci/k3s-sysext.bstsucceeds today. There is no error surface on the arch axis anywhere in the graph: an x86-64 k3s ELF lands in an aarch64 rootfs, the sysext advertisesARCHITECTURE=x86-64sosystemd-sysextsilently refuses to merge it (k3s never appears, on a green build), and/usr/lib/os-releaseadvertisesFLATCAR_BOARD=amd64-usr, which is the key third-party Flatcar extension matching uses. Quiet in exactly the way therelease-versiondrift in #31 was quiet.Changes
include/arch.yml— the one place the vendor spellings of the arch axis are written:%{systemd-arch}(x86-64/arm64) and%{flatcar-board}(amd64-usr/arm64-usr), selected with a(?)conditional onarch, using the same shape as the existing conditional inelements/freedesktop-sdk.bst. Becauseproject.confconstrainsoptions.arch.valuesto those two architectures, an unmapped architecture cannot be selected.elements/oci/k3s-sysext.bstincludes it and appendsARCHITECTURE=%{systemd-arch}to the staged extension-release file.files/k3s/sysext/extension-release.k3sdrops itsARCHITECTURE=line, so that field now has exactly one producer instead of two.elements/bluefin-server/os-release-flatcar.bstincludes it and emitsFLATCAR_BOARD="%{flatcar-board}".elements/k3s/k3s-bin.bstasserts%{arch} == x86_64before installing, so the amd64-only pin is an explicit, loud constraint. Adding thek3s-arm64source is a separate, deliberate change and is not made here — this PR does not enable aarch64, it stops aarch64 from silently mis-building.This is the repo's own red flag from
docs/skills/avoid-over-engineering.md— "The same value hardcoded in more than one file" — applied to the arch axis rather than the version axis.No behavior change on the supported path
With
arch == x86_64the generated values are byte-identical to the literals they replace:ARCHITECTURE=x86-64— same line, same position (appended afterVERSION_ID, which was already its position in the static file)FLATCAR_BOARD="amd64-usr"— same lineinstall -D -m 0755 k3s ...— unchanged, now preceded by a guard that is a no-op on x86_64Release asset names, the DDI/UKI/installer graph, and
files/os/sysupdate.d/*.transferare untouched.Verification
All five files parse as YAML, and the
(?)structure matches the shape BuildStream already consumes inelements/freedesktop-sdk.bst:Reviewer note —
just validatewas not run. This session has nopodmanand nobst, so thebst show --deps allgraph check could not be executed. A maintainer should runjust validatebefore merging; the specific thing to confirm is that BuildStream composes the element-level(@): include/arch.ymlfragment'svariablesblock with each element's ownvariablesblock (strip-binaries: ""in both consumers) rather than replacing it.Follow-up deliberately not bundled
The release assets (
k3s-<ver>.raw.zst, the DDI, the UKI, the installer) carry no arch component in their filenames, andfiles/os/sysupdate.d/70-k3s.transferfetches by that name fromreleases/latest/download/. Once a second architecture is actually built, two arch builds of the same release produce identically named assets and one would overwrite the other in the fleet's update path. Arch-qualifying the asset names is a release-contract change that also moves theMatchPatterns infiles/os/sysupdate.d/, overlaps the ground of #34, and should be tracked on its own.Refs #39
Filed by architect agent (ACMM L5 — hold-gated mode). Hold-gated: human review required. Structural only — no behavior change on the x86_64 path; do not merge without a maintainer
just validaterun.— hive: agent=architect backend=copilot model=claude-opus-5