-
-
Notifications
You must be signed in to change notification settings - Fork 243
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
Pop doesn't build with vgo #109
Comments
Related to gobuffalo/buffalo#1074 /cc @rsc |
This is what I see on github.com/gobuffalo/pop:
If Gopkg.lock exists, then vgo assumes it lists the right versions to use when bootstrapping a go.mod. But in this repo (at least on master, which is what "go get" downloaded for me), Gopkg.lock says to use github.com/mattn/anko@d5441ca3f0c, but that commit did not have a "core" package, so the import in github.com/gobuffalo/pop/fizz of github.com/mattn/anko/core fails during "vgo build". If I run
If I remove Gopkg.lock before running vgo build, then I do get your assignment mismatch error in pop/associations. The dep config has valuable information in it - vgo needs it to understand your intended start state. In general if you find that vgo build is not working but you were happy with dep, then you should be able to
to convert over to vgo. |
The Gopkg.lock is broken if you use it with dep without an automatic update: ``` $ git clone https://github.com/gobuffalo/pop Cloning into 'pop'... remote: Counting objects: 5500, done. remote: Compressing objects: 100% (14/14), done. remote: Total 5500 (delta 6), reused 12 (delta 5), pack-reused 5481 Receiving objects: 100% (5500/5500), 4.47 MiB | 13.12 MiB/s, done. Resolving deltas: 100% (3129/3129), done. $ cd pop $ dep ensure -vendor-only $ go build fizz/bubbler.go:31:30: cannot use "github.com/gobuffalo/pop/vendor/github.com/mattn/anko/vm".NewEnv() (type *"github.com/gobuffalo/pop/vendor/github.com/mattn/anko/vm".Env) as type *"github.com/mattn/anko/vm".Env in argument to core.Import $ ``` This CL fixes the Gopkg.lock: ``` $ dep ensure $ go build $ ``` Fixes gobuffalo#109. Fixes gobuffalo#110. Probably also gobuffalo/buffalo#1075.
The Gopkg.lock is broken if you use it with dep without an automatic update: ``` $ git clone https://github.com/gobuffalo/pop Cloning into 'pop'... remote: Counting objects: 5500, done. remote: Compressing objects: 100% (14/14), done. remote: Total 5500 (delta 6), reused 12 (delta 5), pack-reused 5481 Receiving objects: 100% (5500/5500), 4.47 MiB | 13.12 MiB/s, done. Resolving deltas: 100% (3129/3129), done. $ cd pop $ dep ensure -vendor-only $ go build fizz/bubbler.go:31:30: cannot use "github.com/gobuffalo/pop/vendor/github.com/mattn/anko/vm".NewEnv() (type *"github.com/gobuffalo/pop/vendor/github.com/mattn/anko/vm".Env) as type *"github.com/mattn/anko/vm".Env in argument to core.Import $ ``` This CL fixes the Gopkg.lock: ``` $ dep ensure $ go build $ ``` Fixes #109. Fixes #110. Probably also gobuffalo/buffalo#1075.
Even after #111 was merged vgo still can't build this correctly: $ cat go.mod
module github.com/gobuffalo/pop
$ vgo build -v
vgo: finding gopkg.in/yaml.v2 v2.2.1
vgo: finding gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
vgo: finding golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f
vgo: finding golang.org/x/net v0.0.0-20180522190444-9ef9f5bb98a1
vgo: finding github.com/pkg/errors v0.8.0
vgo: finding github.com/mattn/anko v0.0.4
vgo: finding github.com/markbates/inflect v0.0.0-20180514174915-dd7de90c06bc
vgo: finding github.com/markbates/going v0.0.0-20170113214412-0576708c56ce
vgo: finding github.com/lib/pq v0.0.0-20180523175426-90697d60dd84
vgo: finding github.com/joho/godotenv v1.2.0
vgo: finding github.com/jmoiron/sqlx v0.0.0-20180406164412-2aeb6a910c2b
vgo: finding github.com/gobuffalo/validate v1.0.0
vgo: finding github.com/gobuffalo/uuid v1.2.0
vgo: finding github.com/gobuffalo/packr v1.11.0
vgo: finding github.com/gobuffalo/makr v1.1.0
vgo: finding github.com/gobuffalo/envy v1.6.2
vgo: finding github.com/go-sql-driver/mysql v1.3.0
vgo: finding github.com/fatih/color v1.7.0
vgo: finding golang.org/x/sys v0.0.0-20180202135801-37707fdb30a5
vgo: finding github.com/mattn/go-isatty v0.0.3
vgo: finding github.com/mattn/go-colorable v0.0.9
vgo: finding github.com/cockroachdb/cockroach-go v0.0.0-20180212155653-59c0560478b7
vgo: downloading github.com/cockroachdb/cockroach-go v0.0.0-20180212155653-59c0560478b7
vgo: downloading github.com/lib/pq v0.0.0-20180523175426-90697d60dd84
vgo: downloading github.com/fatih/color v1.7.0
vgo: downloading github.com/mattn/go-colorable v0.0.9
vgo: downloading github.com/mattn/go-isatty v0.0.3
vgo: downloading github.com/go-sql-driver/mysql v1.3.0
vgo: downloading github.com/gobuffalo/envy v1.6.2
vgo: downloading github.com/joho/godotenv v1.2.0
vgo: downloading github.com/gobuffalo/makr v1.1.0
vgo: downloading github.com/markbates/inflect v0.0.0-20180514174915-dd7de90c06bc
vgo: downloading github.com/pkg/errors v0.8.0
vgo: downloading github.com/gobuffalo/packr v1.11.0
vgo: downloading github.com/gobuffalo/uuid v1.2.0
vgo: downloading github.com/mattn/anko v0.0.4
vgo: downloading github.com/jmoiron/sqlx v0.0.0-20180406164412-2aeb6a910c2b
vgo: downloading github.com/gobuffalo/validate v1.0.0
vgo: downloading github.com/markbates/going v0.0.0-20170113214412-0576708c56ce
vgo: downloading golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f
vgo: downloading golang.org/x/net v0.0.0-20180522190444-9ef9f5bb98a1
vgo: downloading gopkg.in/yaml.v2 v2.2.1
github.com/gobuffalo/pop/associations
# github.com/gobuffalo/pop/associations
associations/many_to_many_association.go:135:10: assignment mismatch: 2 variables but 1 values The problem, @rsc, that I can is MVS keeps choosing this:
when it should be:
When making the change everything compiles correctly. Some history behind that package, since I think it sheds some light on what's happening here. The package is a fork of |
If you Semantic import versioning means that v2 of github.com/gobuffalo/uuid needs to be imported as github.com/gobuffalo/uuid/v2, but this code is importing plain github.com/gobuffalo/uuid, so it only considers v1 tags. In the long term, once we've issued point releases for older Go versions so that everything will accept the /v2/ in the import path, the fix would be to change your source code to import github.com/gobuffalo/uuid/v2, and then vgo's defaults and the code would line up and all would be well. That's not something you should do today, though, since you want things to keep working with non-vgo users. The way to import the v2.0.0 tag of the (non-v2) github.com/gobuffalo/uuid module is to use a pseudo-version, in this case v0.0.0-20180207211247-3a9fb6c5c481. But you don't need to figure out that syntax. If you edit go.mod to change the chosen v1.2.0 to v2.0.0, the next vgo run will understand that you're asking for the v2.0.0 tag in a non-semantic-import-versioning repo and replace the v2.0.0 with the pseudo-version:
Instead of editing go.mod directly, it's supposed to work to run |
I submitted a fix to vgo to still convert Gopkg.lock even when there is a 1-line go.mod with only a module line. The "vgo build -v" with the 1-line go.mod should work for you now (if you |
@markbates Do you still have issues to use Pop with |
Closing as a dup of #110. |
$ vgo get -u vgo: finding github.com/cockroachdb/cockroach-go latest vgo: finding github.com/fatih/color latest vgo: finding github.com/go-sql-driver/mysql latest vgo: finding github.com/gobuffalo/envy latest vgo: finding github.com/gobuffalo/makr latest vgo: finding github.com/gobuffalo/packr latest vgo: finding github.com/gobuffalo/uuid latest vgo: finding github.com/gobuffalo/validate latest vgo: finding github.com/jmoiron/sqlx latest vgo: finding github.com/joho/godotenv latest vgo: finding github.com/lib/pq latest vgo: finding github.com/markbates/going latest vgo: finding github.com/markbates/inflect latest vgo: finding github.com/mattn/anko latest vgo: finding github.com/pkg/errors latest vgo: finding golang.org/x/net latest vgo: finding golang.org/x/sync latest vgo: finding gopkg.in/yaml.v2 latest vgo: finding github.com/mattn/go-colorable latest vgo: finding github.com/mattn/go-isatty latest vgo: finding golang.org/x/sys latest vgo: finding gopkg.in/check.v1 latest $ cat go.mod module github.com/gobuffalo/pop require ( github.com/cockroachdb/cockroach-go v0.0.0-20180212155653-59c0560478b7 github.com/fatih/color v1.7.0 github.com/go-sql-driver/mysql v1.3.0 github.com/gobuffalo/envy v1.6.2 github.com/gobuffalo/makr v1.1.0 github.com/gobuffalo/packr v1.11.0 github.com/gobuffalo/uuid v1.2.0 github.com/gobuffalo/validate v1.0.0 github.com/jmoiron/sqlx v0.0.0-20180406164412-2aeb6a910c2b github.com/joho/godotenv v1.2.0 github.com/lib/pq v0.0.0-20180523175426-90697d60dd84 github.com/markbates/going v0.0.0-20170113214412-0576708c56ce github.com/markbates/inflect v0.0.0-20180514174915-dd7de90c06bc github.com/mattn/anko v0.0.4 github.com/mattn/go-colorable v0.0.9 github.com/mattn/go-isatty v0.0.3 github.com/pkg/errors v0.8.0 golang.org/x/net v0.0.0-20180522190444-9ef9f5bb98a1 golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f golang.org/x/sys v0.0.0-20180524125335-e2c7578ad1a9 gopkg.in/check.v1 v1.0.0-20161208181325-20d25e280405 gopkg.in/yaml.v2 v2.2.1 ) $ vgo build -v github.com/gobuffalo/pop/associations # github.com/gobuffalo/pop/associations associations/many_to_many_association.go:135:10: assignment mismatch: 2 variables but 1 values
The text was updated successfully, but these errors were encountered: