Repository navigation
feat(go): target v1.0.0-beta.27 - #105
Merged
Merged
Conversation
beta.27 is the newest release of dagger.io/dagger, and the default had stayed at beta.25 since beta.25 was the newest. The release in flight a scope can pin moves to beta.28. Signed-off-by: Erik Sipsma <[email protected]>
A module generated for beta.27, the default target, uses that release's naming and lists dagger/go as its entrypoint's dependency, and a beta.18 engine can't load either. Build the e2e engine from beta.27, and expect a new module's manifest to list dagger/go. The floor checks keep their own older engines. Signed-off-by: Erik Sipsma <[email protected]>
beta.27 reads a module's include in place of calling its sources function, so the sources check on the e2e engine no longer ran sources. Run it, and the manual floor checks, on beta.18 as before, with fixtures that target the floor release. Signed-off-by: Erik Sipsma <[email protected]>
No check uses it, and its locked commit doesn't load on beta.27, which runs a load check for every module of a workspace, so every check failed. Signed-off-by: Erik Sipsma <[email protected]>
From beta.26 the go build entrypoint writes its binary into a directory it declares for a platform, /tmp/dispatch/dispatch. And beta.27's built-in Go SDK compiles a module's packages to generate its code, so the runtime steps of the compatibility check get a main.go with package main, as a module on the Go runtime has. Signed-off-by: Erik Sipsma <[email protected]>
The ignore checks read the engine's upload spans from the collector of the CLI they run. That CLI ran nested in an exec, and since dagger/dagger #15100 a nested CLI no longer passes the engine's spans to its collector, so on beta.27 the checks saw no upload at all. Run them from engine-e2e, where the CLI is a client of the engine under test in its own session. The beta.18-24 driver goes with them: engine-e2e runs them on beta.27. Signed-off-by: Erik Sipsma <[email protected]>
A new module on the Go runtime in a directory that already has a go.mod got a starter that imports dagger/<name>/internal/dagger, whatever module path the go.mod declares, so the module didn't build. Render the starter with that go.mod, as a new entrypoint module's already is. Signed-off-by: Erik Sipsma <[email protected]>
This repository's .gitignore ignores dang.toml, so the git module the check builds had no entrypoint dang.toml, and the engine served it at its fallback release, beta.24. Code for beta.27 calls Directory.withPlatform, which that release lacks. A module commits the file, as the README says. Signed-off-by: Erik Sipsma <[email protected]>
A module with a +collection type builds its process from runtime sources that generation prepares beside it. Generation overlays them on the module context in the entrypoint, and could only find the context in a go build entrypoint, which mounts it twice. An entrypoint that builds with dagger/go reads the context as a workspace in dispatch and mounts it once in call, so generation refused it: every new module with a collection failed once dagger/go became the default build. Overlay the runtime sources on the workspace dagger/go builds from as well. Signed-off-by: Erik Sipsma <[email protected]>
…er/go can't build A generated entrypoint that builds its module's process with go build mounted the go-sdk-v2-mod and go-sdk-v2-build cache volumes for every target. The build is one exec, which the engine caches by its inputs, so the volumes only carry downloads and compiled packages from one build to the next outside that cache. A module that targets v1.0.0-beta.26 or later can build with dagger/go's per-package build instead. dagger/go's gobuild, which does that per-package build, is itself built with go build, so every per-package build used these volumes through it. Mount them only for a target older than dagger/go's floor, whose engines can't run the per-package build. Signed-off-by: Erik Sipsma <[email protected]>
An existing module kept go build when it was generated again, even for a target whose engines run dagger/go's per-package build, unless it set daggerGo = true. Only new modules got the per-package build, and now that go build mounts no Go cache volume for those targets, an existing module on it rebuilt every dependency after each edit. Unset daggerGo now selects dagger/go for every entrypoint module that targets v1.0.0-beta.26 or later, new or existing. daggerGo = false keeps go build. A module that targets an older release builds with go build, as before. The checks that migrate an existing module expect dagger/go; the checks of go build's compiler image set daggerGo = false. Signed-off-by: Erik Sipsma <[email protected]>
A module can keep its Go code in a subdirectory of the directory that holds its manifest, as "source": "runtime" says in dagger.json. Generating it with dangEntrypoint refused that source, so such a module could move to a Dang entrypoint only by making the subdirectory the module's root, which changes the reference the module is loaded by. Generation now keeps the layout. The go.mod, the generated Go files and the entrypoint go into the subdirectory, and dagger-module.toml stays in the module directory and names the entrypoint there, such as ./runtime/internal/dagger/entrypoint. The next generation finds the Go code from that path. The generated entrypoint builds and runs the subdirectory, and source maps name files from the module directory. A source outside the module directory is still refused. A module in a subdirectory whose build reads files outside the subdirectory is refused too: its include list would have to name paths from the module directory. Signed-off-by: Erik Sipsma <[email protected]>
A collection's runtime sources are written beside the entrypoint, in the module's Go code directory, but the entrypoint read them from the module directory. In a module whose Go code is in a subdirectory, it looked for them in the wrong place. The entrypoint now reads them from the Go code directory, as it builds the module. The docs also say what changes for a module's own code: the module directory, not the subdirectory, is now its source. Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
A module on the Go runtime takes its description from its package's doc comment. On the Dang entrypoint the description was dropped: the entrypoint returned only the module's types, and the doc comment reached neither the entrypoint nor the manifest. The generated entrypoint now returns the doc comment from a description member, which the engine reads as it reads prebuild and runtimeImage. An engine that doesn't read the member ignores it, and a module without a doc comment gets no member. Signed-off-by: Erik Sipsma <[email protected]>
Generation type-checks the entrypoint it writes with the entrypoint-contract helper, which checked it at its own Dang's current version. The engine evaluates the entrypoint at the version its dang.toml declares, 2.1. The two agreed while the helper's Dang was v2.1.4. The helper now moves to the Dang that the engine uses (683ac69d8a), whose interfaces are structural, so the helper accepts an entrypoint that raises a Dagger Error, as the engine does. That Dang refuses forms that 2.1 allows, such as a bare type pattern. So generation passes the helper the version it declares in dang.toml, and the helper checks the entrypoint at that version. Signed-off-by: Erik Sipsma <[email protected]>
On the Go runtime, a function that returns the error of a failed exec fails with that error's exit code, stdout and stderr: its process returns a Dagger Error that carries them. On the Dang entrypoint, the dispatcher reported only the error's message, and the entrypoint raised that. So the caller saw "exit code: 1" without the output. From v1.0.0-beta.28 on, the release that has dagger/dagger#15161, a failed function's dispatcher builds a Dagger Error as the Go runtime does: the message of the GraphQL error the function returned, and each of its extensions as a value. It then reports the Error's ID after the message. The entrypoint loads the Error by its ID and raises it, and the engine hands the caller that Error. Its traceparent still points at the exec that failed. If the Error can't be built, the entrypoint raises the message as before. Modules that target an older release keep the message, since their engines can't raise an Error. The e2e fixture's function fails with an exec that prints output and exits with 42. Its caller gets an exec error with that exit code and output. That needs an engine with #15161, which no release has, so the check runs from engine-e2e on a supplied engine source and isn't in CI yet. Signed-off-by: Erik Sipsma <[email protected]>
The Go runtime generates a module's bindings from the schema the engine serves module SDKs, which leaves out what only the engine's main client may call: host, engine, currentWorkspace, engineVolume, sshfsVolume and setSessionTitle. So module code that calls dag.Host doesn't compile. A module's unified bindings embedded all of dagger.io/dagger/core's Query instead, so the same code compiled. The unified bindings now forward each core field of the module schema's Query to core's Query, and nothing else. The list is the schema the engine serves, not a copy. Module code that calls dag.Host, dag.Engine or dag.CurrentWorkspace fails to compile with "undefined", as on the Go runtime, while the rest of core's Query is still offered. Signed-off-by: Erik Sipsma <[email protected]>
Unified module bindings forward each core field of the module schema's Query to dagger.io/dagger/core's Query. An engine can serve an older release's view fields added after that release: a beta.27 engine serves identifier, formatIdentifiers and namingDictionary in beta.18's view, which beta.18's library lacks. So a unified module that targets beta.18 failed to compile on that engine: "r.coreQuery.Identifier undefined". Generation now reads the methods of core.Query from the library the module builds with, the replacement's when go.mod replaces it. The bindings forward only the fields of the module schema that the library has. The e2e check generates such a module for beta.18, and it compiles. Signed-off-by: Erik Sipsma <[email protected]>
…lects Go applies a replacement of a module's selected version over one of every version, whichever comes first in go.mod. When go.mod had both for dagger.io/dagger, QueryMethods read the library of whichever came last. So unified bindings could forward fields the library Go builds with lacks, the failure the previous commit fixes. It now reads the replacement of the version when there is one, else the one of every version. Signed-off-by: Erik Sipsma <[email protected]>
Generation wrote the runtime image, and the Go image a go build entrypoint builds in, by the digest the session resolved their tags to. That digest is whatever the workspace's lock or the registry holds when generation runs: dagger/dagger's lock, go-sdk's and a workspace without an entry resolve alpine:3.22 to three different digests. A module generated in one place, or before a tag moved, was stale in another, and the stale check failed on changes that touched no module. versions.toml now pins both images by digest, and generated code changes only when it does. A module on another Go version than the default names that version's tag, which its build looks up. Signed-off-by: Erik Sipsma <[email protected]>
sipsma
added a commit
that referenced
this pull request
Nov 13, 2026
A measurement branch, not for merging: on go-sdk #105's head, it pins dagger/go #104 at 78c4039 (with the dependency call's package list passed as a file), so a test workload can be generated against it. Signed-off-by: Erik Sipsma <[email protected]>
sipsma
added a commit
that referenced
this pull request
Nov 13, 2026
A measurement branch, not for merging: on go-sdk #105's head, it pins dagger/go #104 at da4f104 (without the dependency call's package list passed as a file), so a test workload can be generated against it. Signed-off-by: Erik Sipsma <[email protected]>
eunomie
approved these changes
Nov 16, 2026
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.
The Go SDK has generated modules for v1.0.0-beta.25 by default since beta.25 was the newest release. beta.26 and beta.27 have shipped since. This moves the default to v1.0.0-beta.27.
What it changes for users
dagger.io/daggerv1.0.0-beta.27, and the release in flight a scope can pin moves to beta.28.daggerGo = false. A module that targets an older release builds withgo build, as before.go buildmounts Go cache volumes only where it must. The plain build mountsgo-sdk-v2-modandgo-sdk-v2-buildonly for targets older than beta.26, whose engines can't run the per-package build.dagger.io/daggeralready compiled, at the Go SDK's default target. Once dagger/dagger pins this SDK, a new module's first call on a fresh engine no longer compilesdagger.io/dagger,dagger.io/dagger/coreanddagger.io/dagger/engineconn.dagger check -lof dagger/dagger didn't change.The end-to-end checks
A beta.18 engine can't load what beta.27 generates: the manifest lists dagger/go as the entrypoint's dependency, and the code uses beta.26's naming. So:
includeinstead of calling itssourcesfunction. The beta.12, beta.16 and beta.17 floor engines are unchanged.Running the suite on beta.27 also needed:
dang.toml. This repository's.gitignoreignoresdang.toml, so the check's git module was served at the engine's fallback release, which lacksDirectory.withPlatform.go buildentrypoint writes its binary to/tmp/dispatch/dispatchfrom beta.26 on. And beta.27's built-in Go SDK compiles a module's packages to generate its code, so a test module on the Go runtime needs amain.gowithpackage main.A fix it turned up
A new module on the Go runtime, in a directory that already has a
go.mod, got a starter importingdagger/<name>/internal/daggerinstead of thatgo.mod's module path, so it didn't build. The starter now uses thego.mod, as a new entrypoint module's already did. beta.27 shows the failure because it compiles the module during code generation.A module with a
+collectiontype also failed to generate under dagger/go. Generation overlays the collection's runtime sources on the module context in the entrypoint, and it could only find the context in ago buildentrypoint. It now overlays them on the workspace dagger/go builds from too, with a unit test and an e2e check for a new collection module.A module's Go code in a subdirectory
Generation keeps a module's Go code in a subdirectory of its directory, as dagger.json's source names it; the manifest stays in the module directory and names the entrypoint there. That is what dagger/dagger's PHP, Java and Elixir runtimes need to move to this SDK. For such a module,
CurrentModule().Source()reads are relative to the module directory, as docs/outside-files.md describes.Matching what the built-in Go SDK passes on
descriptionmember. Engines without dagger/dagger's matching change ignore it.dag.Host(),dag.Engine(),dag.CurrentWorkspace()and the others). They forward only the core fields the module's owndagger.io/daggerhas.Pinned images
A generated
go buildentrypoint names its runtime and Go images by digests pinned inversions.toml(runtimeImage,goImage), not by whatever the generating session's lock or registry resolved, so two machines generate the same code for the same module. A module on a Go version other than the default names that version's tag.Known limitation
A module that is itself named
gocan't build with the per-package build on beta.27 engines; until the engine fix ships it needsdaggerGo = false. In its entrypoint,goresolves to the module itself instead of dagger/go. The fix is in the engine and reaches users with the next engine release.