-
Notifications
You must be signed in to change notification settings - Fork 84
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
gobin: always report the main version in Package.Version #1478
base: main
Are you sure you want to change the base?
Conversation
Links: |
To be explicit, the issue is not something that will affect clair once it starts to use go1.24, it's that behaviour will change when we're detecting things built with go1.24, which is imminently. The behaviour change isn't necessarily "breaking", it just means we'll potentially match more things. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah that's what this is referring to:
The go build command now sets the main module’s version in the compiled binary based on the version control system tag and/or commit. A +dirty suffix will be appended if there are uncommitted changes. Use the -buildvcs=false flag to omit version control information from the binary.
https://tip.golang.org/doc/go1.24#go-command
I also see golang/go#50603 referenced in gobin/gobin.go at the very top. Can we adjust the comment based on the new changed?
Can you also give some examples of how this changes things? What did we see in the past and what will we now see with things built with go1.24? |
c7ceeb6
to
8eabd0a
Compare
I added a new comment with an example, do you mean add a comment to the PR? |
Go 1.24 changes the way in which the main module's version is reported when the module is build via `go build`. What used to be just reported as `(devel)` will now be reported as the version + revision info (+dirty if status is uncommitted) unless the -buildvcs=false is set. All this means that the unit tests failed as the expected `(devel)` version wasn't found and instead "" was reported because the gobin detector doesn't set any version if the Version was parseable (this isn't a big deal because the matching always works of NormalizedVersion which is always set). This change always adds the Version and the test checks the Version with the same regex `ParseVersion` uses. Signed-off-by: crozzy <[email protected]>
8eabd0a
to
f775696
Compare
Go 1.24 changes the way in which the main module's version is reported when the module is build via
go build
. What used to be just reported as(devel)
will now be reported as the version + revision info (+dirty if status is uncommitted) unless the -buildvcs=false is set. All this means that the unit tests failed as the expected(devel)
version wasn't found and instead "" was reported because the gobin detector doesn't set any Version if the main module's version was parseable (this isn't a big deal because the matching always works of NormalizedVersion which is always set). This change always adds the Version and the test checks the Version with the same regexParseVersion
uses.