Repository navigation
chore: bump to go 1.27 - #14954
Closed
sipsma wants to merge 6 commits into
Closed
chore: bump to go 1.27#14954sipsma wants to merge 6 commits into
sipsma wants to merge 6 commits into
Conversation
sipsma
force-pushed
the
sipsma/go-1.27
branch
from
October 30, 2026 00:52
630f463 to
4341e06
Compare
Go 1.27's compiler writes package export data in a format (unified IR
version 5) that golang.org/x/tools before v0.50.0 cannot decode. Every
tool that loads type information through go/packages fails on it,
reading even the standard library ("internal error in importing
image/color (cannot decode ...)"). Here that is the Go SDK's codegen,
which loads a module's packages before it generates code for it, and
moq, which `go generate` runs in dagql/idtui.
v0.50.0 reads every earlier version as well, so this changes nothing on
Go 1.26. It raises x/crypto, x/mod, x/net, x/sync, x/sys, x/term and
x/text to what it requires; go mod tidy also drops
github.com/opencontainers/cgroups, which nothing imports. The dev
modules that build against the root module are tidied to match.
Signed-off-by: Erik Sipsma <[email protected]>
The engine and CLI are built with Go 1.27, the engine ships golang:1.27-alpine for building Go SDK modules, and dagger/go's generation and tests run on Wolfi's go-1.27. The dev modules that pull a Go image take 1.27 as well. go.mod's go directive stays at 1.26.6: dagger/dagger's own dev modules read it and are built with the Go the running engine ships, which is 1.26 on every released engine, and that Go refuses a module that asks for 1.27. It can move once CI runs on an engine built from this change. Signed-off-by: Erik Sipsma <[email protected]>
protoc-gen-go is built with the generation base's Go, and Go 1.27 changes its output in two ways that don't change the code: gofmt no longer keeps an empty "//" line before an indented list in a comment, and compress/flate encodes differently, so the gzipped file descriptors have new bytes for the same descriptors. Signed-off-by: Erik Sipsma <[email protected]>
The x/tools bump needs golang.org/x/net v0.59.0, which deprecates http2.Transport and http2.Server.ServeConn in favor of net/http's own HTTP/2, so staticcheck reports SA1019 at each use. Behavior is unchanged; moving the engine client off them is a change of its own. Signed-off-by: Erik Sipsma <[email protected]>
estargz v0.18.2 requires the gzip footer it writes to be exactly 51
bytes. Go 1.27's compress/flate encodes it in 48, so compressing a layer
as eStargz panicked ("footer buffer = 48, not 51") and took the engine
down. v0.19.0 writes the footer itself (containerd/stargz-snapshotter
Signed-off-by: Erik Sipsma <[email protected]>
#2333). It requires klauspost/compress v1.20.1 and tar-split v0.12.3.
The engine sent a host import's include, exclude and follow-path
patterns twice: inside the single encoded options value, and again as
one gRPC header value per pattern. Since Go 1.27, an HTTP/2 server
accepts at most 500 header values per request by default, and when a
request over that limit spans several frames it closes the whole
connection. The CLI serves the session's attachables over that
connection, so reading a host directory with more than about 500
patterns ended the session ("http2: server connection error ...
PROTOCOL_ERROR", then "failed to sync").
Every CLI since #5415 reads the encoded value first, so the per-pattern
copies are dropped. Receiving them still works, for requests that come
straight from BuildKit.
Signed-off-by: Erik Sipsma <[email protected]>
sipsma
force-pushed
the
sipsma/go-1.27
branch
from
October 30, 2026 20:53
4341e06 to
81dc84e
Compare
Contributor
Author
|
Its commits moved into #15007, which now combines the engine's pending performance changes, to save CI runs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dagger's own builds move to Go 1.27:
golang:1.27-alpine, the image the engine uses to build Go SDK modules, so users' Go modules build with Go 1.27;golangmodule uses here for generation and tests;Building dagger's CLI with the dagger/go module, with the engine and the compiles both on Go 1.27 against both on 1.26, a cold first build took 0.97 s less: 25.26 s against 26.07 s, median of 7 runs on one 16-CPU machine. Edits took 0.26–0.35 s less, and building a second binary took 2.2 s less. The engine's CPU and peak memory were unchanged.
Three commits:
golang.org/x/toolsv0.47.0 → v0.50.0. Go 1.27 writes export data that x/tools before v0.50.0 cannot decode. Without this, every Go SDK module fails to load on an engine built with Go 1.27, because the SDK's codegen loads the module's packages throughgo/packages.moqingo generatefails the same way. The bump raises othergolang.org/xmodules to what it requires.go mod tidyalso dropsgithub.com/opencontainers/cgroups, which nothing imports.//line before indented comment lists. Itscompress/flateencodes differently, so the gzipped descriptors have new bytes; decompressed, they are identical.Three more commits, from what CI found on Go 1.27:
golang.org/x/netv0.59.0, which deprecates its HTTP/2 client and server in favor ofnet/http's. Staticcheck's SA1019 is suppressed at those uses; behavior is unchanged.compress/flatewrites 48, so compressing a layer as eStargz panicked and took the engine down. v0.19.0 writes the footer itself. It needsklauspost/compressv1.20.1 andtar-splitv0.12.3.TestHost/TestDirectoryManyPatternscovers it. A Go 1.27 CLI talking to an engine without this change still hits the limit.go.modstays atgo 1.26.6for now. The dev modules read it and are built with the Go of the engine that runs them. Released engines ship Go 1.26, which refuses a module that asks for 1.27. It can move once CI runs on an engine built from this change.Go 1.27's
compress/flatechange also means data the engine gzips with Go's standard library can get different bytes, and so a different digest, for unchanged content.