-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
cmd/go: use version control to discover the main module's version? #29814
Comments
This would be valuable to users, but we should be really careful, and we should leverage our module verification infrastructure as much as we can. I wonder if how far we can get just with I'm not sure what the threat model is exactly, but I'd be worried about people trusting these stamps for authenticating binaries. A malicious user could rig up local VCS tools to tell cmd/go a module is pristine or is checked out from a certain tag when it really isn't. |
If that worked reliably, I agree that most end users should use that instead of |
Maybe we'll auto-bump this with a bot over time. See golang/go#37475 & golang/go#29814 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
There is a related proposal under discussion at #37475. |
Proposal #37475 is approved, so closing this as a duplicate. |
Duplicate of #37475 |
This is a follow-on to #26404 and #29228.
When a binary is build from within a module's source tree, the output from
runtime/debug.ReadBuildInfo
currently reports that module as having version(devel)
.If the source tree is a pristine checkout from a version-control system — or is within the (read-only) module cache — we could instead interrogate the version-control system to find the corresponding version or pseudo-version to embed.
However, that has a couple of caveats:
go
command vulnerabilities, so we would really like to avoid issuing VCS commands except when they are absolutely necessary.(devel)
currently provides a clue that those module-specific changes are in effect: if we were to indicate an explicit version instead, we would need to provide some way to indicate that replacements and exclusions were applied.(CC @jayconrod @rsc @hyangah)
The text was updated successfully, but these errors were encountered: