GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — VERSION files + buildinfo-based VCS info (discussion #13287) by shykes · Pull Request #13313 · dagger/dagger

Conversation

@shykes

@shykes shykes commented Jun 3, 2026 •
edited by tiborvass
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Implements the version/build identity foundation from discussion #13287.

This replaces the old Dagger version module and its git-tag-walking logic with build identity embedded in the binaries themselves. Native Go builds use the VCS metadata already stamped by the Go toolchain; sandboxed Dagger Go builds inject the same metadata through github.com/dagger/go/buildinfo ldflags.

What changes

  • Add internal/version, which embeds internal/version/VERSION and exposes Version, Commit, Dirty, CommitTime, and Canonical().
  • Add github.com/dagger/go/buildinfo as the wrapper around runtime/debug.ReadBuildInfo, with injectable -ldflags vars for sandboxed builds.
  • Remove the standalone /version Dagger module and stop deriving versions by walking tags, merge-bases, or source digests inside Dagger.
  • Teach toolchains/go to accept a GitRepository input and stamp VCS metadata into binaries it builds.
  • Keep engine.Version and engine.Tag as the public version surfaces used by the CLI, engine, SDK defaults, and release code.
  • Keep release pipelines able to override engine.Version and engine.Tag via ldflags.
  • If engine.Tag is not explicitly set, derive it from the build identity:
    • release build -> engine.Version
    • dev build with commit -> commit
    • dev build without commit -> main
  • Change dagger version to a labeled output while preserving the existing operational fields.

Output

$ dagger version
version:     v0.21.3
commit:      3059ea74
dirty:       yes
platform:    linux/amd64
runner-host: image://registry.dagger.io/engine:v0.21.3

$ dagger version -q
v0.21.3+3059ea74.dirty

Why

The old version path mixed several responsibilities: user-facing version strings, engine image tags, git history inspection, source digests, and release metadata. That made version calculation slower, harder to reason about, and dependent on Dagger runtime behavior even though the result is fundamentally build identity.

This PR moves build identity to the binary build step, where Go already has a standard mechanism for VCS metadata. The same identity model now works for native go build and sandboxed Dagger builds, while preserving the existing engine.Version / engine.Tag surfaces for callers that still rely on them.

Not in this PR

  • No release-by-promotion redesign or release manifest work.
  • No Helm chart VERSION change.
  • No SDK migration work beyond regenerated bindings needed for this branch.
  • No switch to Workspace.git; toolchains/go keeps a TODO for that once available.
  • No commit-time injection beyond what is already available from Go build info.
  • No broader engine.IsDevVersion cleanup beyond recognizing v1.0.0-dev style prereleases.

Refs: discussion #13287, #13074 (Workspace.git), #13086 (GitCommit proposal).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tiborvass
tiborvass force-pushed the better-version-strings branch 3 times, most recently from 1e1f733 to dfa29b4 Compare June 4, 2026 16:41
@dagger-codex
dagger-codex Bot force-pushed the better-version-strings branch 2 times, most recently from 4930c51 to 279cfcc Compare June 4, 2026 18:36
@dagger-codex dagger-codex Bot mentioned this pull request Jun 4, 2026
fix: preserve workspace check scale-out context #13329
Merged
@dagger-codex
dagger-codex Bot force-pushed the better-version-strings branch 8 times, most recently from 068cf04 to 43992fa Compare June 9, 2026 20:05
@tiborvass
tiborvass force-pushed the better-version-strings branch 2 times, most recently from 5991dc1 to 6fae47d Compare June 10, 2026 05:46
This was referenced Jun 18, 2026
version: derive dev versions from git workspace state #13278
Closed
CI: simplify release version bumps #13062
Closed
ci: simplify version management #13505
Merged
shykes added a commit that referenced this pull request Jun 18, 2026
@shykes
fix(release): drop stale cliDevOpts.ImageTag reference
428c01a
#13313 removed cli-dev's imageTag arg but left this dangling ref, so
release didn't build. Isolated so it can drop if fixed upstream.

Signed-off-by: Solomon Hykes <[email protected]>
shykes added a commit that referenced this pull request Jun 18, 2026
@shykes
fix(release): drop stale cliDevOpts.ImageTag reference
e046ccd
#13313 removed cli-dev's imageTag arg but left this dangling ref, so
release didn't build. Isolated so it can drop if fixed upstream.

Signed-off-by: Solomon Hykes <[email protected]>
@shykes
shykes force-pushed the better-version-strings branch from 428c01a to e046ccd Compare June 18, 2026 10:46
shykes added a commit that referenced this pull request Jun 18, 2026
@shykes
fix(release): drop stale cliDevOpts.ImageTag reference
419f54d
#13313 removed cli-dev's imageTag arg but left this dangling ref, so
release didn't build. Isolated so it can drop if fixed upstream.

Signed-off-by: Solomon Hykes <[email protected]>
@shykes
shykes force-pushed the better-version-strings branch from e046ccd to 419f54d Compare June 18, 2026 15:00
@shykes shykes mentioned this pull request Jun 18, 2026
Inject git commit info in CLI build #13508
Merged
@shykes
shykes force-pushed the better-version-strings branch from 419f54d to 0d114cc Compare June 18, 2026 17:33
@shykes
shykes marked this pull request as ready for review June 18, 2026 18:20
@shykes
shykes requested a review from a team as a code owner June 18, 2026 18:20
@shykes
shykes force-pushed the better-version-strings branch from 0d114cc to 5c7dc48 Compare June 18, 2026 18:20
@shykes

shykes commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

The publish-with-mock-endpoints test takes --tag v0.21.7 as the intended release version (which during an actual release would come from the git tag input), publishes the engine image under that tag, then verifies the binary inside advertises the same version via dagger-engine --version; right now that fails because --tag only affects image tags, while the binary version comes from embedded internal/version/VERSION, so it still reports v1.0.0-dev <commit>.

The possible fixes are either:

  1. reintroduce a build-time override, preferably a single internal/version ldflag rather than separate engine.Version/engine.Tag
  2. rewrite VERSION during release, which would require a clean on-the-fly commit to avoid dirty VCS metadata
  3. redesign release so the published tag is derived from the built artifact’s advertised version instead of being supplied as input.

I see.

If I understand correctly, the issue is that release does not use version, it bypasses it to read the git tag information itself - violating DRY?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tiborvass

tiborvass commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

@shykes In a way yes toolchains/engine-dev/build.Builder.goWithSource was injecting engine.Version and engine.Tag ldflags, and 2 other places were doing that too (cli-dev, engine-dev.test)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tiborvass
tiborvass force-pushed the better-version-strings branch from d702487 to 5f8b7ef Compare June 19, 2026 21:52
tiborvass pushed a commit that referenced this pull request Jun 29, 2026
@shykes @tiborvass
fix(release): drop stale cliDevOpts.ImageTag reference
08c3d6e
#13313 removed cli-dev's imageTag arg but left this dangling ref, so
release didn't build. Isolated so it can drop if fixed upstream.

Signed-off-by: Solomon Hykes <[email protected]>
@tiborvass
tiborvass force-pushed the better-version-strings branch from 5f8b7ef to cd5b6dc Compare June 29, 2026 16:32
tiborvass pushed a commit to tiborvass/dagger that referenced this pull request Jul 1, 2026
@shykes @tiborvass
fix(release): drop stale cliDevOpts.ImageTag reference
e525b8e
dagger#13313 removed cli-dev's imageTag arg but left this dangling ref, so
release didn't build. Isolated so it can drop if fixed upstream.

Signed-off-by: Solomon Hykes <[email protected]>
@tiborvass
tiborvass force-pushed the better-version-strings branch from cd5b6dc to aefc69a Compare July 1, 2026 22:06
@shykes @tiborvass
internal/version: add embedded build identity
5286c37
Add an internal package that embeds VERSION and reads Go build info
via github.com/dagger/go/buildinfo. It exposes the build version,
VCS revision, dirty state, and human-readable identifiers used by
later CLI and engine wiring.

Signed-off-by: Solomon Hykes <[email protected]>
Co-authored-by: Tibor Vass <[email protected]>
Signed-off-by: Tibor Vass <[email protected]>
@tiborvass
tiborvass force-pushed the better-version-strings branch 8 times, most recently from bac0ac6 to a700e58 Compare July 2, 2026 01:13
@shykes @tiborvass
cmd/dagger: use embedded build version output
4538f60
Print the CLI version from engine.Version plus the platform and,
when available, the short VCS state from internal/version. Add
-q/--quiet for the canonical build identifier and teach installer
tests that the commit state is optional trailing data.

Signed-off-by: Solomon Hykes <[email protected]>
Co-authored-by: Tibor Vass <[email protected]>
Signed-off-by: Tibor Vass <[email protected]>
@tiborvass
tiborvass force-pushed the better-version-strings branch from a700e58 to 103bb31 Compare July 2, 2026 03:26
tiborvass
tiborvass approved these changes Jul 2, 2026
View reviewed changes

@tiborvass tiborvass left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update:

  • dagger version keeps the v prefix.
  • dagger version includes fields that were previously shown: platform and runner-host.
  • engine.Tag remains overrideable by release pipelines via ldflags
  • If engine.Tag is empty, it is derived:
    • release build -> engine.Version
    • dev build with commit -> commit
    • dev build without commit -> main

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
shykes and others added 3 commits July 1, 2026 23:29
@shykes @tiborvass
engine: derive version surfaces from build identity
55a1438
Populate engine.Version from internal/version and derive engine.Tag
from the VCS commit for dev builds while keeping release tags
version-based. Preserve the existing env override behavior and
broaden dev-version recognition for v1.0.0-dev style prereleases.

Signed-off-by: Solomon Hykes <[email protected]>
Co-authored-by: Tibor Vass <[email protected]>
Signed-off-by: Tibor Vass <[email protected]>
@shykes @tiborvass
toolchains: build binaries with embedded version metadata
3796cfb
Drop the standalone version module and its toolchain dependencies.
Use the embedded internal/version package for runtime identity,
keep release version values as publish metadata, and pass repository
VCS state through the Go toolchain so sandbox-built binaries and
test binaries can report commit and dirty state.

Signed-off-by: Solomon Hykes <[email protected]>
Co-authored-by: Tibor Vass <[email protected]>
Signed-off-by: Tibor Vass <[email protected]>
@tiborvass @shykes
chore: regenerate version metadata bindings
5b58e5e
Regenerate Dagger bindings and CLI reference output after replacing
the standalone version module with internal/version and adding
repository metadata to the Go toolchain API.

Signed-off-by: Tibor Vass <[email protected]>
Co-authored-by: Solomon Hykes <[email protected]>
Signed-off-by: Solomon Hykes <[email protected]>
@tiborvass
tiborvass force-pushed the better-version-strings branch from 103bb31 to 5b58e5e Compare July 2, 2026 06:30
@tiborvass
tiborvass merged commit 499b5fc into main Jul 2, 2026
79 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@tiborvass
tiborvass deleted the better-version-strings branch July 2, 2026 07:00
shykes added a commit that referenced this pull request Jul 2, 2026
@shykes @claude
fix(release): tolerate v-prefixed VERSION file
33dd898
PR #13313 merged the version-strings work with internal/version/VERSION
carrying a leading "v" (v1.0.0-dev), whereas this branch's release
tooling assumed a bare semver. targetVersion() validated with
semver.IsValid("v"+version), so a v-prefixed file produced "vv1.0.0-dev"
and the release pipeline failed to read its own version.

Strip an optional leading "v" on read. The version flows through the
pipeline bare and each sink (Helm, package-registry URLs) re-adds the
prefix where needed, so the file may now be bare or v-prefixed.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@vito vito mentioned this pull request Jul 2, 2026
core: support submodule and worktree checkouts for contextual git args #13577
Merged
shykes added a commit that referenced this pull request Jul 3, 2026
@shykes @claude
fix(release): tolerate v-prefixed VERSION file
f7bde9c
PR #13313 merged the version-strings work with internal/version/VERSION
carrying a leading "v" (v1.0.0-dev), whereas this branch's release
tooling assumed a bare semver. targetVersion() validated with
semver.IsValid("v"+version), so a v-prefixed file produced "vv1.0.0-dev"
and the release pipeline failed to read its own version.

Strip an optional leading "v" on read. The version flows through the
pipeline bare and each sink (Helm, package-registry URLs) re-adds the
prefix where needed, so the file may now be bare or v-prefixed.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: Solomon Hykes <[email protected]>
shykes added a commit that referenced this pull request Jul 6, 2026
@shykes
fix(release): tolerate v-prefixed VERSION file
1324274
PR #13313 merged the version-strings work with internal/version/VERSION
carrying a leading "v" (v1.0.0-dev), whereas this branch's release
tooling assumed a bare semver. targetVersion() validated with
semver.IsValid("v"+version), so a v-prefixed file produced "vv1.0.0-dev"
and the release pipeline failed to read its own version.

Strip an optional leading "v" on read. The version flows through the
pipeline bare and each sink (Helm, package-registry URLs) re-adds the
prefix where needed, so the file may now be bare or v-prefixed.

Signed-off-by: Solomon Hykes <[email protected]>
shykes added a commit that referenced this pull request Jul 6, 2026
@shykes
tolerate v-prefixed VERSION file
96a4001
PR #13313 landed internal/version/VERSION with a leading "v" (v1.0.0-dev),
but this branch's release tooling assumed a bare semver. targetVersion()
validated with semver.IsValid("v"+version), so a v-prefixed file produced
"vv1.0.0-dev" and the release pipeline failed to read its own version.

Strip an optional leading "v" on read. The version flows through the
pipeline bare and each sink (Helm, package-registry URLs) re-adds the
prefix where needed, so the file may now be bare or v-prefixed.

Signed-off-by: Solomon Hykes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tiborvass tiborvass tiborvass approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@shykes @tiborvass
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.