make "garble version" friendlier for devel builds
The proposal at https://go.dev/issue/50603 has been approved, so Go will at some point start producing module pseudo-versions even if the main module was built from a VCS clone. To not wait until a future release like Go 1.20, implement that ourselves with the help of module.PseudoVersion. The result is a friendlier version output; what used to be $ go install && garble version mvdan.cc/garble (devel) Build settings: [...] will now look like $ go install && garble version mvdan.cc/garble v0.0.0-20220505210747-22e3d30216be Build settings: [...] Note that we don't use VCS tags in any way, so the prefix is hard-coded as v0.0.0. That seems fine for development builds, and Go doesn't embed VCS tag information in binaries anyway. Finally, note that we start printing the module sum, as it's redundant. The VCS commit hash, at least in git, should be unique enough.pull/534/head
parent
61bd95bb89
commit
1a3d7868d9
Loading…
Reference in New Issue