Go: cmd/go: does not recognize gopkg.in/foo.v2-unstable

Created on 21 Feb 2018  路  7Comments  路  Source: golang/go

The ParseGopkgIn function in golang.org/x/vgo/vendor/cmd/go/internal/modfetch/gopkgin.go does not recognize import paths of the form gopkg.in/foo.v2-unstable which are considered valid by gopkg.in.

When using vgo build, it prints errors like:

    import "gopkg.in/macaroon-bakery.v2-unstable/bakery": invalid gopkg.in/ path: "gopkg.in/macaroon-bakery.v2-unstable/bakery"
FrozenDueToAge NeedsDecision modules

Most helpful comment

https://golang.org/cl/128901 fixes my issues, thanks. I can now checkout github.com/juju/juju and go mod init; go mod tidy works first time. 175 modules!

All 7 comments

Blocked on #24099.

How widely used are -unstable suffixes?
They're not documented on gopkg.in's page. I see them in the source code, and it looks like v2-unstable includes tags like v2.1.3-unstable but not v2.1.3. Given that it's unstable it's not going to play well with semantic import versioning, though.

What's the relationship between work on v2 and v2-unstable? Does all the v2-unstable happen, then the API stabilizes, then it moves to v2? Or does each new change to v2 somehow start on v2-unstable?

/cc @rogpeppe @niemeyer

How widely used are -unstable suffixes?

More widely used than I'd prefer. We're trying to move away from them but we still have large quantities of code that are going to take a long time to do that (some might never succeed).

Given that it's unstable it's not going to play well with semantic import versioning, though.

In that respect, I guess it's like any pre-release version tag (from semver.org: "A pre-release version indicates that the version is unstable and might not satisfy the intended compatibility requirements as denoted by its associated normal version.").

What's the relationship between work on v2 and v2-unstable? Does all the v2-unstable happen, then the API stabilizes, then it moves to v2?

Yes, that's how it works.

Note that in current master the error message no longer tells that this syntax of gopkg.in URLs is not allowed:

% go get gopkg.in/alecthomas/kingpin.v3-unstable
go get gopkg.in/alecthomas/kingpin.v3-unstable: cannot find module providing package gopkg.in/alecthomas/kingpin.v3-unstable

Change https://golang.org/cl/128901 mentions this issue: cmd/go: fix handling of gopkg.in/macaroon-bakery.v2-unstable

https://golang.org/cl/128901 fixes my issues, thanks. I can now checkout github.com/juju/juju and go mod init; go mod tidy works first time. 175 modules!

Was this page helpful?
0 / 5 - 0 ratings