build: Pin GoReleaser and golangci-lint and check them first #57

Closed
opened 2026-10-10 21:47:02 +00:00 by mira · 1 comment
Collaborator

make build (Makefile:7-9) runs whatever goreleaser is on PATH, and make lint (17-18) whatever golangci-lint is installed, while CI lints with v2.13.2 (.gitea/workflows/test-pr.yaml:23-25). The release job uses goreleaser-action@master with version: 'latest' (release-tag.yaml:20-23) and setup-go@main (release-tag.yaml:17). Local lint and CI lint can disagree with no hint why.

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, test, test-race and lint depend on check-toolchain (snippet, with GORELEASER_VERSION ?= v2.18.3), extended with a golangci-lint check against GOLANGCI_LINT_VERSION ?= v2.14.0 (fix: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.14.0).
  • 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.
  • golangci-lint v2.14.0 locally and in CI (test-pr.yaml:25).
  • release-tag.yaml: goreleaser-action @master to @v6, version: v2.18.3, setup-go @main to @v5.

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 f9b89b5.

Model: Gemma 26B censored.

`make build` (Makefile:7-9) runs whatever `goreleaser` is on PATH, and `make lint` (17-18) whatever `golangci-lint` is installed, while CI lints with v2.13.2 (.gitea/workflows/test-pr.yaml:23-25). The release job uses `goreleaser-action@master` with `version: 'latest'` (release-tag.yaml:20-23) and `setup-go@main` (release-tag.yaml:17). Local lint and CI lint can disagree with no hint why. 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`, `test`, `test-race` and `lint` depend on `check-toolchain` (snippet, with `GORELEASER_VERSION ?= v2.18.3`), extended with a golangci-lint check against `GOLANGCI_LINT_VERSION ?= v2.14.0` (fix: `go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.14.0`). - 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. - golangci-lint v2.14.0 locally and in CI (test-pr.yaml:25). - release-tag.yaml: goreleaser-action `@master` to `@v6`, `version: v2.18.3`, setup-go `@main` to `@v5`. ## 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 f9b89b5. Model: Gemma 26B censored.
Author
Collaborator

Product call (Mira, 10/18): most of this landed via a811795 + 94958fe (in #58), but one real gap keeps it open. Landed: toolchain go1.27.2, check-toolchain before build/test/test-race, GoReleaser v2.18.3 pinned locally and in release-tag, golangci-lint v2.14.0 in CI, README note. Missing: the local golangci-lint check, which was the reason for this issue (local lint and CI lint disagreeing with no hint). Done means: GOLANGCI_LINT_VERSION ?= v2.14.0 in the Makefile, a check in the preflight that stops with found / required / go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.14.0, and make lint running the preflight before golangci-lint. Put the golangci-lint check in the shared forge-standards check-toolchain.sh too (env-gated, like GORELEASER_VERSION) so other repos can reuse it. One small PR, Eva reviews. Stays in the preflight drain for Ash.

Product call (Mira, 10/18): most of this landed via a811795 + 94958fe (in #58), but one real gap keeps it open. Landed: `toolchain go1.27.2`, check-toolchain before build/test/test-race, GoReleaser v2.18.3 pinned locally and in release-tag, golangci-lint v2.14.0 in CI, README note. Missing: the local golangci-lint check, which was the reason for this issue (local lint and CI lint disagreeing with no hint). Done means: `GOLANGCI_LINT_VERSION ?= v2.14.0` in the Makefile, a check in the preflight that stops with found / required / `go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.14.0`, and `make lint` running the preflight before golangci-lint. Put the golangci-lint check in the shared forge-standards check-toolchain.sh too (env-gated, like GORELEASER_VERSION) so other repos can reuse it. One small PR, Eva reviews. Stays in the preflight drain for Ash.
linus closed this issue 2026-10-18 14:56:50 +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/steamcache2#57
No description provided.