Skip to content

bump go 1.27 - #13

Open
mzihlmann wants to merge 1 commit into
mainfrom
toolchain-1.27
Open

bump go 1.27#13
mzihlmann wants to merge 1 commit into
mainfrom
toolchain-1.27

Conversation

@mzihlmann

@mzihlmann mzihlmann commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Warning

Blocked on golangci-lint, see below. Parked as a draft until that clears, the change itself is four lines.

The go directive stays at 1.26.7, so kaniko keeps building on 1.26.7 and is not dragged into the flate encoder change it deferred to its next minor. Only CI moves, setup-go installs 1.27 explicitly instead of reading the version out of go.mod.

Why not a toolchain directive

That was the first attempt and it works: setup-go v7 picks up toolchain go1.27.0 from go.mod (Setup go version spec 1.27.0, go version go1.27.0), and local builds follow it too, so CI and developers match. It also breaks the lint job.

Error: can't load config: the Go language version (go1.26) used to build golangci-lint
is lower than the targeted Go version (1.27.0)

Why the workflow route does not fix that either

Pinning in the workflows keeps the module targeting 1.26.7, which gets past the check above, but golangci-lint still has to type check the 1.27 standard library and cannot:

panic: file requires newer Go version go1.27 (application built with go1.26)

On the runner it surfaces as the precise cause, 1.27's generic methods, which the standard library itself now uses:

/opt/hostedtoolcache/go/1.27.0/x64/src/math/rand/v2/rand.go:213:17:
    method must have no type parameters (typecheck)
/opt/hostedtoolcache/go/1.27.0/x64/src/crypto/internal/randutil/randutil.go:21:5:
    undefined: rand (typecheck)

math/rand/v2 declares (*Rand) N[Int intType](Int) Int, a method with its own type parameters, and a go/types from 1.26 rejects that outright. crypto/internal/randutil imports it, so everything touching crypto fails to typecheck. There is no configuration that avoids this.

No golangci-lint release can do it yet. Every recent tag is built with 1.26 or older:

release go directive
v2.13.2 go 1.26.0
v2.13.1 go 1.26.0
v2.13.0 go 1.26.0
v2.12.2 (pinned here) go 1.25.0

So this waits for a golangci-lint built with 1.27. The alternative is splitting lint onto its own setup-go at 1.26 while tests and releases run 1.27, which means linting different language semantics than we ship, and permanent CI complexity for a temporary external constraint. Not worth it for a four line change.

What 1.27 is for

The removal of the GODEBUG escape hatches that could put weak crypto back: tlsrsakex, tls3des, tls10server and tlsunsafeekm are gone, so RSA key exchange, 3DES and a TLS 1.0 server cannot be re-enabled from the environment any more. Also ML-KEM1024 and ML-DSA in TLS 1.3 and x509, which nothing needs yet but is where azure will go. The faster small allocations are irrelevant, we exec, make two round trips and exit.

Costs

  • the released binary grows 328K, 9.1M to 9.5M stripped, measured with the goreleaser flags CGO_ENABLED=0 -ldflags="-s -w"
  • 1.27 requires macOS 13 Ventura, so the darwin_amd64 and darwin_arm64 builds stop running on macOS 12. This belongs in the release notes.
  • a local build no longer matches a release artifact unless the developer also runs 1.27, which is what the toolchain directive would have fixed

Language features stay gated at 1.26.7 by the go directive, only the standard library comes from 1.27, so nothing here can start depending on 1.27 syntax without breaking the floor deliberately.

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 36 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a72b991e-695d-4d91-b1c9-b47673d23ca5

📥 Commits

Reviewing files that changed from the base of the PR and between b8b3c36 and 114d873.

📒 Files selected for processing (4)
  • .github/workflows/build.yaml
  • .github/workflows/nightly-vulnerability-scan.yaml
  • .github/workflows/release.yaml
  • .github/workflows/unit-tests.yaml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mzihlmann mzihlmann changed the title Build with go 1.27 without raising the floor for consumers bump go 1.27 Aug 31, 2026
@mzihlmann
mzihlmann marked this pull request as ready for review August 31, 2026 11:39
The go directive stays at 1.26.7, so kaniko keeps building on 1.26.7 and is not
dragged into the flate encoder change it deferred to its next minor. Only CI
moves, setup-go installs 1.27 explicitly instead of reading the version out of
go.mod.

A toolchain directive would have been the tidier way to say this, and it does
work, setup-go picks it up and local builds follow it too. It also breaks the
lint job: golangci-lint v2.12.2 is itself built with go 1.26 and refuses a module
that targets anything newer, "the Go language version (go1.26) used to build
golangci-lint is lower than the targeted Go version (1.27.0)". Pinning in the
workflows keeps the module targeting 1.26.7, which golangci-lint accepts, while
the compiler that produces the binaries is 1.27.

What 1.27 buys a binary whose job is carrying credentials over TLS is the removal
of the GODEBUG escape hatches that could put weak crypto back: tlsrsakex,
tls3des, tls10server and tlsunsafeekm are gone, so RSA key exchange, 3DES and a
TLS 1.0 server cannot be re-enabled from the environment any more. It also brings
ML-KEM1024 and ML-DSA in TLS 1.3 and x509, which nothing needs yet but is where
azure will go.

Two costs. The released binary grows 328K, 9.1M to 9.5M stripped. And 1.27
requires macOS 13, so the darwin builds no longer run on macOS 12, which needs to
be in the release notes rather than arriving unannounced.

Language features stay gated at 1.26.7 by the go directive, only the standard
library comes from 1.27, so nothing here can start depending on 1.27 syntax
without breaking the floor deliberately. The flip side is that a local build no
longer matches a release artifact unless the developer also runs 1.27.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant