Repository navigation
Inject git commit info in CLI build - #13508
Merged
Merged
Conversation
shykes
force-pushed
the
better-version-strings
branch
from
June 18, 2026 17:33
419f54d to
0d114cc
Compare
shykes
force-pushed
the
ci-use-workspace-git
branch
from
June 18, 2026 17:33
fcf2a46 to
ac340af
Compare
shykes
force-pushed
the
better-version-strings
branch
from
June 18, 2026 18:20
0d114cc to
5c7dc48
Compare
shykes
force-pushed
the
ci-use-workspace-git
branch
from
June 18, 2026 18:20
ac340af to
ab283be
Compare
tiborvass
force-pushed
the
better-version-strings
branch
from
June 19, 2026 21:52
d702487 to
5f8b7ef
Compare
tiborvass
force-pushed
the
better-version-strings
branch
12 times, most recently
from
July 2, 2026 06:30
103bb31 to
5b58e5e
Compare
shykes
force-pushed
the
ci-use-workspace-git
branch
4 times, most recently
from
July 18, 2026 14:39
f1482db to
4c0f4ef
Compare
shykes
force-pushed
the
ci-use-workspace-git
branch
5 times, most recently
from
July 18, 2026 18:03
3b051bf to
8c6376c
Compare
dagger version
dagger version
shykes
requested review from
grouville,
kpenfound,
marcosnils,
sipsma,
tiborvass and
vito
July 18, 2026 18:20
marcosnils
force-pushed
the
ci-use-workspace-git
branch
from
July 18, 2026 18:36
c7621bf to
3b6bb71
Compare
vito
approved these changes
Jul 18, 2026
shykes
added a commit
to dagger/go
that referenced
this pull request
Jul 18, 2026
No longer needed: the dagger repo inlined its own copy (dagger/dagger#13508) and is moving to stamp VCS metadata into native build info directly. No consumers remain.
shykes
force-pushed
the
ci-use-workspace-git
branch
from
July 20, 2026 12:45
3b6bb71 to
f95951b
Compare
shykes
added a commit
to dagger/go
that referenced
this pull request
Jul 20, 2026
No longer needed: the dagger repo inlined its own copy (dagger/dagger#13508) and is moving to stamp VCS metadata into native build info directly. No consumers remain.
tiborvass
approved these changes
Jul 20, 2026
shykes
force-pushed
the
ci-use-workspace-git
branch
2 times, most recently
from
July 21, 2026 15:46
29e6631 to
627735a
Compare
Needed for Workspace.git(), which we can use to simplify and speed up our builds, and better showcase what a great Dagger setup can achieve. The diff is mostly module codegen. Signed-off-by: Solomon Hykes <[email protected]>
buildinfo is a small wrapper for injecting git metadata into a binary via -ldflags. We need it because our build runs inside the Dagger sandbox, without the full .git directory available, which breaks Go's native buildinfo. Initially we planned on making this helper available to other Go projects, so they too can sandbox their builds in Dagger without losing vcs metadata. But, we have found a better solution (instrument 'git' command to inject straight into native buildinfo - not yet implemented). We no longer plan on making the buildinfo package public. So we're inlining it here. There are no orthogonal edits - just the code move. Signed-off-by: Solomon Hykes <[email protected]>
Fix `dagger version` printing a blank commit and dirty state. The CLI and engine are built inside the Dagger sandbox, which has no .git, so the git detection `go build` normally does comes up empty. Instead, this reads the git HEAD and dirty state from the caller's Workspace and passes them to `go build` via -ldflags, matching what a native build would record. Uses the new Workspace.git() API introduced in v1.0.0-beta Signed-off-by: Solomon Hykes <[email protected]>
The previous approach stored the auto-injected Workspace as a field on EngineDev (and Builder), and passed it down to the go/cli-dev toolchains. Because a module object's cache key is its field values, holding a session-scoped Workspace tainted the cache key of *every* EngineDev method — so their build results could not be reused across a session or an engine restart. Resolve the Workspace to scalar commit/dirty values once, at the point where it is auto-injected, and thread only those strings through the toolchains. No module stores or receives a Workspace object for stamping anymore, so builds stay content-addressed. go/cli-dev gain optional vcsCommit/vcsDirty args (which take precedence over ws); dev/docs-dev/ release are unchanged and keep passing the Workspace, which is now resolved to scalars internally. Regenerated the affected dagger runtime bindings. Note: cross-restart cache persistence for git-touching builds also requires WorkspaceGit to be persistable in the dagql disk cache, fixed separately in #13700. Signed-off-by: Solomon Hykes <[email protected]>
marcosnils
force-pushed
the
ci-use-workspace-git
branch
from
July 22, 2026 19:06
627735a to
43d3c24
Compare
marcosnils
force-pushed
the
ci-use-workspace-git
branch
from
July 23, 2026 03:22
927e788 to
6dcd814
Compare
Signed-off-by: Marcos Lilljedahl <[email protected]>
marcosnils
force-pushed
the
ci-use-workspace-git
branch
from
July 23, 2026 03:38
6dcd814 to
0c1e2ad
Compare
marcosnils
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
dagger versionprinted a blank commit and dirty state:The CLI and engine are built inside the Dagger sandbox, which has no
.git. Normallygo buildrecords the commit and dirty state from the local git checkout — with no.git, that comes out empty.Solution
The Go build toolchain now reads the git HEAD and dirty state from the caller's
Workspaceand passes them togo buildvia-ldflags, matching what a native build records.Engine bump
We use
Workspace.git(), which only exists in the 1.0 engine, so the CI toolchain modules bump tov1.0.0-beta.6. Almost the entire diff is regenerated API clients from that bump, not hand-written code.Checks
test-split:test-cache-persistence— we useWorkspace.git(), which has a cache-invalidation bug. Fixed in core: make WorkspaceGit persistable in the dagql disk cache #13700 (see NOTE above).