-
Notifications
You must be signed in to change notification settings - Fork 18k
x/vgo: confused by v1.1 tag in repo #23954
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
Comments
I misread this at first. Yes, it should ignore the v1.1 tag entirely, not get confused and turn it into a v1.1.0 tag. (Semver is always three numbers, and we only allow the canonical form so that there's no ambiguity about what if v1.1 and v1.1.0 are both defined.) |
@rsc And is there a workaround? |
@ngrilly It's probably not a long term solution, but if you manually change the v1.1.0 to a pseudo-version in the For example:
|
@adal-io Thanks. I ended up doing this. I think this workflow has to be improved (and documented) to maximize the adoption of vgo. |
+1 ran into the same issue with:
Using the solution from @adal-io worked. |
Also ran into this on a couple of packages/repos. I tried to apply this patch but it only worked a little. diff --git a/vendor/cmd/go/internal/semver/semver.go b/vendor/cmd/go/internal/semver/semver.go
index ecc5300..7424145 100644
--- a/vendor/cmd/go/internal/semver/semver.go
+++ b/vendor/cmd/go/internal/semver/semver.go
@@ -111,6 +111,10 @@ func Max(v, w string) string {
}
func parse(v string) (p parsed, ok bool) {
+ if v == "v1.1" || v == "v1.0" {
+ p.err = "bad bad version"
+ return
+ }
if v == "" || v[0] != 'v' {
p.err = "missing v prefix"
return
diff --git a/vendor/cmd/go/internal/semver/semver_test.go b/vendor/cmd/go/internal/semver/semver_test.go
index 7a697f6..e33ddd1 100644
--- a/vendor/cmd/go/internal/semver/semver_test.go
+++ b/vendor/cmd/go/internal/semver/semver_test.go
@@ -13,6 +13,8 @@ var tests = []struct {
in string
out string
}{
+ {"v1.0", ""},
+ {"v1.1", ""},
{"bad", ""},
{"v1-pre", ""},
{"v1+meta", ""},
All in all I must say that dealing and overwriting with (wrong) tags is quite the hurdle.. |
Whats the easiest way to get that date-string and the commit-SHA without cloning in advance? And why do we actually need the date/timestamp? Why isn't the commit sha enough? |
I'm not sure but I think it is needed to get chronological ordering? Sorting hashes alphabetical doesn't make much sense. I also think that it is quite the strain, though and wonder why this book-keeping can't be done by the tooling itself (let it lookup the commit to get the date). I hope this will also be part of the helpers that make the release zip files, etc. |
Type a commit hash (prefix) and let vgo replace it with the v0.0.0-date-hash long form.
To fit it into semver ordering properly.
It will do that if you put in a commit hash (prefix), and then it will store the full pseudo-version in the go.mod file. To be clear, the eventual expected usage is that authors tag their releases with names like v1.2.3 and then you write that instead of specific commits. The pseudo-version is a transition mechanism / last resort. It's OK that it's ugly and inconvenient; that will only encourage using real tags instead. |
This issue overall is a duplicate of #24476. |
Change https://golang.org/cl/107659 mentions this issue: |
We insist that semver tags in repos be fully spelled out, as required by semver: v1.2.0, not v1.2. In other places, like go.mod, we do allow saying v1.2 as shorthand for v1.2.0. Don't confuse the issue by reporting a "v1.2" tag in the version list, since it's unaddressable. (If you type v1.2 vgo will look for v1.2.0.) Similarly, don't report tags that don't match the module path, and don't report tags that look like pseudo-versions. Additional fix for golang/go#23954, golang/go#24476. Change-Id: Iaac0fb36362b25e5faef5271c110d432ec04bc8b Reviewed-on: https://go-review.googlesource.com/107659 Run-TryBot: Russ Cox <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]>
What version of Go are you using (
go version
)?go 1.10
vgo:2018-02-20.1
What operating system and processor architecture are you using (
go env
)?linux amd64
What did you do?
vgo get github.com/gorilla/securecookie
vgo build
What did you see instead?
vgo: finding github.com/gorilla/securecookie v1.1.0
vgo: github.com/gorilla/securecookie v1.1.0: unexpected status (https://api.github.com/repos/gorilla/securecookie/git/refs/tags/v1.1.0): 404 Not Found
I think
Maybe it's because securecookie has v1.1 and not v1.1.0 tag ?
The text was updated successfully, but these errors were encountered: