Repository navigation
Build dagger/dagger's Go modules with the per-package build, on Go 1.27 - #15143
Merged
Merged
Conversation
sipsma
force-pushed
the
sipsma/go-modules-per-package-build
branch
from
November 12, 2026 01:39
7ee58b1 to
4b1cba7
Compare
sipsma
marked this pull request as ready for review
November 12, 2026 18:46
sipsma
force-pushed
the
sipsma/go-modules-per-package-build
branch
from
November 13, 2026 00:25
c5eb30a to
4e68465
Compare
grouville
approved these changes
Nov 13, 2026
sipsma
force-pushed
the
sipsma/go-modules-per-package-build
branch
from
November 14, 2026 07:44
ebe31b1 to
7c26c79
Compare
sipsma
force-pushed
the
sipsma/go-modules-per-package-build
branch
from
November 17, 2026 18:10
5d25fb9 to
3e8f4d2
Compare
sipsma
force-pushed
the
sipsma/go-modules-per-package-build
branch
from
November 17, 2026 19:13
3e8f4d2 to
18ec659
Compare
Put every Go module of the workspace on go 1.27, the engine's Go version, and have the Go SDK build the modules with a Dang entrypoint with dagger/go (daggerGo), so their builds are the per-package builds an engine image pre-warms instead of one go build each from an empty cache. daggerGo needs a module that targets Dagger v1.0.0-beta.26 or later, since older manifests can't list the entrypoint's dependencies, and v1.0.0-beta.26 is the newest target the pinned Go SDK generates for. So those modules now target it, and need that engine or later. At that target, a dependency module's object names follow the engine's identifier casing: callers of cli-dev use CLIDevBinaryOpts and the like. Regenerated with dagger generate "dag://?generator=go-sdk/generate"; a second run changes nothing. Signed-off-by: Erik Sipsma <[email protected]>
Called from another module, cli-dev's default source was the files its manifest includes, without cmd/dagger, so release, engine-dev's engine image and its test container passed cli-dev a source, filtered with a copy of cli-dev's ignore list. The engine now reads the default from the directory cli-dev was loaded from, so drop those sources and release's copy of the list. engine-dev's client CLI keeps its source: it builds the CLI from engine-dev's own source, which can be another ref, as it did before. This needs an engine that reads a directory module's default paths from the directory it came from. On an older engine, cli-dev's default source lacks cmd/dagger again. Signed-off-by: Erik Sipsma <[email protected]>
release passed docs-dev its source, and php-client-dev and python-client-dev their workspace directory, each filtered with a copy of the module's ignore list, because, called from release, their defaults held only the module's own files: what each module's manifest includes. The engine now reads those defaults from the directory each module was loaded from, so drop the passes and the copied lists with them. This needs an engine that reads a directory module's default paths from the directory it came from. On an older engine, these defaults hold only each module's own files again. Signed-off-by: Erik Sipsma <[email protected]>
The go module is itself named go, and daggerGo lists dagger/go as its entrypoint's dependency under the same name, so its generated entrypoint's go.module(...) resolved to the module's own constructor instead of dagger/go. Called from another module, that constructor's workspace argument can't be filled in, and every check that builds the go module failed, such as rust-client's stale check. Keep this one module on go build, still on Go 1.27, until the name clash is fixed; the other modules keep dagger/go's per-package build. Signed-off-by: Erik Sipsma <[email protected]>
release now targets v1.0.0-beta.26, whose naming splits an argument's
acronyms into words, so the CLI flags of netlifyAPIURL, hexAPIKey and
hexAPIURL are --netlify-api-url, --hex-api-key and --hex-api-url rather
than --netlify-apiurl, --hex-apikey and --hex-apiurl. The mock publish
check and the publish workflow still passed the old spellings, and the
CLI refused them ("unknown flag: --netlify-apiurl").
Signed-off-by: Erik Sipsma <[email protected]>
IntrospectionJSON built a dev engine and CLI from source, started the engine as a service and introspected it, only to produce the API's introspection JSON. The introspect tool computes the same answer in-process from the core schema. Use it, and give the tool a default API view that matches the live path: the view this engine serves a client of its own version, such as its CLI. GraphqlSchema already ran the introspect tool, which never connected to the engine it bound; drop that binding too. Signed-off-by: Erik Sipsma <[email protected]>
The introspect tool dropped every type whose name starts with an underscore (__Schema, __Type, _DirectiveApplication, ...) from its introspection JSON. A live engine returns them, and the typescript client generator emits option types for their arguments, so a client generated from the tool's JSON differed from one generated against an engine. Keep them: the JSON is then what the engine returns. The schema command is unchanged, since the SDL formatter already skips them. Signed-off-by: Erik Sipsma <[email protected]>
The python and elixir client generators ran in their dev containers, which bind a dev engine service, so the engine was still built and started although generating reads only the introspection JSON. Run them in the base containers instead. Signed-off-by: Erik Sipsma <[email protected]>
The typescript client generator started a dev engine only so that codegen could introspect it. Give codegen the introspection JSON from engine-dev instead, as the other client generators do. Signed-off-by: Erik Sipsma <[email protected]>
go generate in sdk/go introspected a live engine, so the go client's generate check built and started a dev engine only to read the API schema. Have the go:generate line compute the schema with the introspect tool, in-process, and give it to codegen: go generate then needs no engine, by hand or in the check. The check runs it on the engine's source, which the introspect tool builds from, with no engine bound. Signed-off-by: Erik Sipsma <[email protected]>
The python lint, format and lint-docs-snippets checks, elixir's lint and codegen-test, dotnet's csharpier and source-generator-test, and php's php-stan and php-code-sniffer all ran in a container with a dev engine bound to it. None of them runs a Dagger client: they run ruff, credo, the codegen unit tests against JSON fixtures, csharpier, the source generator tests against inline schema data, phpstan and phpcs. Each one still built a dev engine and CLI from source and started the engine before running its tool. Run them in each module's container without the engine instead, the way the rust module's cargo-fmt and cargo-check already do. The dev containers, with the engine, are unchanged for the checks that use it. Signed-off-by: Erik Sipsma <[email protected]>
TestPruneKeepsTheImagesEntries released its session and pruned at once. ReleaseSession is not a barrier: while an operation of the session is still running, its cleanup waits for that operation to end. The made file's lazy evaluation wakes Evaluate's caller before it ends its own operation, so on a loaded machine the prune ran while the session still held the file, skipped it, and the test read it back as a hit. Wait for the release with WaitSessionRelease, as the server's session teardown and the other tests that release a session do. Signed-off-by: Erik Sipsma <[email protected]>
…gotten TestCacheReportsPartsRead checked, right after ReleaseSession, that the released entries' reads were forgotten, and failed once on CI with all three still held. ReleaseSession returns before its cleanup when another operation of the session is still ending, here a lazy evaluation's, whose goroutine finishes its operation, and so the cleanup, after the value it evaluated is complete. Under CPU contention, 58 of 50,000 runs found the three entries still in the cache with their reads, and none once the release had finished. The test now waits for WaitSessionRelease, the release's completion; with it, 50,000 runs under the same contention found nothing left. Signed-off-by: Erik Sipsma <[email protected]>
TestInstallAncestorWalkOverAWideGraph bounded the allocations of one walk over a wide graph, and failed now and then under the race detector, whose sync.Pool drops some of what it is given. A count of allocations is not something the cache's users observe, so the test goes. Signed-off-by: Erik Sipsma <[email protected]>
…ainer The engine that made the image's entries ran as a service on a cache volume named at random, with the exporter in a separate client container bound to it. No image build was ever cached, across sessions or checks: TestDiskPersistenceAcrossRestart's engine-dev case got a different image in its second session. Make them in one exec on the engine's own container instead: it starts the engine, waits for its socket, runs cmd/engine-image-entries against it and stops it. The state is a mounted empty directory, which the outer engine mounts as a plain directory, so the engine inside can use overlays on it, and which has no name: the exec is cached exactly when its inputs are the same. Signed-off-by: Erik Sipsma <[email protected]>
…ilds no tool and downloads nothing TestBuiltinSDKFromImageEntries checked only that a fresh engine's first Go module load doesn't install git and SSH again for the Go SDK's container. An image whose entries were exported with another engine's recipes passed it, while its engines rebuilt gobuild's gohdr tool and downloaded each dependency into the module cache on that load: 2 tool builds and 20 downloads, besides the module's 3 package builds. An image made as now runs none of them. Fail on any container of the load that builds a tool or downloads a module into the module cache, as well as on the SDK's install. Signed-off-by: Erik Sipsma <[email protected]>
Move every dagger/go pin, the built-in Go SDK's included, to dagger/go#104's head 3fe256c, and go-sdk to a commit on go-sdk's main that names it. That dagger/go keeps the go command's error when a plan or build fails, such as "missing go.sum entry", and adds a failed exec's stderr to gobuild's errors, where it gave only the last lines of its steps or a bare exit code. Signed-off-by: Erik Sipsma <[email protected]>
…256c Signed-off-by: Erik Sipsma <[email protected]>
…yed by content Move every dagger/go pin, the built-in Go SDK's included, to dagger/go#104's head 4beea52, and go-sdk to a commit on go-sdk's main that names it. That dagger/go starts building its tools, gobuild's own build, gohdr, write-manifest and pack, together, where it built them in turn; gohdr and write-manifest come from its gomod module, and go-includes and gohdr are keyed by their own files' content, so a pin move that leaves them unchanged rebuilds neither. Signed-off-by: Erik Sipsma <[email protected]>
…ea52 Signed-off-by: Erik Sipsma <[email protected]>
TestInitReportsTiming required a "sleep 0.2" to take at least 200 ms between the times init reports for spawning and reaping it. Init takes the spawn time after starting the child returns, when the child may already be running, so on a loaded machine the test failed by a few milliseconds: 195.8 and 193.7 ms in two runs in a row. Signed-off-by: Erik Sipsma <[email protected]>
…e running its recipe A value merged from another engine with its recipe and no download address for any part decodes with that recipe armed, and evaluates as a value restored from local persistence does: it runs the recipe directly, without part acquisition's scan for a source. So an engine that held a result equivalent to it, with the contents, ran the other engine's recipe anyway. A fresh engine of an image whose entries carried another engine's module downloads without their contents ran those downloads again, and the gohdr builds under them, emulated when their recipes started from another platform's container: its first Go module call took 81 s instead of 10 s on arm64. Such a value now goes through part acquisition when another result is recorded as equivalent to it, by the routes the scan follows, and the scan takes its contents from that result when it holds them. A value with no equivalent runs its recipe directly, as before. Signed-off-by: Erik Sipsma <[email protected]>
An engine of the image's own build makes the image's entries, on state of its own, and computes every Go build they hold: 55 s on arm64 after any change to the engine. The release the build runs on already shipped most of those builds in its own image's entries, as results of its dagger/go that the builds of the source's dagger/go find through equivalent results. With the Go builds, that engine now starts holding the entries of the release the engine running the build is, pulled from that release's image for the image's platform, and still builds whatever they don't hold. It starts without them, and says why, when that engine is no release, its image ships no entries, or their bundle is of another version than an engine of the source merges: engine-image-entries -check-bundle compares it with dagql.ValueBundleVersion before the engine starts, as the tool did before the entries moved to an engine of the build. A release's entries carry no remote cache's offers: its own engine refuses those at start. Signed-off-by: Erik Sipsma <[email protected]>
… driver Pin the export driver at dagger/golangci-lint's main 124019e, the merge of its #3, in place of #3's earlier head. The merge adds #3's last commit: a load naming no package is answered with its directory's listing. Signed-off-by: Erik Sipsma <[email protected]>
Move every dagger/go pin, the built-in Go SDK's included, to dagger/go#104's head f1d5c0b, and go-sdk to a commit on go-sdk's main that names it. That dagger/go keys write-manifest's build by its files' contents, as it keys go-includes and gohdr, so an engine finds the build in an image whose entries were made on another platform instead of building it again. Signed-off-by: Erik Sipsma <[email protected]>
…5c0b Signed-off-by: Erik Sipsma <[email protected]>
Move every dagger/go pin, the built-in Go SDK's included, to dagger/go main's 79a92be, the merge of dagger/go#104, whose tree is that PR's last head; and go-sdk to its main with daggerGo naming the same commit. That go-sdk main also brings its #109: a module's local clients are addressed by their path from the module. Signed-off-by: Erik Sipsma <[email protected]>
…92be Signed-off-by: Erik Sipsma <[email protected]>
…ough go-sdk 20 more test modules under core/integration/testdata/modules/go move from the built-in Go SDK to go-sdk's committed bindings, each with the local Go modules it depends on. Each module, dependency included, is a root go-sdk scope; a module's local dependencies are its scope's clients, so go-sdk/generate/stale keeps their bindings current. A generated client names its dependency by its path from the module, so a fixture copied anywhere reaches its dependency. Each gets a dagger.toml naming it as the workspace's main module, for tests that call it without -m. The modules' Go code is unchanged. Modules that give a dependency a custom name in dagger.json, and shell-module-lookup, whose test covers dagger.json's legacy dependency declarations, stay on the built-in Go SDK, and so does runtime-workspace-isolation: through go-sdk modules, a dependency's function received the caller's workspace when the caller passed none, which its test exists to refuse. Signed-off-by: Erik Sipsma <[email protected]>
The engine that makes the image's entries inside an exec wrote its log to a file in that exec, and the exec showed the file's last lines only when the step failed. A step that stalled until it was cancelled left nothing of the engine's log anywhere. Its log now goes to the exec's stderr as it is written, so the exec's output holds it on success, on failure and on a cancel. A failure says what failed. Signed-off-by: Erik Sipsma <[email protected]>
sipsma
force-pushed
the
sipsma/go-modules-per-package-build
branch
from
November 17, 2026 21:39
2787d69 to
e0996ec
Compare
publishEvaluatedParts retried "publish: own group not running" in place. That refusal says the evaluation the original began has ended, so no retry under the same original can ever publish: the loop spun until its context was canceled. On CI, the step that makes an arm64 image's entries on an amd64 engine, starting from a release's entries, did that until the check's 30-minute limit, in release/publish-with-mock-endpoints and engine-dev/release-dry-run. When the evaluation has ended and the part it was to produce is installed, there is nothing to publish, and the publication succeeds. Otherwise the refusal goes back to the decision that began the evaluation, which selects again, from a source or by evaluating anew. The refusal names how the group stands, so a recurrence says why. Signed-off-by: Erik Sipsma <[email protected]>
…onstruction fails A host checkout's .git is built on the engine's last reconstruction of the same checkout, from a pack of only what the checkout gained since. That only spares work, but a failure anywhere in it, from finding the earlier reconstruction to applying the pack on it, failed the checkout, and the workspace load with it. Before, the checkout was always packed whole. Now such a failure is logged and the checkout is packed whole, as one with no earlier reconstruction is. A canceled call and a checkout that moved while it was packed still fail as they did: the caller reads a moved checkout again. Signed-off-by: Erik Sipsma <[email protected]>
The built-in SDKs' files are entries of the engine image, which the engine merges at start. When they aren't there, the start goes on and logs it, and every module of those SDKs then fails to load with only "image entry of type Directory ...: unknown entry", long after the log line that says why. Now the start records why the files are missing: the merge's own error, or that the image's entries hold no such directory. A lookup that finds no image entry ends with that cause. Signed-off-by: Erik Sipsma <[email protected]>
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/dagger's own Go modules (the
.dagger/modulesthat CI's checks run through, such as engine-dev, cli-dev, release and the client SDK modules) compile their Go program from scratch on a fresh engine, withgo buildand an empty cache. This PR moves them to dagger/go's per-package build. It compiles each package separately and caches it, and an engine image ships those builds and the Go image they run in. All 17 Go modules of the workspace also move togo 1.27, the engine's Go version.It also carries CI changes that stop several checks from building and starting a dev engine they don't need; see Checks without a dev engine.
Commits
All 17 Go modules on
go 1.27, and the ones with a Dang entrypoint on the per-package build (daggerGo = true), regenerated withdagger generate "dag://?generator=go-sdk/generate". A further run changes nothing.CLIDevBinaryOpts,CLIDevPublishOpts,CLIDevPublishMetadataOpts.release and engine-dev stop passing cli-dev a source. The engine reads a directory module's default paths from the directory it was loaded from since #15124, which shipped in v1.0.0-beta.26. engine-dev's client CLI keeps its source on purpose: it builds from engine-dev's own source.
release stops passing docs-dev, php-client-dev and python-client-dev their directories, for the same reason.
.dagger/modules/gostays ongo build. That module was namedgo, the same name as the dagger/go dependency the per-package build adds, so its own entrypoint resolvedgoto itself and couldn't build. Commit 14 deletes the module, which supersedes this.release passes
publishits renamed flags: the mock publish check and.github/workflows/publish.yml. See Renamed CLI names.engine-dev: introspect the API without a dev engine. The rust, python and elixir client generators, the dotnet client's tests and the docs reference generator get the API schema from the in-process
introspecttool, instead of building a dev engine and CLI from source and starting the engine. The tool now uses the API view the engine serves a client of its own version, so the schema is byte-identical to what the dev engine returned.introspect: keep the introspection types in the JSON. The tool keeps
__Schema,__Typeand the like, as a live engine returns them; the typescript generator emits option types for them.python, elixir: generate the client without a dev engine. Their client generators run in the base containers, which bind no dev engine.
typescript: generate the client from the introspection JSON instead of starting a dev engine for codegen to introspect.
go: generate the client without a dev engine.
go generateinsdk/gocomputes the API schema with theintrospecttool, so it needs no engine, by hand or in the go client's generate check.ci: run SDK lint and unit checks without a dev engine. Nine checks no longer build and start a dev engine they never use: python lint, format and lint-docs-snippets; elixir lint and codegen-test; dotnet csharpier and source-generator-test; php php-stan and php-code-sniffer. Each runs the same tool on the same inputs, in its module's container without the engine.
ci: keep php-client's
BaseContainerwith its dev engine, for anyone who calls it; only the two php lint checks use the new engine-free container.cli-dev, codegen: build the CLI and codegen with dagger/go. cli-dev builds the dagger CLI, and the codegen module builds codegen, with dagger/go's per-package build instead of the workspace's own
gomodule.engine-dev: build the dev engine and its tests with dagger/go. engine-dev builds the dev engine's binaries and the engine's test binaries with dagger/go's per-package build, and runs each package's tests as soon as its binary is built. The workspace's own
.dagger/modules/gois removed.sdk/go: prepare collection runtimes through the export driver. A Go module with a
+collectiontype stops compiling its whole dependency graph from source, the standard library included, on every load. That step now uses the export driver and prebuilt archives codegen's other pass already uses, and fails if the driver declines rather than compile everything. In the test-base shard that step's CPU fell from about 1,600 CPU-seconds to 25; the shard took 676–691 s against 706–723 s on main (two runs each, all 772 tests passing).sdk/go: keep a committed module's access through its runtime preparation: that step still gets the client's SSH agent and git configuration, for private modules.
codegen: load a collection runtime's package in a function of its own, to stay within the linter's complexity limit.
elixir-client-dev: match the semver pattern as a Regexp. Commit 14's version check built its pattern as a plain string, which Dang refuses, so every elixir-client check failed to start. It now matches the pattern the way typescript-client-dev already does.
engine-dev: add the CNI plugins to the engine image in a fixed order. Since commit 14, the dev engine image added its four CNI plugins in Go map order, which is random. Two builds of the same source could produce different layers, so everything after them missed the cache, and
TestDiskPersistenceAcrossRestart/engine-dev_container_build_survives_restartfailed. The plugins now go in a fixed order.codegen: trace each step of a generate run. A Go module load's trace now shows codegen's steps as spans of their own: loading the schema, bootstrapping go.mod, generating the code, merging the module's types, writing the files, and each go command run afterwards.
codegen: format each generated Go file once, about 0.1 s off each later module load.
codegen: read a driver-loaded package's module from its go.mod instead of the module cache.
sdk/go: ask for a silent session when log output is discarded.
dagui: take an ended span in without scanning its ancestors' running spans and intervals.
idtui: don't render plain progress frames that would print nothing. With commits 23 and 24, the CLIs' CPU in a test-container shard fell from 121 to 94 CPU-seconds.
engine-lab, mcp-lab, sdl-diff: build their Go tools with dagger/go, each from a directory of its own, instead of
go buildwith Go cache volumes. sdl-diff'sgo-modandgo-buildcache volumes go.go-client-dev: run the Go SDK's tests with engine-dev's test runner. Each package's test binary is built with dagger/go; the tests run in a plain container with no Go toolchain or cache volumes. engine-dev gains
testModule.dagger-dev: build the protoc plugins with dagger/go instead of
go install.go-client-dev: generate the Go client without go run. The codegen binary generates from the introspection JSON, so no go command compiles anything. engine-dev gains
exportDriver.codegen, engine-dev: build the code generation tools without the commit, so a new commit no longer relinks them and reruns every client's generate check.
dagger-dev: drop protoc-gen-go-grpc from goBase: nothing in the repository uses it.
engine-dev: read the workspace's commit only for builds that stamp it. Reading it brought the checkout's git history into the engine, 7 to 11 s, for every caller.
dagql: walk a result's ancestors without allocating per ancestor.
engine: read the image's part blobs in place instead of copying them: a fresh engine stops copying 297 MB of pre-built packages into its state.
engine/snapshots: reuse layer read-ahead chunks across layers, instead of a new megabyte per part.
dagql: skip the install spans of ancestors that own no closure. The span links are exactly as before.
engine/snapshots: leave the image's in-place blobs out of snapshot sizes, so pruning doesn't count disk the engine doesn't use.
engine/snapshots: hold the read-ahead test to a chunk per apply, under the race detector CI uses.
engine: forget records of image blobs a new image no longer holds, so an engine restarted on its state with a newer image remakes those layers on export instead of failing.
dagql: a prune never deletes what the engine's image ships. A low-disk prune used to delete the image's pre-built Go builds first, and every later module load recompiled them, 60–100 s each in the test-container shard. The prune monitor now starts after the image's entries merge.
engine: the built-in SDKs' files come through the image's entries. The built-in Go, Python and TypeScript SDKs no longer ship as separate images that every fresh engine unpacks; their files come from the image's cache entries, found by content digest.
core: parse a Dang module's source while its dependencies load. A Dang module, such as dagger/go or the built-in Go SDK, is parsed while its dependencies load instead of after them.
core: keep a canceled Dang prebuild's source until its parse ends, so a load canceled mid-parse no longer records an incomplete list of a module's type names.
core: don't prebuild a Dang source this engine has already parsed.
core: build a module's core typedefs while its dependencies load, instead of inside its namespacing.
core/sdk: hide the Go SDK container's calls from the calling session. Loading a built-in SDK builds the Go SDK's container with calls in the user's session, starting from
container(). A session shows each call once, so a module's owncontainer()call then had no line of its own in the output:container().from("alpine")read as one line instead of two. Those calls now run with telemetry hidden, as the engine's other SDK calls do.engine/snapshots: unpack the image's own blobs without hashing them: 0.33 CPU-seconds less per Go module load on a fresh engine, 0.17 with five engines at once.
engine/snapshots: trust an image blob only under its own diff ID. A layer that names an image blob under another diff ID is still checked.
dagql, core: decode each payload once in a merge's preparation. The merge of the image's entries at engine start takes 0.71 s instead of 0.90, with the same results.
dagql: drop recordCompletePartKeys, which nothing calls.
engine-dev: make the image's entries on the engine the build runs on. The tool that exports the image's entries now runs as a client of the engine the build already runs on, not of a seed engine started from the image being built. The SDK files and the Go builds become ordinary calls cached by their inputs, so a later build finds them made and only the export reruns: 4–8 s after an engine change, against 53 s with a seed engine. It also removes the serial dev CLI build and seed engine run that the built-in SDK change added to every dev engine image build.
test-split: ship the image's Go builds to every shard that loads a Go module. test-packages, test-provision, test-local-cache and the two eBPF shards load no Go module, so they go without; they still get the SDK files.
core/integration: a fresh engine finds its Go builds in the image's entries. A fresh engine from the test image loading a new Go module makes 3 package builds with the entries and 494 without. The test requires fewer than 20.
core: remove the remote cache test fixture. The same change as #14828's: it removes
Query._remoteCacheFixture, a test-only field switched on by an environment variable, with the cache hooks that served it and the integration suites that used it, which started engines without the image's entries. The remote cache's integration tests run against the real service. Whichever of this PR and #14828 merges second drops its copy.dagql: return the part reuse tests' receiver as one value (#14828's lint follow-up).
dagql: name the part reuse tests' receiver apart from partReuse (#14828's compile fix for 55).
python-client-dev: run the SDK tests against the dev engine. The Python SDK's tests now run against the engine built from the commit; since #15056 they had run against the released engine that runs CI. A failed Python test now shows its session and the dev engine's side in the check's trace. The slow check takes about 44 s instead of 27 s on a warm cache, mostly a Docker build test now running on the dev engine's empty cache.
python-client-dev: keep the pytest tracing plugin installed, so each test gets a span.
engine-dev: don't cache a failed run of the image-entries exporter. The exporter ran with any exit code accepted, which made a failed run a successful, cached result: every later build with the same inputs, a rerun of the same check included, was served the failure without running the exporter again. It now has to succeed, so a failure is an error, which isn't cached.
engine-dev: build the engine while its image's entries are made. The engine image's CLI built only after the entries export ended; it now builds alongside it. On a fresh engine, python-client's dev engine image built in 111.9 s against 128.0 s (one run each).
core: reuse a host checkout's reconstructed repository across invocations. Reading a local checkout's git through a workspace (
Workspace.git.head,uncommitted, a module context's git) rebuilt the checkout's whole repository on everydaggerinvocation. The engine now keeps that rebuild across invocations, keyed by the checkout's refs and the machine's dagger client; when the refs move, the client sends only what's new, applied to a copy-on-write copy of the last rebuild. Each session still pins its own view of the checkout. On a dagger/dagger clone the read takes 1.3–1.5 s warm against 10.5–11.3 s on main, and 2.8–2.9 s after a new commit against 10.6–12.4 s; a fresh engine is unchanged at about 11.5 s. The cost: the engine keeps each checkout's rebuilt repository until its cache prunes it, about 265 MB for a dagger/dagger clone, plus the new objects of each later state.core: re-read uncommitted changes after an export; order ref deletions first.
engine: move the checkout pack's metadata and bundle steps into helpers, to stay within the linter's complexity limit; no change in behavior.
go: move the root module and sdk/go to Go 1.27, the engine's version. Tools built for a module at the Go its
go.moddeclares, such as the root module's linters, can then use builds made with 1.27 instead of compiling from source. Code that importsdagger.io/daggernow needs Go 1.27.all: move the repository's other Go modules to Go 1.27: the internal libraries and tools, the PHP, Java and Elixir SDK runtimes, the published modules, the e2e harnesses, the docs tooling, the CI modules' test modules and the integration and telemetry tests' fixtures. The copy of an older release's docs keeps its version.
internal/fastbolt: keep go 1.25.0. fastbolt stands in for go.etcd.io/bbolt in other modules, including containerd's own tests that the fastbolt check runs on it, and
go mod tidyraises a module to the Go version of what it replaces bbolt with. At 1.27, containerd's code was vetted as Go 1.27 code and failed a format check.(Dropped in the rebase onto main 2a385e9: main's vito/dang v2.5.0, from Render Dang tool calls as code in dagger agent #15164, already contains 683ac69d8a and querybuilder: run a query's receiver while its arguments get their IDs vito/dang#308.)
release: run apko through a Dang entrypoint, like the other release modules.
sdk/python: run the Python SDK's runtime module through a Dang entrypoint, with go-sdk and dagger/go's per-package build.
sdk/typescript: the same for the TypeScript SDK's runtime module.
Remove modules nothing uses: modules/gha, modules/metrics, modules/daggerverse and its preview workflow, docs/recorder, docs/recorder2, and the tests modules under release/{apko,gh,registry-config} and docs-dev/docusaurus.
sdk/python, sdk/typescript: move the runtime modules to Go 1.27.
core/integration: run the repository's code in Go 1.27 images. Three tests built Go code whose go.mod now declares Go 1.27 in images pinned to older Go.
dang: fail a function with the Error it raises (from #15161, by Alex Suraci). A Dang function can fail with a real
Error, values included, instead of only a message, so a module's errors can pass through a Dang entrypoint intact. This PR already carries a later Dang than dang: fail a function with the Error it raises #15161's bump, so that commit isn't repeated here.(Dropped in the rebase: main now defaults new modules to Dang 2.5 and its skill text describes 2.5's interpolation.)
core: withMountedTemp(disk: true), a temp mount on the engine's disk.
Container.withMountedTemptakesdisk: true(from v1.0.0-beta.28, and not together withsize): each process gets an empty directory on the engine's disk, mode 1777 like a tmpfs, which the engine removes in the background when the process ends. At start, an engine moves a previous engine's leftover temp mounts to the trash its sweeper removes. It's for engine-dev's test dev engine, whose state today stays behind on CI's engines (44–50 GB per test-base run until a prune; none withdisk, at no change in check time, measured on burst). engine-dev starts using it once a release carriesdisk, so this commit alone changes nothing in CI yet.dang: give a module the description its entrypoint returns. A Dang entrypoint can declare an optional
descriptionmember, as it declaresprebuild; the engine gives the module that description. So a Go module on go-sdk's Dang entrypoint gets its package comment as its description again. An entrypoint without the member gives none, as before, and an older engine ignores it.core/integration: raise an Error that a module's process built. A test that an Error built by a module's process, with a value, still reaches the caller after that process exits, which go-sdk's error passing through a Dang entrypoint relies on.
(Dropped in the rebase: main's Render Dang tool calls as code in dagger agent #15164 changed the same subtest to expect the broken module under SKIPPED MODULES, with its load error.)
core: generate a workspace's independent SDK scopes at once.
dagger generateused to generate a workspace's SDK modules strictly one after another. Now each module generates as soon as the local modules it generates clients for are done, from the workspace plus only their changes; changes still apply in the same stable order. On a failure, the error lists every failed module, and the modules that depend on a failed one are skipped. One behavior changes: two modules that no client links no longer see each other's output, so if both touch the same file outside their own directories, the result can differ from before.core: generate at most one SDK scope per CPU at once, so a workspace with many modules doesn't run the machine out of memory.
dagger.toml: pin go-sdk at the commit that targets v1.0.0-beta.27, the head of dagger/go-sdk#105, by commit, and regenerate every go-sdk module with it. The modules keep targeting v1.0.0-beta.26. The regenerated code gives each module its description, takes the newer runtime image digest, and its bindings no longer offer calls only the main client can make, which none of these modules use. Every module still loads with the same functions and the same checks.
engine-dev: serve the tests the repo's module downloads as a result. Tests that compile parts of this repository in the dev engine got its module downloads from a
go mod downloadinto a cache volume. Where that exec was served from cache on an engine whose volume was new, as on a fresh engine behind a remote cache, the volume was empty and those tests failed. The downloads now come from an exec of their own with no cache volume, keyed by the root go.mod, go.sum and the local replacements' go.mod.all: build with dagger/go's commit that lists packages and serves module downloads. go-sdk is pinned at a commit on top of commit 82's whose generated modules build with dagger/go#104's head, and every module's own dagger/go dependency and the built-in Go SDK's move to that same commit (the engine image build requires the built-in Go SDK and go-sdk's modules to build with the same dagger/go). Every module is regenerated. The first CI run after this rebuilds the per-package builds once, since their keys change.
engine-dev: serve the tests the repo's module downloads from dagger/go. Commit 83's downloads now come from dagger/go's module proxy for the root go.sum: each module version downloaded once, keyed by its path, version and checksums, in the layout the tests already read.
engine-dev: answer codegen's type-check from dagger/go's package listing. The export driver moves to dagger/golangci-lint#3's head, which answers the Go SDK's code generation from the package listing dagger/go now writes beside its archives: its type-check runs no
go listand reads no module cache.engine-dev: make the image's entries on an engine of its build when the outer one writes another bundle version. An engine starts only from entries in its own bundle version, and the entries are exported by the engine the build runs on, a release. So a change of the bundle version, in the source or in a later release, failed every dev engine at start ("unsupported value bundle version"). The entries tool now exits 3 when the bundle it exported is of another version than the source's engine reads, and engine-dev then makes the entries on an engine of the image's build, as before commit 51. Where the versions match nothing changes. Seen on the released engine with the source's version moved to 8 and to 6: the mismatch is found in 8 s, a seed engine writes the entries in 46–48 s, against 15 s for one export when they match, and the dev engine starts from them.
88–92. dagql: an image export waits for a busy result, with its test, its review follow-up and its logs. The image export needs every result, but a capture never waits for a busy row: it leaves it out for its caller to ask again. With the remote cache on, the cache's own export can read the same rows at the same moment, and the image export gave up. It now lets go, waits (10 ms, doubling to 1 s) and captures again until every result is captured or one is refused. It waits outside the capture, with nothing held, since a capture can hold the cache's locks. There is no time limit: a result that never frees would wait until the check's timeout, a case not observed. Today's CI has no remote cache and never showed the failure.
engine-dev: build QEMU's emulators and the Go SDK's files reproducibly. Two cold builds of the engine image gave different bytes for three QEMU emulators (code generated through a Python set, now built with
PYTHONHASHSEED=0) and for the Go SDK's files (apk's log and Go's checksum-database answers, now left out). The Go SDK files' digest is in the image's environment, so every engine's image, and everything built on it, had its own recipe. Without the checksum answers, a legacydagger.jsonGo module's first load makes those lookups over the network: 37–38 s against 38 s with them.engine-dev: check that the steps which built to different bytes now build the same twice (
ReproducibleBuild, a new check: about 110–160 s).95–98. engine: flatten a snapshot chain before a mount can't stack it, with three follow-ups. Once a snapshot's chain holds 128 layers, a new snapshot is prepared on a one-layer copy of its parent. Before, a long series of edits to one directory, container or workspace failed to mount at 437–501 layers ("mount options is too long"), as
dagger generatechanging about 90 modules did. A merged file's layer is found from its directory's layers, so that copy of a dagger/dagger-sized tree takes 1.6 s instead of 27 s; the copy keeps the owner of/; and a layer diff lists nothing beneath a non-directory, an older bug the faster merge exposed. Ordinary chains are unchanged within noise; a flatten costs about 1.6 s per 127 edits of one lineage.all: build with dagger/go's commit that bounds module downloads. gobuild: take the repeated work out of a module's first per-package build, build test binaries as a set, and make failures readable go#104's head now downloads a go.sum's modules for its module proxy 32 at a time; it started all of them at once, and CI's engines' DNS resolver timed out on the burst (commit 85's downloads, about 750). It also plans a package's test binary alone when its collection's shared plan fails, which engine-lab's report test needed.
engine-dev: plan a test run's binaries together, and only them. gobuild: take the repeated work out of a module's first per-package build, build test binaries as a set, and make failures readable go#104's head now plans a package taken from its module's whole collection alone, as
go test -cdoes, and shares a plan only among a subset's packages. engine-dev now takes each test run's packages through the subset of the directories that run builds, so a small shard no longer compiles for every tested package of dagger/dagger (on a fresh engine, one package's test binary took 78 s planned with all of them against 36 s alone, measured by mount cache support #104's owner). A run that selects every tested package of its module is still planned per package until dagger/go counts such a subset as narrowed.all: build with dagger/go's commit that plans a whole collection's member alone, the pins for commit 100.
core/integration: load 111 Go test modules through go-sdk. 111 fixtures under
core/integration/testdata/modules/goget committed go-sdk bindings and become root go-sdk scopes, so the stale check covers them; they target v1.0.0-beta.27, so their dependencies are the engine image's pre-built ones. On Build dagger/dagger's Go modules with the per-package build, on Go 1.27 #15143's earlier head, with and without them (3 alternating pairs, one 16-CPU arm64 machine, released v1.0.0-beta.27): TestCall, TestModule and TestShell took 402 s against 455 s (−11.6%), and eachdaggercall's module type-definition load a median of 0.42–0.46 s against 0.61–0.71 s. Five fixtures stay on the built-in Go SDK, because their tests expect module code calling main-client-only APIs to fail to compile, which go-sdk's bindings won't generate; 22 with local Go dependencies wait for a go-sdk change.core/integration: expect a Go module's own manifest in TestConstructor.
core/integration: read the go-sdk manifest in the contextual cache fixture. Commit 102 removed that fixture's
dagger.json, which its functions read as their contextual file; it reads itsdagger-module.tomlinstead, soTestDiskPersistenceAcrossRestartstill checks that a function with a contextual argument stays cached across a restart.engine/snapshots: hold the profiled import's read until its fetch found the blob missing. A test-only fix for a race in
TestImportChainProfiled/download_runningthat opened when this PR removed the builtin image store: the case releases its held read once the fetch has found the blob missing, instead of when the fetch links the blob to its lease.core/integration: load 14 more Go test modules through go-sdk, as commit 102 does, among them the agent, cross-session and shell-secret fixtures; TestCrossSessionContextDirectoryDefaultPath now looks for each module's
dagger-module.toml.large-errorsand the 8terminal-*fixtures stay on the built-in Go SDK for now.core/integration: load the check-planning test modules through go-sdk. TestChecks' planning tests wrote their Go probe modules inline as strings; they are now five fixtures with committed go-sdk bindings, with each run's nonce in a file the test overwrites.
all: build with dagger/go's commit that returns no IDs from archiveBuilds. The pins move to gobuild: take the repeated work out of a module's first per-package build, build test binaries as a set, and make failures readable go#104's head 4674a1f6d8 and a go-sdk commit naming it. That dagger/go removes
GoArchiveBuilds.sharedDependencies, which returned engine IDs as strings and which nothing in this repository read; the regenerated clients drop the field.core/integration: regenerate the go-sdk test modules on dagger/go 4674a1f6d8: one pin line in each of the 130 converted fixtures.
core/integration: load the terminal test modules through go-sdk. The eight
terminal-*fixtures; their test now makes its temp directory a git repo, since without one the engine reads nodagger.tomlby design, so the subtests that call the CLI without-mkeep checking what they did.all: build with dagger/go's commit whose gobuild builds without cache volumes. The pins move to gobuild: take the repeated work out of a module's first per-package build, build test binaries as a set, and make failures readable go#104's head a5c2efaf2c and a go-sdk commit on go-sdk main (with example: deploy react app to netlify #105 merged) naming it. gobuild's own build no longer mounts the go-sdk-v2 cache volumes, so its cache key changes and the image's entries move with it.
core/integration: regenerate the go-sdk test modules on dagger/go a5c2efaf2c: one pin line in each of the 138 converted fixtures.
engine-dev: make the image's entries on an engine of its build, on fresh state. Commits 51–53 exported the entries from the engine the build runs on, a release. Its own image's entries, made by an older dagger/go, came along with their recipes, so a fresh engine of the image rebuilt tools and downloaded modules on its first Go module load. With a remote cache configured, that cache's offers came along too, and their renewal keys made the image's engine refuse to start. The entries are now made on an engine of this build, started on a new, randomly named state each build. Commit 87's bundle-version check is gone with the path it chose between. Commit 119 replaces the service it used.
sdk/python, sdk/typescript: keep the runtime modules on the built-in Go SDK for now. Their files are back to main's, undoing commits 69, 70 and 72, and their go-sdk scopes leave
dagger.toml. Their move to go-sdk waits for a release that go-sdk's error passing can target.TestPython/TestAltRuntimeandTestModuleDeprecationValidationErrors' TypeScript case pass again.dagql/idtui: match the Go build's dependency upload in the golden tests. A Go module load on dagger/go's per-package build shows an
uploading /tmp/gobuild-dependencies-<random>line; the golden tests scrub its random part and expect it inbroken-defaultandbroken-dep-use-broken-default.engine/server: wait for the session's release before the prune in
TestPruneKeepsTheImagesEntries, as other tests that release a session do.dagql: wait for a session's release before checking its reads are forgotten in
TestCacheReportsPartsRead.dagql: drop the test that counts an ancestor walk's allocations (from commit 33), which failed now and then under the race detector.
engine-dev: make the image's entries in one exec on the engine's container. Commit 113 ran that engine as a service on a cache volume named at random, so no image build was ever cached across sessions or checks, and
TestDiskPersistenceAcrossRestart's engine-dev case failed. One exec on the engine's own container now starts the engine, runs the entries tool against it and stops it, with the state on a mounted empty directory, which the outer engine mounts as a plain directory and which has no name. On a 16-CPU arm64 machine with v1.0.0-beta.27, a second image build in a new session is a cache hit: 7 s for the whole call, against 33 s for the first without the Go builds and 64 s with them.core/integration: check that a fresh engine's first Go module load builds no tool and downloads nothing.
TestBuiltinSDKFromImageEntriesnow also fails when that load starts a container that builds a tool or downloads a module into the module cache. An image whose entries carried another engine's recipes passed the old check while its engines rebuilt gobuild'sgohdrtool twice and made 20 downloads on that load; an image made as in commit 119 runs none of them.all: build with dagger/go's commit that keeps a failed build's go error. The pins move to gobuild: take the repeated work out of a module's first per-package build, build test binaries as a set, and make failures readable go#104's head 3fe256c and a go-sdk commit on go-sdk's main naming it. That dagger/go keeps the go command's error when a plan or build fails, such as "missing go.sum entry", and adds a failed exec's stderr to gobuild's errors, where it gave only the last lines of its steps or a bare exit code. No API change.
core/integration: regenerate the go-sdk test modules on dagger/go 3fe256c: one pin line in each of the 138 converted fixtures.
all: build with dagger/go's commit that builds its tools together, keyed by content. The pins move to gobuild: take the repeated work out of a module's first per-package build, build test binaries as a set, and make failures readable go#104's head 4beea52 and a go-sdk commit on go-sdk's main naming it. That dagger/go starts building its tools, gobuild's own build, gohdr, write-manifest and pack, together, where it built them in turn. gohdr and write-manifest now come from its gomod module, and go-includes and gohdr are keyed by their own files' content, so a later pin move that leaves them unchanged rebuilds neither. On a 16-CPU arm64 and a 16-CPU amd64 machine, a fresh dev engine's first load of a small Go module still builds no tool and downloads nothing.
core/integration: regenerate the go-sdk test modules on dagger/go 4beea52: one pin line in each of the 138 converted fixtures.
cmd/init: drop the test that times a command between spawn and exit.
TestInitReportsTimingrequired asleep 0.2to take at least 200 ms between the times init reports for spawning and reaping it. Init takes the spawn time after starting the child returns, so on a loaded machine the test failed by a few milliseconds (195.8 and 193.7 ms in two runs in a row).dagql: take a merged value's contents from an equivalent result before running its recipe. A value merged from another engine with its recipe and no download address ran that recipe directly, even when the engine held an equivalent result with the contents. It now goes through part acquisition when another result is recorded as equivalent, and takes the contents from it. With a unit test that fails without it.
engine-dev: make the image's entries starting from the release's. With the Go builds, the engine that makes the image's entries starts holding the shipped entries of the release the outer engine is, and builds whatever they don't hold. It starts empty, and says why in the exec's log, when the outer engine is no release, its image ships no entries, or their bundle is of another version (
engine-image-entries -check-bundle). Releases are built the same way. Measured with three interleaved runs per arm on 16-CPU machines with v1.0.0-beta.27, against commit 122's head: making the entries after an engine change took 40.2 s against 56.4 s on arm64 and 42.9 s against 63.8 s on amd64, and the whole image build 63.2 s against 80.3 s and 79.5 s against 106.7 s. A fresh engine's first Go module build was 6.9 s against 6.3 s on arm64, where the release's arm64 entries were made on amd64, and 7.6 s against 7.7 s on amd64; it builds no tool and downloads nothing.engine-dev: load imports through dagger/golangci-lint's merged export driver. The pin moves from Bug fix, bug repro, debug message cleanup #3's earlier head to the merge of dagger/golangci-lint#3, which adds its last commit: a load naming no package is answered with its directory's listing.
all: build with dagger/go's commit that keys write-manifest by its files. The pins move to gobuild: take the repeated work out of a module's first per-package build, build test binaries as a set, and make failures readable go#104's head f1d5c0b and a go-sdk commit on go-sdk's main naming it. That dagger/go keys write-manifest's build by its files' contents, so an engine finds it in an image whose entries were made on another platform.
core/integration: regenerate the go-sdk test modules on dagger/go f1d5c0b: one pin line in each of the 138 converted fixtures.
all: build with dagger/go's main, which merged the per-package build. Every dagger/go pin moves to dagger/go main's 79a92be, the merge of dagger/go#104, whose tree is that PR's last head. go-sdk moves to its main (with its Simplify runtime code by removing layers of abstraction #109) plus
daggerGonaming the same commit; its Simplify runtime code by removing layers of abstraction #109 addresses a module's local clients by their path from the module, which is all its regeneration changes here.core/integration: regenerate the go-sdk test modules on dagger/go 79a92be: one pin line in each of the 138 converted fixtures.
core/integration: load 20 Go test modules with local dependencies through go-sdk, as commit 102 does, each with the local Go modules it depends on as root go-sdk scopes, so go-sdk/generate/stale keeps their bindings current; a generated client names its dependency by its path from the module. Modules that rename a dependency in dagger.json,
shell-module-lookupandruntime-workspace-isolationstay on the built-in Go SDK.engine-dev: send the image entries engine's log to its exec's output. The engine that makes the image's entries logs to its exec's stderr, so a failed or slow step shows the engine's own log in the trace instead of keeping it in a file.
dagql: stop retrying a publication whose evaluation has ended. A publication refused because the evaluation it ran under had ended retried in place, and nothing could change that refusal, so it spun until canceled: on CI, the arm64 image entries step of release/publish-with-mock-endpoints and engine-dev/release-dry-run did that until the 30-minute limit. Now, when the part is already installed, the publication succeeds; otherwise the refusal goes back to the decision, which selects again. The refusal says how the evaluation stands. With unit tests that hang without it.
core/schema: pack a host checkout whole when building on its last reconstruction fails. Building a host checkout's
.giton the engine's last reconstruction of it, from a pack of only what it gained (commit 61), only spares work, but a failure in it failed the workspace load. Now such a failure is logged and the checkout is packed whole, as before. A canceled call and a checkout that moved mid-pack fail as they did. With a unit test.engine: say why a built-in SDK's files are missing when its module loads. Since engine: never fail the start over the cache entries the image ships #15199 an engine starts when its image's entries don't merge, and a module of a built-in SDK then failed with only "unknown entry". The error now ends with why: the merge's own error, or that the image's entries hold no such directory. With a unit test.
Rebased on main 35dc833 (17 Nov), 127 commits past the earlier base, with no text conflict. Three files changed on both sides, each read after the replay:
dagql/dagui/db.go(commit 24's interval merging, beside main's log-presence and cost changes),engine/server/session.go(commit 41's removal ofBuiltinOCIStore, beside main's telemetry server changes) andcore/integration/cross_session_test.go(commit 106's manifest name, beside main's Bitbucket host change).Measured on one 16-core machine with fresh engines, in alternating pairs against the head before them:
go-sdk/generate/staleon dagger/dagger's own modules took 95.0 s against 190.8 s (median of 5 pairs), and with 109 more go-sdk test fixtures 185.6 s against 621.8 s (3 pairs). One module alone is unchanged, 49.2 s against 49.0 s. The generated output is byte-identical.What it does for users
Measured against main at 8634572 on a 16-CPU arm64 machine, with the released v1.0.0-beta.27 engine, a local checkout and a fresh engine for every run. Runs alternate main and this PR in interleaved pairs, and every run passed.
dagger check --by-release --check docs-target-version/stale(a first call that builds no dev engine)dagger check --by-rust-client --check stalegolangimage and runs a coldgo build.go buildthrough.dagger/modules/go. This PR doesn't change that build.In CI until engines hold the per-package builds
The dev engine's binaries now come from dagger/go's per-package build, whose results live in the CI engine's state. CI's engines today hold what main's runs made, and main makes none of these builds, so on this PR most checks that build a dev engine compile 300–600 packages and start their dev engine later than main's warm
go build: in one run, go-client at 214 s against 113 s, test-workspaces at 224 s against 115 s, typescript-client at 185 s against 81 s. The builds' keys don't change between commits (266 of 267 dependency packages kept the same content key across two of this PR's runs), and where an engine already held them, the dev engine started sooner than main's (test-base at 91 s against 158 s). This is accepted as a change-over cost and checked on main's first 20 runs after the merge.Checks without a dev engine
Commits 6–12 change what several CI checks do, not what they check: the schema JSON the generators read is byte-identical to the dev engine's (apart from a trailing newline), and the affected stale checks pass.
stalecheck (3 interleaved pairs on a 16-CPU arm64 machine, released v1.0.0-beta.27 engine): the same call again on a warm engine took 60 s on main and 10 s with these commits. On main a repeat restarts the dev engine and reruns 50 s of cargo, because their input comes from a service-bound exec that the cache never reuses. A first call on a fresh engine took 230 s on main and 209 s with these commits.Together that is about 25 minutes of work down to about 64 seconds. The CI jobs themselves went from 61–467 s to 18–41 s.
In this PR's CI (one run each, read from the commit statuses and traces): the column that isolates commits 6–12 compares this PR's head with the head just before them (same base). Whole-check times swing with the CI engine's cache, so the step that fetches the API schema is the cleaner signal.
rust-client/api-client/stalepython-client/client-library/staletypescript-client/client-library/staledocs/references/staledotnet-client/testgo-client/generate/staleelixir-client/client-library/staleintrospecttool.introspecttool, where the run before reused a dev engine that was already built. These are single runs on different CI engines.Building the dev engine with dagger/go
Commits 13 and 14 move the builds of the dev engine, its tests, the CLI and codegen onto dagger/go. Measured on one 16-CPU arm64 machine, released v1.0.0-beta.27 engine, a fresh engine per run:
dagger check --by-rust-client --check stale, first calltest-splittest-container shard (one run each)test-splittest-packages shard (median of two runs)go vetandgo test -race, the tests container'sgo mod downloadand go-client-dev's dev container, in engine-dev'sgoEnv; and the release builds of the CLI, by goreleaser.What changes for callers:
.dagger/modules/gois gone, with all its functions. The workspace never installed it as a module.goEnv(source, cgo).testand its variants still takego testpatterns inpkg, plus!patternto exclude. A package named exactly whose code has no tests is now an error, wherego testprinted "no test files". Each package's tests run in their own exec.testslists the same sorted test names, read from source instead of fromgo test -list.packagePatternsis gone.baseargument must still carry a Go toolchain; it now becomes dagger/go's base.cmd/codegen) now declares enginev1.0.0-0.binaryreturns the codegen module's binary.Go builds moved off plain go commands
Commits 26–32, measured on one 16-CPU arm64 machine with the released v1.0.0-beta.27 engine, against this PR before them:
client-library/stale, after an unrelated commitclient-library/stale, fresh enginetest, fresh engineA fresh engine's use of the pre-built packages
Commits 33–39 make a fresh engine's use of the image's pre-built Go packages cheaper. Measured against main in interleaved pairs on one 32-CPU amd64 machine: a fresh engine's Go module load uses 2.5 CPU-seconds less alone (23.9 to 21.4, 10.5%) and 2.7 less with five engines at once (24.5 to 21.7). The load finishes 0.5 s sooner alone and 0.8 s sooner with five at once. Nothing measured was slower. Each change has a test that fails without it.
The prune rule and the built-in SDKs
The prune rule (commit 40): in six interleaved test-container shard pairs on a 16-CPU arm64 machine, every run with the rule kept the image's pre-built builds (430–432 compiles), and every run without it lost them (1,682–5,737 compiles).
The built-in SDKs through the image's entries, on top of the pre-built parts commits, one 16-CPU arm64 machine, five rotated rounds. A fresh engine's first Go module load:
The test-container shard passes at par, 213 s against 216 s, and its Go SDK module loads drop from 79 s to 48 s summed.
What bringing the built-in SDKs through the image's entries costs:
A module's own work while its dependencies load
Commits 42–45, measured on fresh engines on a 16-CPU arm64 machine, each change in 20 interleaved pairs against the step before it:
dagger check -lof dagger/dagger: 0.06 s, then 0.04 s faster.Making the image's entries on the build's own engine
Commits 51–53, measured in interleaved pairs against main on spot machines:
daggerCLI got SIGKILL (exit 137), and the dev engine stopped with tests in flight. Main's test-base on the same machine finished in 916 s. There were no memory readings and no kernel log, so out-of-memory is a guess. CI runs test-base on 16-core machines; this PR's CI runs are read for test-base's result and its dev engine's memory against main's.Renamed CLI names
The modules now target beta.26, whose naming spells acronyms as words, so a few names change for anyone who calls these modules by hand or from CI. The old spellings no longer work:
release publishflags:--netlify-apiurl→--netlify-api-url,--hex-apikey→--hex-api-key,--hex-apiurl→--hex-api-urlwith-ebpfprogs→with-ebpf-progswith-cacert→with-ca-certapiclient→api-client, so its check is nowrust-client/api-client/staleThese come from comparing every module's served schema before and after; the other modules keep their names. In this repository, the mock publish check and
.github/workflows/publish.ymlpassed the oldrelease publishflags. Commit 5 updates both.In CI: test shards across dagger/go #104's pins
Each check's wall time from its commit status, one run each. Both later runs are the first after a pin move changed the Go builds' and module downloads' cache keys, so they ran cold where the run before #104 had warm builds from earlier runs; read a slower shard as a cold run until a warm repeat says otherwise. "red" shards failed on known tests: the two runtime failures, and, from 3df3d12, a golden test that #104's new upload line breaks.
go build -o /gohdr .-shaped, 10–27 s) in each of the 20 fresh dev engines its restart test starts, which the image's entries don't hold; being worked out with mount cache support #104's owner.What's left
SSH_Private_BitBucketcases of test-modules and test-call-and-shell fail on any branch while Bitbucket's old SSH host is switched off. They are fixed separately.daggerGoto dagger/go main's 79a92be (commit 131). It moves to go-sdk's merge of that change before this merges. dagger/go and dagger/golangci-lint are pinned at merged commits.The remote-cache test suites that started engines without the image's entries are gone (commits 54–56), so nothing here waits on #14828 any more.