-
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: git tags with build metadata do not resolve #31713
Comments
Package func TestCompareEqual(t *testing.T) {
for _, tt := range [][]string{
{"v0.0.1-rc.1+buildmeta.1", "v0.0.1-rc.1"},
} {
// go/internal/semver.Compare
if cmp := Compare(tt[0], tt[1]); cmp != 0 {
t.Errorf("Compare(%s, %s) = %v", tt[0], tt[1], cmp)
}
}
} |
Potentially related: #28647 |
I saw this today using centos6 in our CI. It turned out updating |
@jscook2345: I can reproduce the observed behavior with (Also, if you check the |
So this is not related to git - this doesn't work on multiple environments, including |
There's also another issue we've discovered and which is currently being discussed on the Gopher slack. I don't have proof that those are related but I'm inclined to think it is. |
@aeneasr, not everyone who reads the issue tracker can or does use the Gopher slack. If there are relevant conversations happening there, please post a summary rather than (just) a link here. |
From slack:
|
The tricky thing about tags with metadata is that they can introduce ambiguity. What happens if I tag one commit as If we emit an error in case of ambiguity, then we'll have the unfortunate situation that an existing So I think we should probably allow |
Change https://golang.org/cl/176905 mentions this issue: |
@bcmills @jayconrod Does this change mean any previously working Also, would it make sense to re-open this to track updating the documentation? Perhaps a sentence or so in one or both of these two sections might be sufficient: https://golang.org/cmd/go/#hdr-Module_queries
https://golang.org/cmd/go/#hdr-Pseudo_versions
|
@thepudds, the net effect of the fix is that we mostly treat non-canonical semver tags as non-semver tags (resolving them to pseudo-versions, which are what we actually write to the file). We do use the non-canonical semver tag as the base version for the computed pseudo-version, but I think we already did that before anyway. (If you named the commit rather than the tag, you would have gotten the same pseudo-version as a result.) |
I thought about how to update the documentation for this change, but (especially given the low prevalence of build metadata on source code in the wild) I don't think the marginal clarity of the documentation is worth the marginal distraction of mentioning it. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Despite all of those tags being available, it seems that tags build metadata is not resolving.
What did you expect to see?
I expected the dependencies to resolve.
What did you see instead?
The dependencies did not resolve.
The text was updated successfully, but these errors were encountered: