-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: +dirty in version stamping doesn't combine well with +incompatible #71971
Labels
GoCommand
cmd/go
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Comments
This was referenced Feb 26, 2025
xnox
added a commit
to xnox/grype
that referenced
this issue
Feb 26, 2025
go1.24.0 stamps versions with `+incompatible+dirty` which is an invalid SemVer version. Add a fixup to correct this to SemVer compliant buildinfo version of `+incompatible.dirty` with a test case. Related: - golang/go#71971 - anchore#2482
xnox
added a commit
to xnox/grype
that referenced
this issue
Feb 26, 2025
go1.24.0 stamps versions with `+incompatible+dirty` which is an invalid SemVer version. Add a fixup to correct this to SemVer compliant buildinfo version of `+incompatible.dirty` with a test case. Related: - golang/go#71971 - anchore#2482 Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@surgut.co.uk>
Created a patch to make the generated version semver compliant: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
GoCommand
cmd/go
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Go version
go1.24
Output of
go env
in your module/workspace:What did you do?
Build pulumi with main module version
v3.152.0+incompatible+dirty
from pulumi projectSuch version is not a valid semver as per semver spec & regex, as only a single + suffix allowed; which must be followed by not-dot-character and then additional characters.
What did you see happen?
It creates +incompatible+dirty + vcs.modified=true fields. The +dirty is entirely redundant, no? given that vcs.modified=true already exists to specify +dirty
What did you expect to see?
I expect for the module version to be:
v3.152.0+incompatible
without+dirty
suffix which is already encoded in vcs.modified=true. Or alternatively as+incompatible.dirty
see below.Such that go module version generate still passes the semver spec regex as seen at:
https://github.com/anchore/go-version/blob/main/version.go#L28
Alternatively the identifiers must be dot separated, from https://semver.org/#spec-item-10:
Thus correct semver with incompatible & dirty build metadata should be:
v3.152.0+incompatible.dirty
The text was updated successfully, but these errors were encountered: