Repository navigation
Write wolfi in Dang, calling alpine lazily - #7
Merged
Merged
Conversation
The workspace installs go-sdk and generates the module with dangEntrypoint and unifiedClients. The engine then reads wolfi's types from internal/dagger/entrypoint/main.dang instead of compiling the module and running it, so loading wolfi no longer builds Go. The Go code is built only when a function is called. The alpine dependency becomes a client of the scope, at alpine's ec2076f on its sipsma/collections-line branch, and the module calls it through that client instead of the global one. The scope names the module, so the manifest keeps the name wolfi. go.mod moves to go 1.27, the version dagger/dagger's own modules use. dagger/go moves to v0.4.0, which runs the Go version go.mod names; v0.1.0 always ran Go 1.26 and refuses a go 1.27 module. Running this workspace's own checks with dagger/go v0.4.0 needs Dagger v1.0.0-beta.22 or later. go-sdk is pinned to 916c9a9 on its sipsma/collections-line branch. Loading and calling the module needs Dagger v1.0.0-beta.18 or later, for the generated entrypoint. Without an engineVersion, the module is served at the engine's own version instead of v0.21.9. Signed-off-by: Erik Sipsma <[email protected]>
alpine's client moves to 7103ac9, the head of dagger/alpine#8, where Container stacks its packages lazily and unpacks them only when the image's files are needed. alpine's API is unchanged, so only the generated client's source links change. Signed-off-by: Erik Sipsma <[email protected]>
wolfi's Go code was one function: call alpine with the Wolfi distro and the caller's packages, architecture, repositories and keys, then layer any overlay images. Calling it compiled that Go first: about 9 s on a fresh engine, before alpine's own compile could start, because wolfi's code is what calls alpine. The same function in Dang compiles nothing. Its API is the same: the container function, its arguments with their casing, descriptions and defaults, and the object's description, so callers' generated clients don't change. Unset arguments pass through unset, so alpine's defaults apply as before. alpine is pinned at its commit that unpacks packages only when an image's files are needed. The module needs Dagger v1.0.0-beta.18 or later, as alpine does. Signed-off-by: Erik Sipsma <[email protected]>
With the Go code gone, the workspace and its Go checks went too, so CI had nothing to run. A Dang module, wolfi-dev, now holds the repository's checks, installed as the workspace's main module as dagger/go installs go-dev. containerCheck builds a container with bash through the module and runs it, wanting Wolfi's os-release. overlayCheck layers an overlay image and reads its file back. Signed-off-by: Erik Sipsma <[email protected]>
vito
approved these changes
Nov 9, 2026
alpine's dependency moves from 7103ac9, the head of dagger/alpine#8, to e746b97, its merge into main. alpine's code is the same; only its go-sdk pin and generated files moved between the two. Signed-off-by: Erik Sipsma <[email protected]>
sipsma
added a commit
to dagger/dagger
that referenced
this pull request
Nov 10, 2026
wolfi moves to dagger/wolfi#7's merge and alpine to dagger/alpine#8's, in the workspace, dagger-dev and the two modules that still pin wolfi directly. wolfi is now written in Dang, with alpine as an ordinary dependency, and alpine unpacks packages only when an image's files are needed. The generated Go clients are regenerated: their APIs are the same, only their source links and the commits they name change. 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.
wolfi becomes a Dang module that calls alpine, so neither loading nor calling it compiles any Go. Before, every call first compiled wolfi's one Go function, about 9 s on a fresh engine, before alpine's own work could start.
Effect: this is part of the work in dagger/dagger#15080, which takes a fresh
dagger -W github.com/dagger/dagger@main check -lfrom 24.9 s to 6.5 s. Calling wolfi directly (containerwith nine packages, then reading the image'sPATH) on a fresh engine is about 4–5 s faster: the median and mean of six interleaved pairs, against wolfi in Go on the same alpine.The API is unchanged.
containerkeeps its arguments (packages,arch,extraRepositories,extraKeyURLs,overlays) with their types, optionality, descriptions and casing, and the object keeps its description, so callers' generated clients don't change. Unset arguments pass through unset, so alpine's defaults apply as before, and overlays still merge in order. The image is the same: the root filesystem's digest matches the Go wolfi's for nine packages, forgiton arm64, forgitwith an overlay, and with no arguments.alpine is pinned at e746b97, the merge of dagger/alpine#8 (dagger/alpine#8), which moves alpine onto go-sdk's Dang entrypoint and makes it unpack packages only when the image's files are needed.
Needs Dagger v1.0.0-beta.18 or later.
This PR first moved wolfi's Go code onto go-sdk's Dang entrypoint (with
go 1.27, dagger/go v0.4.0 and a go-sdk pin). The last commit replaces the Go code entirely, so those changes no longer apply, and with no Go code the repository no longer has Go checks, including the Go test check.