Repository navigation
Conversation
sipsma
force-pushed
the
sipsma/go-modules-dang-entrypoint
branch
2 times, most recently
from
November 5, 2026 08:45
d791080 to
a127b44
Compare
go-sdk v1.4.0 ships the Dang entrypoint generator and targets v1.0.0-beta.24. Signed-off-by: Erik Sipsma <[email protected]>
The entrypoint takes the module description from the main type's doc comment, not from the package doc comment. Signed-off-by: Yves Brissaud <[email protected]>
go-sdk refuses [[dependencies]] and [codegen] in a manifest it moves to an entrypoint; wolfi stays a client of the scope in dagger.toml. Signed-off-by: Yves Brissaud <[email protected]>
go-sdk needs go.mod in the module directory and refuses source = "dagger", so the code moves up from dagger/. The entrypoint has no module description, so the main type's doc comment carries it. Signed-off-by: Yves Brissaud <[email protected]>
The entrypoint takes the module description from the main type's doc comment, not from the package doc comment. Signed-off-by: Yves Brissaud <[email protected]>
Unified clients name the cli-dev client after its module, so the dagger-cli alias of the old manifest becomes CliDev. Core types now come from dagger.io/dagger/core, so staticcheck flags GitRef.Commit. Signed-off-by: Yves Brissaud <[email protected]>
Signed-off-by: Yves Brissaud <[email protected]>
Signed-off-by: Yves Brissaud <[email protected]>
go-sdk refuses [[dependencies]] and [codegen] in a manifest it moves to an entrypoint; alpine stays a client of the scope in dagger.toml. Signed-off-by: Yves Brissaud <[email protected]>
An entrypoint manifest cannot carry disableDefaultFunctionCaching; +cache="session" on each function keeps the per-session caching. Signed-off-by: Yves Brissaud <[email protected]>
Unified clients name the engine-dev client after its module, so the dagger-engine alias of the old manifest becomes EngineDev. Execs nest on the v1 API, so phpunit and the codegen dagger call drop the outer session to reach the dev engine, as with the v0.21.9 engineVersion. Signed-off-by: Yves Brissaud <[email protected]>
Unified clients name the engine-dev client after its module, so the dagger-engine alias of the old manifest becomes EngineDev. Execs nest on the v1 API, so cargo test drops the outer session to reach the dev engine, as with the v0.21.9 engineVersion. Signed-off-by: Yves Brissaud <[email protected]>
The v1 client exposes the ReleaseDryRun checks of cli-dev and rust-client-dev as Check objects, so the dry run reads each check's failure from Check.error. Called from an entrypoint, contextual defaults resolve against the callee's own module, so release passes the workspace root as php's and python's workspaceDir and its head as go's and php's sourceRepo. A passed directory skips the callee's +ignore, so release filters each one with a copy of the callee's pattern list. Execs nest on the v1 API, so the publish check's CLI drops the outer session to reach the dev engine. Signed-off-by: Yves Brissaud <[email protected]>
Core types now come from dagger.io/dagger/core, so staticcheck flags GitRef.Commit. Called from engine-dev or release, cli-dev's default source would resolve against its entrypoint sources, which lack cmd/dagger, so those callers pass their source. A passed directory skips the callee's +ignore, so they filter it with a copy of cli-dev's pattern list. Signed-off-by: Yves Brissaud <[email protected]>
go-sdk refuses [[dependencies]] and [codegen] in a manifest it moves to an entrypoint; the four dependencies stay clients of the scope. The v1 API of the unified client deprecates GitRef.ref in favour of name. release passes docs-dev's source, whose default would resolve against the entrypoint sources, filtered with a copy of docs-dev's +ignore list, which a passed directory skips. Signed-off-by: Yves Brissaud <[email protected]>
Signed-off-by: Yves Brissaud <[email protected]>
Signed-off-by: Yves Brissaud <[email protected]>
Signed-off-by: Yves Brissaud <[email protected]>
Signed-off-by: Yves Brissaud <[email protected]>
Signed-off-by: Yves Brissaud <[email protected]>
Signed-off-by: Yves Brissaud <[email protected]>
Signed-off-by: Yves Brissaud <[email protected]>
Signed-off-by: Yves Brissaud <[email protected]>
Signed-off-by: Yves Brissaud <[email protected]>
Signed-off-by: Yves Brissaud <[email protected]>
Signed-off-by: Yves Brissaud <[email protected]>
Signed-off-by: Yves Brissaud <[email protected]>
Signed-off-by: Yves Brissaud <[email protected]>
Signed-off-by: Yves Brissaud <[email protected]>
Signed-off-by: Yves Brissaud <[email protected]>
go-sdk v1.4.0 types every dependency's check as a Check in unified bindings (dagger/go-sdk#83), so the Python, TypeScript and Elixir dry runs now return one, as the Rust dry run already did. One helper turns a failed check into the error the release report records. Signed-off-by: Erik Sipsma <[email protected]>
Generated with `dagger generate go-sdk/generate`; a second run changes nothing. v1.4.0 targets v1.0.0-beta.24 and writes a dang.toml beside each generated entrypoint, naming that release. dagger.lock records the v1.4.0 tag and the images and helpers it uses. Signed-off-by: Erik Sipsma <[email protected]>
A generated entrypoint builds its module in the golang image its go.mod names. The migrated modules named 1.26.1, 1.26.5 and 1.26.6, so a run that calls several of them pulled three images and compiled into three separate Go caches. They now all name 1.26.6, the version the root module and the go, cli-dev and engine-dev modules already use. Signed-off-by: Erik Sipsma <[email protected]>
main updated its module dependencies and the pytest module. Keep main's lock pins where both sides pinned the same ref, and regenerate the bindings that read pytest's and python-client-dev's API. Signed-off-by: Erik Sipsma <[email protected]>
An entrypoint module pulls an image by tag in its own Dang code and in the process it starts with nesting, which is how an SDK entrypoint runs a module's code. Check that both get the digest the workspace lock pins for that tag rather than the tag's current image. Signed-off-by: Erik Sipsma <[email protected]>
sipsma
force-pushed
the
sipsma/go-modules-dang-entrypoint
branch
from
November 5, 2026 19:22
a127b44 to
ba44cd4
Compare
The workspace's go-sdk scope for python-client-dev now sets dangEntrypoint and unifiedClients to true, so the module gets a generated Dang entrypoint and unified clients like the other Go modules. Its pytest, engine-dev, wolfi and dockerd calls go through the generated clients, and its own code uses dagger.io/dagger/core instead of the global client. The Format, Lint and LintDocsSnippets checks returned a changeset or a container, which the engine refuses for a module without engineVersion. They now return an error after syncing the same work, as the engine did for them before, so they pass and fail as they did and the check list is unchanged. The manifest's dependencies become the scope's clients: pytest and dagger.io/linux/wolfi resolve to the same commits the manifest pinned, through the workspace lock. The provisioning test unsets DAGGER_SESSION_PORT and DAGGER_SESSION_TOKEN, since execs nest on the v1 API. go.mod moves to Go 1.26.6 like the other modules. Signed-off-by: Erik Sipsma <[email protected]>
Contributor
Author
|
Closing as superseded by #15080, which merged all of this PR's commits: the repository's Go modules, python-client-dev included, now run through the go-sdk Dang entrypoint on main, and the lock regression test is there too. The remaining step, regenerating the modules on Go 1.27 with |
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.
Draft: based on main. It stays a draft until per-package Go builds land in this PR and remove the fresh-engine cost described below.
Supersedes #14840 and #14905 by @eunomie, whose commits are kept here as theirs, rebased and regenerated with go-sdk v1.4.0.
What it does
15 of the repository's own Go modules get a generated Dang entrypoint, unified clients and no global client:
.dagger/modules/go,cli-dev,docs-dev,docs-dev/docusaurus,engine-dev,engine-dev/notify;php-client-dev,python-client-dev,python-client-dev/dockerd,rust-client-dev,tla-check;release,release/gh,release/registry-config;modules/git-releaser.The engine reads their types from the generated Dang file, so listing the workspace's checks no longer compiles them.
release/apkostays on the Go runtime.What it changes for users
dagger -W github.com/dagger/dagger@<commit> check -l, on one 16-CPU machine, a priming run and 2 interleaved pairs, against #15063's head:Both arms listed the same checks, plus
go-sdk generate/stalehere, which this turns back on.These were measured against #15063's head before its sparse git workspace load. Against today's main, the fresh step gains about 8 to 9 s, and the step after main moves is slower; see the known cost below.
The cost, and why this is a draft
On a fresh engine, a check that calls these modules takes longer the first time.
rust-client/apiclient/stale, on a git workspace, both arms on main's engine, one fresh engine per run, 6 interleaved pairs:Profiles of the check (critical path and CPU per exec) put the extra time in three places:
go-sdk-v2-buildvolume starts empty.rust-client-dev's first build costs 54 CPU-s cold, against 1.8 CPU-s with that volume pre-warmed. The three builds on the path (rust-client-dev,engine-dev,go) run one after another, since each module is first called by the one before.alpineandwolfibuild their legacy runtimes later, whengofirst calls them, instead of while the workspace loads../cmd/codegenrecompiles from scratch (8.5 s, 68 CPU-s), where on main it reuses the first build's work (0.6 s). The engine resolvescodegen's dependency ongo, reached throughengine-dev, without the repository's identity, so thatgogets Go cache volumes of its own, empty on a fresh engine. That engine bug predates this PR.This stays a draft until that cost is gone.
Known cost: listing after main moves
On a git workspace, listing the checks after a new commit is slower with this PR.
dagger -W github.com/dagger/dagger@main check -lafter main moves takes about 6.7 s, against main's 3.5 s. The fresh listing still gains about 8 to 9 s.The generated entrypoints read files from the repository's root Go module (
go.mod,util/parallel, …) to build their sources. Those fall outside what the engine fetches when it loads a git workspace sparsely, so each new commit checks out the whole tree. This is being fixed separately in the engine.Known issue:
e2e/helmTestInstallK3Sfrom a local checkoutFrom a local checkout,
TestInstallK3Sfails ("wait for k3s readiness: exit code: 2"). CI is green because it loads a git workspace.cli-devserves its same-repogoclient, the engine reads the tree from a path that another session's load of the same module recorded.Known flake:
go-sdk/generate/staleA generated client's enum cases come out in a different order on each generation, so
go-sdk/generate/stalecan flag python-client-dev's generated pytest client when the order differs from the committed one. CI generates with the released engine, which doesn't have the fix; the fix is in #15080. Until a release carries it, the check is rerun until it passes, and no order is committed.Behaviour changes
engineVersion, a module gets the v1 view. Execs nest, so execs that start a Dagger client unsetDAGGER_SESSION_PORTandDAGGER_SESSION_TOKEN.source,workspaceDirorsourceRepo, and filter directories with the callee's ignore list.Checkobject (fix(go): type checks as Check in unified bindings go-sdk#83). The release module's dry runs read each SDK's result from it.dang.tomlnaming v1.0.0-beta.24, which released engines ignore.go-sdk generate/staleruns again. It took about 12 minutes on a 16-CPU engine.Assumes dagger/go-sdk#76
Until a go-sdk release has #76, a failing function of these modules reaches its caller as "exit code: 2", with its message only in stderr. Regenerating with that release fixes this. It changes only the generated dispatch code, not the types that listing reads.
How it was made and checked
mainpins), then @eunomie's 29 module commits, a fix to the release module forCheck, the regeneration, the Go version commit, a regeneration after rebasing onto main, a test, and python-client-dev's move.dangEntrypointandunifiedClientstofalse(chore: update module dependencies #15056); this sets both totrue, like the other modules. Itsformat,lintandlint-docs-snippetschecks now return only an error after the same work, because the engine refuses a check that returns a value for a module withoutengineVersion. Itsgo.modmoves to Go 1.26.6 like the others; a later commit moves every module togo 1.27.LockfileSuite.TestEntrypointModuleUsesImagePinchecks that a Dang entrypoint module's image pulls follow the workspace lock's pin, both in its own code and in a process it starts with nesting, which is how the Go entrypoint runs a module's code. It runs in the base integration shards.dagger generate go-sdk/generatewith v1.0.0-beta.24. A second run changes nothing.dagger check -l,dagger generate -l --require-loadanddagger check go-sdk/generate/stale.