Skip to content

Build dagger/dagger's Go modules with the per-package build, on Go 1.27 - #15143

Merged
sipsma merged 134 commits into
mainfrom
sipsma/go-modules-per-package-build
Nov 18, 2026
Merged

sipsma merged 134 commits into
mainfrom
sipsma/go-modules-per-package-build

Conversation

@sipsma

@sipsma sipsma commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

dagger/dagger's own Go modules (the .dagger/modules that 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, with go build and 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 to go 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

  1. All 17 Go modules on go 1.27, and the ones with a Dang entrypoint on the per-package build (daggerGo = true), regenerated with dagger generate "dag://?generator=go-sdk/generate". A further run changes nothing.

    • The per-package build needs a module that targets v1.0.0-beta.26 or later, and that is the newest target the pinned Go SDK generates for. So these modules target beta.26 and need a beta.26 or later engine.
    • At that target, cli-dev's object type names follow the engine's identifier casing for its callers: CLIDevBinaryOpts, CLIDevPublishOpts, CLIDevPublishMetadataOpts.
  2. 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.

  3. release stops passing docs-dev, php-client-dev and python-client-dev their directories, for the same reason.

  4. .dagger/modules/go stays on go build. That module was named go, the same name as the dagger/go dependency the per-package build adds, so its own entrypoint resolved go to itself and couldn't build. Commit 14 deletes the module, which supersedes this.

  5. release passes publish its renamed flags: the mock publish check and .github/workflows/publish.yml. See Renamed CLI names.

  6. 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 introspect tool, 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.

  7. introspect: keep the introspection types in the JSON. The tool keeps __Schema, __Type and the like, as a live engine returns them; the typescript generator emits option types for them.

  8. python, elixir: generate the client without a dev engine. Their client generators run in the base containers, which bind no dev engine.

  9. typescript: generate the client from the introspection JSON instead of starting a dev engine for codegen to introspect.

  10. go: generate the client without a dev engine. go generate in sdk/go computes the API schema with the introspect tool, so it needs no engine, by hand or in the go client's generate check.

  11. 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.

  12. ci: keep php-client's BaseContainer with its dev engine, for anyone who calls it; only the two php lint checks use the new engine-free container.

  13. 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 go module.

  14. 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/go is removed.

  15. sdk/go: prepare collection runtimes through the export driver. A Go module with a +collection type 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).

  16. 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.

  17. codegen: load a collection runtime's package in a function of its own, to stay within the linter's complexity limit.

  18. 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.

  19. 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_restart failed. The plugins now go in a fixed order.

  20. 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.

  21. codegen: format each generated Go file once, about 0.1 s off each later module load.

  22. codegen: read a driver-loaded package's module from its go.mod instead of the module cache.

  23. sdk/go: ask for a silent session when log output is discarded.

  24. dagui: take an ended span in without scanning its ancestors' running spans and intervals.

  25. 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.

  26. engine-lab, mcp-lab, sdl-diff: build their Go tools with dagger/go, each from a directory of its own, instead of go build with Go cache volumes. sdl-diff's go-mod and go-build cache volumes go.

  27. 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.

  28. dagger-dev: build the protoc plugins with dagger/go instead of go install.

  29. 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.

  30. 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.

  31. dagger-dev: drop protoc-gen-go-grpc from goBase: nothing in the repository uses it.

  32. 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.

  33. dagql: walk a result's ancestors without allocating per ancestor.

  34. 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.

  35. engine/snapshots: reuse layer read-ahead chunks across layers, instead of a new megabyte per part.

  36. dagql: skip the install spans of ancestors that own no closure. The span links are exactly as before.

  37. engine/snapshots: leave the image's in-place blobs out of snapshot sizes, so pruning doesn't count disk the engine doesn't use.

  38. engine/snapshots: hold the read-ahead test to a chunk per apply, under the race detector CI uses.

  39. 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.

  40. 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.

  41. 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.

  42. 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.

  43. 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.

  44. core: don't prebuild a Dang source this engine has already parsed.

  45. core: build a module's core typedefs while its dependencies load, instead of inside its namespacing.

  46. 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 own container() 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.

  47. 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.

  48. 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.

  49. 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.

  50. dagql: drop recordCompletePartKeys, which nothing calls.

  51. 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.

  52. 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.

  53. 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.

  54. 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.

  55. dagql: return the part reuse tests' receiver as one value (#14828's lint follow-up).

  56. dagql: name the part reuse tests' receiver apart from partReuse (#14828's compile fix for 55).

  57. 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.

  58. python-client-dev: keep the pytest tracing plugin installed, so each test gets a span.

  59. 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.

  60. 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).

  61. 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 every dagger invocation. 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.

  62. core: re-read uncommitted changes after an export; order ref deletions first.

  63. engine: move the checkout pack's metadata and bundle steps into helpers, to stay within the linter's complexity limit; no change in behavior.

  64. 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.mod declares, such as the root module's linters, can then use builds made with 1.27 instead of compiling from source. Code that imports dagger.io/dagger now needs Go 1.27.

  65. 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.

  66. 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 tidy raises 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.

  67. (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.)

  68. release: run apko through a Dang entrypoint, like the other release modules.

  69. sdk/python: run the Python SDK's runtime module through a Dang entrypoint, with go-sdk and dagger/go's per-package build.

  70. sdk/typescript: the same for the TypeScript SDK's runtime module.

  71. 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.

  72. sdk/python, sdk/typescript: move the runtime modules to Go 1.27.

  73. 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.

  74. 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.

  75. (Dropped in the rebase: main now defaults new modules to Dang 2.5 and its skill text describes 2.5's interpolation.)

  76. core: withMountedTemp(disk: true), a temp mount on the engine's disk. Container.withMountedTemp takes disk: true (from v1.0.0-beta.28, and not together with size): 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 with disk, at no change in check time, measured on burst). engine-dev starts using it once a release carries disk, so this commit alone changes nothing in CI yet.

  77. dang: give a module the description its entrypoint returns. A Dang entrypoint can declare an optional description member, as it declares prebuild; 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.

  78. 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.

  79. (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.)

  80. core: generate a workspace's independent SDK scopes at once. dagger generate used 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.

  81. 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.

  82. 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.

  83. 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 download into 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.

  84. 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.

  85. 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.

  86. 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 list and reads no module cache.

  87. 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.

  88. 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 legacy dagger.json Go module's first load makes those lookups over the network: 37–38 s against 38 s with them.

  89. 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 generate changing 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.

  90. 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.

  91. 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 -c does, 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.

  92. all: build with dagger/go's commit that plans a whole collection's member alone, the pins for commit 100.

  93. core/integration: load 111 Go test modules through go-sdk. 111 fixtures under core/integration/testdata/modules/go get 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 each dagger call'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.

  94. core/integration: expect a Go module's own manifest in TestConstructor.

  95. 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 its dagger-module.toml instead, so TestDiskPersistenceAcrossRestart still checks that a function with a contextual argument stays cached across a restart.

  96. 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_running that 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.

  97. 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-errors and the 8 terminal-* fixtures stay on the built-in Go SDK for now.

  98. 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.

  99. 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.

  100. core/integration: regenerate the go-sdk test modules on dagger/go 4674a1f6d8: one pin line in each of the 130 converted fixtures.

  101. 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 no dagger.toml by design, so the subtests that call the CLI without -m keep checking what they did.

  102. 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.

  103. core/integration: regenerate the go-sdk test modules on dagger/go a5c2efaf2c: one pin line in each of the 138 converted fixtures.

  104. 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.

  105. 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/TestAltRuntime and TestModuleDeprecationValidationErrors' TypeScript case pass again.

  106. 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 in broken-default and broken-dep-use-broken-default.

  107. engine/server: wait for the session's release before the prune in TestPruneKeepsTheImagesEntries, as other tests that release a session do.

  108. dagql: wait for a session's release before checking its reads are forgotten in TestCacheReportsPartsRead.

  109. dagql: drop the test that counts an ancestor walk's allocations (from commit 33), which failed now and then under the race detector.

  110. 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.

  111. core/integration: check that a fresh engine's first Go module load builds no tool and downloads nothing. TestBuiltinSDKFromImageEntries now 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's gohdr tool twice and made 20 downloads on that load; an image made as in commit 119 runs none of them.

  112. 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.

  113. core/integration: regenerate the go-sdk test modules on dagger/go 3fe256c: one pin line in each of the 138 converted fixtures.

  114. 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.

  115. core/integration: regenerate the go-sdk test modules on dagger/go 4beea52: one pin line in each of the 138 converted fixtures.

  116. cmd/init: drop the test that times a command between spawn and exit. 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, so on a loaded machine the test failed by a few milliseconds (195.8 and 193.7 ms in two runs in a row).

  117. 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.

  118. 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.

  119. 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.

  120. 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.

  121. core/integration: regenerate the go-sdk test modules on dagger/go f1d5c0b: one pin line in each of the 138 converted fixtures.

  122. 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 daggerGo naming 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.

  123. core/integration: regenerate the go-sdk test modules on dagger/go 79a92be: one pin line in each of the 138 converted fixtures.

  124. 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-lookup and runtime-workspace-isolation stay on the built-in Go SDK.

  125. 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.

  126. 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.

  127. core/schema: pack a host checkout whole when building on its last reconstruction fails. Building a host checkout's .git on 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.

  128. 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 of BuiltinOCIStore, beside main's telemetry server changes) and core/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/stale on 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.

Command Pairs main this PR difference
dagger check --by-release --check docs-target-version/stale (a first call that builds no dev engine) 10 16.32 s 10.04 s −6.1 s, faster in all 10
dagger check --by-rust-client --check stale 3 231.8 s 226.0 s no difference within noise
  • A module's first build is faster: the per-package build reuses package builds and the Go image that the engine image ships, where main pulls the golang image and runs a cold go build.
  • Later module builds in the same session are a little slower: about 1–1.5 s each, from traces on an earlier main, because on main they reuse a Go build cache the first module filled.
  • The rust-client check barely moves: most of it is building the dev engine from source, which engine-dev does with plain go build through .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.

  • rust-client's stale check (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.
  • The nine lint and unit checks no longer build or start a dev engine; on the head before commits 11 and 12, all nine did. Measured in this PR's CI, one run each, from each check's own span:
Check before after
python lint, format, lint-docs-snippets about 2m3s each 1.7 s each
elixir lint 2m36s 28.8 s
elixir codegen-test 1m12s 10.3 s
dotnet csharpier 3m58s 2.4 s
dotnet source-generator-test 7m32s 12.2 s
php-stan 41.9 s 4.1 s
php-code-sniffer 2m54s 1.2 s

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.

Check before commits 6–12 after schema step, before → after
rust-client/api-client/stale 315 s 136 s 3m42s → 46 s
python-client/client-library/stale 406 s 80 s 5m17s → 47 s
typescript-client/client-library/stale 262 s 62 s 3m15s → 25 s
docs/references/stale 412 s 172 s 5m35s → 2m1s
dotnet-client/test 282 s 190 s 3m39s → 28 s (it still starts the engine its tests need)
go-client/generate/stale 40 s 76 s 24.7 s → 19.6 s; the rest of the total is outside the generator
elixir-client/client-library/stale 96 s 116 s 60 s → 86 s
  • The rust, python, elixir, typescript, go and docs checks now start no service at all; before, they started one or two each.
  • Where the schema step still takes time, it is the cold build of the introspect tool.
  • elixir was slower in this run, and its trace doesn't show why. Its generator step now includes building the introspect tool, 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:

Run main before commits 13–14 after
dagger check --by-rust-client --check stale, first call 239–241 s 202–207 s 181–182 s
the same, again after an unrelated commit 74–76 s 66–67 s 64–68 s
test-split test-container shard (one run each) 425 s 420 s 397 s
test-split test-packages shard (median of two runs) 465 s 472 s 484 s
  • Tests: results were identical where compared: 598 passed and 4 skipped in test-container, 11,315 passed and 25 skipped in test-packages.
  • test-packages is about 12 s slower: each test binary is built by its own dagger/go call, and every call repeats the planning and the unpacking of modules. That is being worked on separately.
  • Go builds still outside dagger/go's per-package build, after commits 26–32: test-split's fastbolt go vet and go test -race, the tests container's go mod download and go-client-dev's dev container, in engine-dev's goEnv; and the release builds of the CLI, by goreleaser.

What changes for callers:

  • .dagger/modules/go is gone, with all its functions. The workspace never installed it as a module.
  • engine-dev has a new public function, goEnv(source, cgo).
  • engine-dev's test and its variants still take go test patterns in pkg, plus !pattern to exclude. A package named exactly whose code has no tests is now an error, where go test printed "no test files". Each package's tests run in their own exec.
  • engine-dev's tests lists the same sorted test names, read from source instead of from go test -list.
  • test-split's public field packagePatterns is gone.
  • cli-dev's base argument must still carry a Go toolchain; it now becomes dagger/go's base.
  • The codegen module (cmd/codegen) now declares engine v1.0.0-0.
  • typescript-client-dev's binary returns 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:

Check before after
typescript-client client-library/stale, after an unrelated commit 30 s 2 s
typescript-client client-library/stale, fresh engine 107 s 103 s
the four protoc generate checks, fresh engine 55 s 45–50 s
go-client test, fresh engine 164 s 158 s
  • Slower: the protoc generate checks after an unrelated commit, by 0.8–0.9 s in all five runs. engine-lab's report test on a fresh engine, by 2 s, because dagger/go compiles the race-enabled standard library.
  • Everything else measured was at par or faster.

A 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:

    main with commits 33–39 with 33–41
    one engine 9.11 s 8.75 s 8.68 s
    five engines at once, per engine 12.96 s 12.16 s 11.98 s

    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:

    • An engine upgrading from saved state wipes its cache once: the commit bumps the cache's persistence schema version, because the old built-in SDK records no longer decode.
    • A module's runtime container no longer has the baked Go module cache in its root filesystem.
    • Until the engine image build exports the SDK files on the engine it already runs on, every engine image build starts a short seed engine to export them.

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:

  • Reading a per-package Go module's functions: 0.16 s faster from commit 42 (faster in 20 of 20 pairs), then 0.02 s more from commit 45 (17 of 20).
  • A fresh dagger check -l of dagger/dagger: 0.06 s, then 0.04 s faster.
  • The built-in Go SDK's module load: about 0.2 s faster, from traces.
  • After an engine restart: 0.04 s faster (15 of 15).
  • Slower: a second listing right after the first on a fresh engine, by 0.010 s (60 pairs). A third listing, or a second after a 3 s pause, shows no cost.

Making the image's entries on the build's own engine

Commits 51–53, measured in interleaved pairs against main on spot machines:

  • The gain is engine CPU saved, not yet a shorter CI run. The 16 test shards' times, added up, are about 480 s less per run, and the engine uses about 4,900 CPU-seconds less. The shards run side by side, though, and the longest, test-base, is 31 s faster, inside its 100 s swing between runs. Each shard that loads Go modules is 8 to 95 s faster.
  • One run died, cause unknown. On a 16-CPU, 32 GB machine, a test-base run with these commits was killed after 548 s: the dagger CLI 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.
  • For users, nothing changes.

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 publish flags: --netlify-apiurl → --netlify-api-url, --hex-apikey → --hex-api-key, --hex-apiurl → --hex-api-url
  • engine-dev: with-ebpfprogs → with-ebpf-progs
  • release/gh: with-cacert → with-ca-cert
  • rust-client: apiclient → api-client, so its check is now rust-client/api-client/stale

These 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.yml passed the old release publish flags. 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.

Shard before #104 (fee7d62) download bound (3df3d12) per-run planning (3e24ef0)
test-base 680 s 695 s 593 s
test-base-extra 706 s 624 s 621 s
test-cache-persistence 320 s 528 s 422 s
test-call-and-shell 464 s 420 s 368 s
test-cli-engine 266 s 325 s 421 s
test-container 495 s 445 s 371 s
test-ebpf 228 s 291 s 129 s
test-ebpf-exec-sched 356 s 289 s 151 s
test-fastbolt 157 s 112 s 59 s
test-interface 318 s 356 s 230 s
test-llm 337 s 385 s 393 s
test-local-cache 339 s 317 s 218 s
test-module-runtimes 569 s (red) 392 s (red) 493 s (red)
test-modules 562 s (red) 664 s (red) 542 s (red)
test-packages 500 s 430 s 492 s
test-provision 459 s 417 s 290 s
test-telemetry 400 s 417 s (red) 353 s (red)
test-workspaces 451 s 371 s 336 s
  • What a shard finds cached depends on which CI engine it lands on. On a later run at the same pins (ebc450f), test-cli-engine executed 869 module downloads again and reached its first test at +156 s, and test-packages executed 369 package compiles instead of 3,553. So a slower shard in one run is not yet a cost of these commits; that needs runs on one engine we control.
  • Per-run planning works where a shard runs few packages: test-ebpf's executed package compiles fell from 1,557 to 58.
  • test-cli-engine's slowdown is mostly 871 module downloads (433 s of exec time) run cold after the pin move, on a busier engine, not its test binary (29 s against 23 s).
  • test-cache-persistence pays a tool build (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

  • Review.
  • Bitbucket's SSH host move: the SSH_Private_BitBucket cases 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.
  • One pin left on an unmerged commit: go-sdk, at a commit on go-sdk's main whose only change sets daggerGo to 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.

@sipsma
sipsma force-pushed the sipsma/go-modules-per-package-build branch from 7ee58b1 to 4b1cba7 Compare November 12, 2026 01:39
@sipsma
sipsma marked this pull request as ready for review November 12, 2026 18:46
@sipsma
sipsma requested review from a team as code owners November 12, 2026 18:46
@sipsma
sipsma requested review from a team as code owners November 12, 2026 22:51
@sipsma
sipsma force-pushed the sipsma/go-modules-per-package-build branch from c5eb30a to 4e68465 Compare November 13, 2026 00:25
@sipsma
sipsma requested a review from a team as a code owner November 13, 2026 01:30
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]>
…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]>
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]>
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]>
…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
sipsma force-pushed the sipsma/go-modules-per-package-build branch from 2787d69 to e0996ec Compare November 17, 2026 21:39
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]>
@sipsma
sipsma merged commit e363e56 into main Nov 18, 2026
97 checks passed
@sipsma
sipsma deleted the sipsma/go-modules-per-package-build branch November 18, 2026 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants