1 Commits
Author SHA1 Message Date
Pavel GriaznovandClaude Fable 5 4d15cb7eed chore(deps): bump golang.org/x/net to v0.58.0 to fix build on Go 1.27+ (#1787)
Symptom: building gatus (v5.36.0 and master) with Go 1.27.0 fails on
every platform with:

  # google.golang.org/grpc/internal/transport
  google.golang.org/grpc@v1.81.1/internal/transport/handler_server.go:271:18:
      undefined: http2.TrailerPrefix

Root cause: golang.org/x/net v0.54.0 (indirect dependency, pulled in via
grpc) started switching its http2 package to a shim that delegates to
the standard library's HTTP/2 server when built with Go >= 1.27. The
legacy implementation in http2/server.go, which declares the exported
const TrailerPrefix, is guarded by the build constraint
"!(go1.27 && !http2legacy)", so under Go 1.27+ it is excluded and
replaced by http2/server_wrap.go ("go1.27 && !http2legacy"). The
wrap-mode file set in v0.54.0 forgot to declare TrailerPrefix, so any
importer referencing http2.TrailerPrefix no longer compiles; grpc
v1.81.1 references it in internal/transport/handler_server.go:271.

The failure is Go-version-specific, not architecture-specific: it
reproduces identically on a linux/amd64 host build and on
GOOS=linux GOARCH=arm GOARM=7 and GOARCH=arm64 cross builds (it was
originally reported from a linux/arm SBC, which is incidental). Go 1.26
and older are unaffected because the go1.27 build tag is not set there
and the legacy implementation still compiles.

Fix: x/net v0.55.0 moved TrailerPrefix to http2/server_common.go, which
builds in both legacy and wrap mode, restoring the exported API. This
commit bumps golang.org/x/net to the current latest, v0.58.0, via
"go get golang.org/x/net@latest && go mod tidy", which also lifts the
sibling golang.org/x/* modules (crypto, mod, sync, sys, text, tools) to
their matching release tags. No grpc bump is required: v1.81.1 compiles
fine once the symbol exists again. go.mod/go.sum only, no code changes.

Verification:
- Go 1.27.0 (GOTOOLCHAIN=local): go build ./..., go vet ./... and
  go test ./... pass on linux/amd64; CGO_ENABLED=0 cross builds for
  GOOS=linux GOARCH=arm GOARM=7 and GOOS=linux GOARCH=arm64 succeed.
  Before this change, all of the above failed with the error quoted at
  the top.
- Go 1.26.3: go build ./... and go test ./... still pass, so older
  toolchains keep working.

This commit was prepared by an AI agent (Claude Fable 5, model id
claude-fable-5).

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-27 17:05:18 -04:00