From 6632ea41dd5bb748148ce01491731f5d78d9701c Mon Sep 17 00:00:00 2001 From: Alphaeus Mote Date: Wed, 2 Sep 2026 09:41:29 -0400 Subject: [PATCH] ci: pin GOROOT to the active go binary The runner's stale global GOROOT pointed 'go' 1.25.0 at a 1.26.4 compile tool ('compile ... does not match go tool version'), which go clean -cache could not fix. Resolve GOROOT from the active go binary and export it for all steps, with diagnostics, then clean the cache under that GOROOT. Co-Authored-By: Claude Opus 4.8 --- .gitea/workflows/release.yml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index b42315b..f39e81d 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -98,12 +98,23 @@ jobs: # a matching toolchain and never needs to download one. go-version-file: backend/go.mod - # The self-hosted runner keeps a persistent Go build cache. A prior run - # under a different (auto-downloaded) toolchain left objects that mismatch - # the pinned toolchain ("compile: version ... does not match go tool - # version"). Clear it so everything recompiles with this toolchain. - - name: Clean Go build cache - run: go clean -cache + # The self-hosted runner has a stale global GOROOT pointing at a different + # Go install, so `go` (from setup-go) invokes a mismatched `compile` + # ("compile: version ... does not match go tool version"). Pin GOROOT to + # the directory of the active go binary for all later steps, and clear the + # persistent build cache so objects recompile with this toolchain. + - name: Align Go toolchain + run: | + set -euo pipefail + GO_BIN="$(command -v go)" + GR="$(cd "$(dirname "$GO_BIN")/.." && pwd)" + echo "active go: $GO_BIN" + echo "env GOROOT (before): ${GOROOT:-unset}" + echo "resolved GOROOT: $GR" + echo "GOROOT=$GR" >> "$GITHUB_ENV" + GOROOT="$GR" go version + GOROOT="$GR" go tool compile -V || true + GOROOT="$GR" go clean -cache - name: Setup Node uses: actions/setup-node@v4 -- 2.52.0