Repository navigation
VERSION files + buildinfo-based VCS info (discussion #13287) - #13313
Conversation
1e1f733 to
dfa29b4
Compare
4930c51 to
279cfcc
Compare
068cf04 to
43992fa
Compare
5991dc1 to
6fae47d
Compare
#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]>
#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]>
428c01a to
e046ccd
Compare
#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]>
e046ccd to
419f54d
Compare
419f54d to
0d114cc
Compare
0d114cc to
5c7dc48
Compare
I see. If I understand correctly, the issue is that |
|
@shykes In a way yes |
d702487 to
5f8b7ef
Compare
#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]>
5f8b7ef to
cd5b6dc
Compare
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]>
cd5b6dc to
aefc69a
Compare
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]>
bac0ac6 to
a700e58
Compare
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]>
a700e58 to
103bb31
Compare
tiborvass
left a comment
There was a problem hiding this comment.
Update:
dagger versionkeeps thevprefix.dagger versionincludes fields that were previously shown:platformandrunner-host.engine.Tagremains overrideable by release pipelines via ldflags- If
engine.Tagis empty, it is derived:- release build ->
engine.Version - dev build with commit -> commit
- dev build without commit ->
main
- release build ->
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]>
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]>
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]>
103bb31 to
5b58e5e
Compare
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]>
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]>
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]>
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]>
Implements the version/build identity foundation from discussion #13287.
This replaces the old Dagger
versionmodule 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 throughgithub.com/dagger/go/buildinfoldflags.What changes
internal/version, which embedsinternal/version/VERSIONand exposesVersion,Commit,Dirty,CommitTime, andCanonical().github.com/dagger/go/buildinfoas the wrapper aroundruntime/debug.ReadBuildInfo, with injectable-ldflagsvars for sandboxed builds./versionDagger module and stop deriving versions by walking tags, merge-bases, or source digests inside Dagger.toolchains/goto accept aGitRepositoryinput and stamp VCS metadata into binaries it builds.engine.Versionandengine.Tagas the public version surfaces used by the CLI, engine, SDK defaults, and release code.engine.Versionandengine.Tagvia ldflags.engine.Tagis not explicitly set, derive it from the build identity:engine.Versionmaindagger versionto a labeled output while preserving the existing operational fields.Output
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 buildand sandboxed Dagger builds, while preserving the existingengine.Version/engine.Tagsurfaces for callers that still rely on them.Not in this PR
VERSIONchange.Workspace.git;toolchains/gokeeps a TODO for that once available.engine.IsDevVersioncleanup beyond recognizingv1.0.0-devstyle prereleases.Refs: discussion #13287, #13074 (Workspace.git), #13086 (GitCommit proposal).