-
-
Notifications
You must be signed in to change notification settings - Fork 646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Report Go module version and checksum #462
Conversation
…lable. Enabled GoReleaser module proxying for verifiable builds.
@JamieEdge Sweet! Thanks a lot for this improvement and for the detailed explanation. 😄 |
Unfortunately I had to revert this change at e79354a in order to be able to release using Goreleaser. Goreleaser didn't seem to find the v3.4.0 release from the proxy despite the fact that the tag was already published to GitHub. I even retried it once. @caarlos0 Sorry for pinging you, but do you have any idea on how to try to fix this so we can try again in the next release? Here's the link to the build: https://github.com/go-task/task/runs/2371209371?check_suite_focus=true Here's the output:
|
no idea, can you check whats inside It seems that it did find the version, just not the package |
It worked now guys. Thanks @JamieEdge and @caarlos0! 🎉 |
At present, when installing Task using
go install
, the version is reported asmaster
.As of Go 1.16,
go install
uses module-aware mode by default. As a result, the module version and checksum is stored within the binary.Version Reporting
This pull request improves version reporting by reading the module version and checksum from
BuildInfo
.The
main.version
symbol remains so that a commit hash can be written when building from source usingtask install
, although it should not be written to in other build scenarios (e.g. when creating release builds). As such, to suppress the-X main.version=...
linker argument, the default GoReleaserldflags
build configuration option is overridden so that only the-s -w
flags are used.GoReleaser Verifiable Builds
Published binaries do not currently contain module version and checksum information.
To address this, the verifiable builds option of GoReleaser has been enabled, meaning that Task will be obtained from the Go modules proxy before being built. As this option does not affect snapshot builds and instead requires that a tagged commit is built, I have been unable to verify that module details are added to the build information of binaries as expected. This is something which I would advise to test before merging to the main branch, otherwise release binaries might display
unknown
as their version.