Skip to content

Cross-build the Go CLI in make and ship it beside the Bash CLI in the appliance image #4528

Backlog

Description

@pithead-architect

What's the problem

Nothing builds a Go binary into the appliance image. The launcher merged in #4214 execs go/bin/pithead beside the installed entry point when a piece selects Go, but no make target produces linux Go CLI binaries and no image path ships one; the ledger records "appliance build and boot, AMD64 execution" as not shown (pithead#4215).

What it impacts

Every piece that ships a binary, image build time and size, and any ability to exercise the Go side on an appliance.

How I found it

Split from pithead#4215. os/rootfs/Dockerfile builds docker-compose and cosign from pinned source in a digest-pinned golang:1.26.11-trixie gobuild stage with CGO_ENABLED=0, and ships the Bash CLI in /opt/pithead/; lib/pithead/00a-impl-launcher.sh (docs/dev/go-port/selection.md) looks for go/bin/pithead beside the entry point. No target builds go/cmd/pithead for linux.

How important is it

Medium-high: the first piece that flips its default needs it (the parent: "needed by the first piece"); Bash stays the default, so no separate release flip rides on it.

Acceptance criteria

  • A make target cross-builds the Go CLI for linux/amd64 and linux/arm64 with CGO off and version-stamped; go version <bin> shows the toolchain and the stamp on each output.
  • The image build places the host-architecture binary at /opt/pithead/go/bin/pithead with no module-fetch step in the image path (the module is stdlib-only; the toolchain is the pinned gobuild stage or the CI-pinned toolchain).
  • A rootfs build with the Go binary absent still succeeds (Bash-only builds still work).
  • A tier4-kvm boot run on the head passes with new registered assertions: the binary exists at /opt/pithead/go/bin/pithead and pithead status runs via Bash (table default unchanged).
  • The parent criterion is booting on both architectures with the binary present. If the image or the KVM lane cannot boot arm64 today (the Dockerfile installs linux-image-amd64/grub-efi-amd64; os/ and tests/os/ carry no arm64 path), quote the concrete refusal (job id / preflight line) and file the arch gap beside this issue rather than silently narrowing the criterion.

Possible solutions

Build the CLI natively per build platform inside the existing rootfs gobuild stage and COPY --from=gobuild it, reusing the compose/cosign pattern and the cross-build targets from go-port/3811; add a host make target running CGO_ENABLED=0 GOOS=linux GOARCH=<amd64|arm64> go build -trimpath -ldflags ...; if the Dockerfile is not built per architecture, stage the right binary into the rootfs build context the way os/rootfs/images/ is staged.

Parent: #4215

Worker brief: Test tier: tier4-kvm (phase boot), plus GitHub tiers 1-3 green.
Chunk 1/3 of pithead#4215 (Build and ship the Go CLI in the appliance image; umbrella #3811). Branch fresh from origin/develop-v2.1.0; PR targets develop-v2.1.0, opened as a draft at the first working commit.
Context: the launcher (lib/pithead/00a-impl-launcher.sh, docs docs/dev/go-port/selection.md) execs go/bin/pithead beside the entry point; on the appliance the entry point is /opt/pithead/pithead, so the binary's home is /opt/pithead/go/bin/pithead. The go/ module (stdlib-only; cmd/pithead follows the Go-side handoff contract) is introduced by #4220 — PR #4527 was open at split time. If go/ is not on the base when you start, do not duplicate the module: block on the first PR carrying it and merge the base once it lands.
Do: make target(s) for CGO-off, version-stamped linux amd64+arm64 builds; ship the host-architecture binary in the image via the existing digest-pinned golang gobuild stage (no new toolchain, no module downloads in the image path); the rootfs build must still pass with the binary absent; add boot-phase assertions (binary present, pithead status runs via Bash) registered where the KVM battery runs them (tests/os/phases/).
Constraints: do not touch the piece table (Bash stays default); no comments in code; run make lint-file-budget and make lint-pithead-build before submitting; submit only tier-4, through bin/bench-submit with --base develop-v2.1.0; paste bench-ci evidence <id>@<sha> blocks unedited; quote a red-without-the-change run where the criterion demands proof.

Activity

  1. added this to the v2.1.1 milestone on Nov 25, 2026
  2. added
    needs-triage
    size:M
    on Nov 25, 2026
  3. added
    bug
    on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds-triagesize:M

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions