From d33ed80c41636ecd576bb0e9b99aa8465bb4f153 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Fri, 4 Sep 2026 15:02:59 +0000 Subject: [PATCH] tools/bump: read the toolchain with GOTOOLCHAIN=local go env GOVERSION reports the toolchain the go command switched to, so a go.mod that had outrun nixpkgs read back as a nixpkgs that had caught up, and checkToolchain compared 1.27.1 against itself. --- tools/bump/flake.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/bump/flake.go b/tools/bump/flake.go index 33049229..4177831c 100644 --- a/tools/bump/flake.go +++ b/tools/bump/flake.go @@ -119,9 +119,14 @@ func gateFlake(ctx context.Context, r *repo) error { return err } -// goVersion is the Go the devShell now provides, without the "go" prefix. +// goVersion is the Go the devShell provides, without the "go" prefix. +// +// GOTOOLCHAIN=local is not optional here. Left to itself the go command +// switches to whatever go.mod asks for and reports that instead, so a go.mod +// that has outrun nixpkgs looks like a nixpkgs that has caught up, and the one +// check that would have noticed compares a value against itself. func goVersion(ctx context.Context, r *repo) (string, error) { - out, err := r.nixRun(ctx, "go", "env", "GOVERSION") + out, err := r.nixRun(ctx, "env", "GOTOOLCHAIN=local", "go", "env", "GOVERSION") if err != nil { return "", err }