build: Check Go and Node before building and move Docker to Alpine 3.24 #21

Closed
opened 2026-10-10 21:47:01 +00:00 by mira · 0 comments
Collaborator

make build (Makefile:31) runs ui-build (39) with npm and then Go, but nothing checks either. CI pins Node 24 (.gitea/workflows/ci.yaml:27-29, 59-61; release.yaml:62-64); locally there's no .nvmrc, so a Node 26 machine builds the UI with a different npm and lockfile behavior. The runtime image is alpine:3.20 (Dockerfile:30), which went EOL on 2026-04-01, and the builder is the floating golang:1.27-alpine (Dockerfile:17).

Justin's forge rule (2026-10-10): any toolchain that can only have one version installed at a time gets a preflight in the build. On a mismatch the build stops before doing anything, says what it found and what's required, and prints the exact fix. Standard and snippets: https://git.s1d3sw1ped.com/s1d3sw1ped/forge-standards/src/branch/master/forge-toolchain.md (preflight script: https://git.s1d3sw1ped.com/s1d3sw1ped/forge-standards/raw/branch/master/check-toolchain.sh). It follows the design in s1d3sw1ped/AI-Phone#322.

What to do

  • Make build, ui-build, ui and run depend on check-toolchain (snippet). Add .nvmrc with 24. Run the script in CI after the setup steps.
  • The preflight also fails if go.mod's go, toolchain or wails lines differ from HEAD (a silent rewrite), when the repo has a go.mod.
  • Add a line to the README's build section: what's checked and how to fix a mismatch.

Align with the forge standard in the same PR (all patch/minor or CI-only):

  • Add toolchain go1.27.2 under the go 1.27.0 line in go.mod (go.mod:3), so everyone builds on the same patch release and Go fetches it if the local one is older.
  • Add .nvmrc with 24.
  • Dockerfile:17 to golang:1.27.2-alpine3.24 and Dockerfile:30 to alpine:3.24. Dockerfile:3 stays node:24-alpine.

Acceptance

  • With a mismatched toolchain, the build stops before doing any work and prints found, required and the fix command. Nothing in the tree changes (git status is clean).
  • With the right toolchain, every build target works as before.
  • Editing a pinned go.mod line away from HEAD is caught.
  • CI passes and runs the preflight.

Out of scope

Major bumps of the CI actions (setup-go v7, setup-node v7, checkout v7, goreleaser-action v7, golangci-lint-action v9): stay on the current standard here; they're being piloted in s1d3sw1ped/vulture#17 first. Node stays on 24 (recheck in November, after 26 becomes LTS on 2026-10-28).

Handoff

One PR against the default branch. Ask Eva for review and don't merge it yourself. If it gets in the way, git revert the merge; nothing else to undo. Line refs are the default branch at 4054ea2.

Model: Gemma 26B censored.

`make build` (Makefile:31) runs `ui-build` (39) with npm and then Go, but nothing checks either. CI pins Node 24 (.gitea/workflows/ci.yaml:27-29, 59-61; release.yaml:62-64); locally there's no .nvmrc, so a Node 26 machine builds the UI with a different npm and lockfile behavior. The runtime image is alpine:3.20 (Dockerfile:30), which went EOL on 2026-04-01, and the builder is the floating golang:1.27-alpine (Dockerfile:17). Justin's forge rule (2026-10-10): any toolchain that can only have one version installed at a time gets a preflight in the build. On a mismatch the build stops before doing anything, says what it found and what's required, and prints the exact fix. Standard and snippets: https://git.s1d3sw1ped.com/s1d3sw1ped/forge-standards/src/branch/master/forge-toolchain.md (preflight script: https://git.s1d3sw1ped.com/s1d3sw1ped/forge-standards/raw/branch/master/check-toolchain.sh). It follows the design in s1d3sw1ped/AI-Phone#322. ## What to do - Make `build`, `ui-build`, `ui` and `run` depend on `check-toolchain` (snippet). Add `.nvmrc` with `24`. Run the script in CI after the setup steps. - The preflight also fails if go.mod's go, toolchain or wails lines differ from HEAD (a silent rewrite), when the repo has a go.mod. - Add a line to the README's build section: what's checked and how to fix a mismatch. Align with the forge standard in the same PR (all patch/minor or CI-only): - Add `toolchain go1.27.2` under the `go 1.27.0` line in go.mod (go.mod:3), so everyone builds on the same patch release and Go fetches it if the local one is older. - Add `.nvmrc` with `24`. - Dockerfile:17 to `golang:1.27.2-alpine3.24` and Dockerfile:30 to `alpine:3.24`. Dockerfile:3 stays `node:24-alpine`. ## Acceptance - [ ] With a mismatched toolchain, the build stops before doing any work and prints found, required and the fix command. Nothing in the tree changes (`git status` is clean). - [ ] With the right toolchain, every build target works as before. - [ ] Editing a pinned go.mod line away from HEAD is caught. - [ ] CI passes and runs the preflight. ## Out of scope Major bumps of the CI actions (setup-go v7, setup-node v7, checkout v7, goreleaser-action v7, golangci-lint-action v9): stay on the current standard here; they're being piloted in s1d3sw1ped/vulture#17 first. Node stays on 24 (recheck in November, after 26 becomes LTS on 2026-10-28). ## Handoff One PR against the default branch. Ask Eva for review and don't merge it yourself. If it gets in the way, git revert the merge; nothing else to undo. Line refs are the default branch at 4054ea2. Model: Gemma 26B censored.
linus closed this issue 2026-10-18 15:04:08 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
s1d3sw1ped/helix-proxy#21
No description provided.