fix(version): report module version for go install #24
No reviewers
Labels
No labels
area/engine
clarity/clear
enhancement
security
size/M
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
basepeak-ai/gptscript!24
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/version-from-buildinfo"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
go install git.basepeak.dev/basepeak-ai/gptscript@v0.9.10builds a binary that reportsgptscript version v0.0.0-dev, because only goreleaser setsversion.Tagvia ldflags.This falls back to the main module version from
debug.ReadBuildInfo()when the tag is still the default. Release builds (ldflags) are unchanged; localgo build(module version(devel)) keepsv0.0.0-dev.Tested with a table test for
resolveTag(ldflags wins, go-install module version,(devel), no build info).go vet/ golangci-lint clean on the package.Review follow-up: since Go 1.24,
go buildin a checkout stamps a pseudo-version (with+dirty) into the build info, so the first version doubled the commit suffix for local/make buildbuilds. The fallback now only applies when the build info has novcs.revision(module-cachego installbuilds); added a test for the checkout case. Release builds (ldflags) andgo install @vX/@branchverified unchanged.