Skip to content

Instantly share code, notes, and snippets.

@freeformz
Last active May 25, 2016 19:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freeformz/ae8471e8ef71344b8f1b6708725dd966 to your computer and use it in GitHub Desktop.
Save freeformz/ae8471e8ef71344b8f1b6708725dd966 to your computer and use it in GitHub Desktop.
Glide Issues

Glide didn't save all deps of github.com/mattes/migrate when it was glide get github.com/mattes/migrate'd.

!!
 !!    'GOVERSION' isn't set, defaulting to 'go1.6'
 !!
 !!    Run 'heroku config:set GOVERSION=goX.Y' to set the Go version to use
 !!    for future builds
 !!
-----> Installing go1.6.2... done
-----> Installing glide v0.10.2... done
-----> Fetching any unsaved dependencies (glide install)
[INFO] Downloading dependencies. Please wait...
[INFO] Fetching updates for github.com/mattes/migrate.
[INFO] Fetching updates for github.com/heroku/slog.
[INFO] Downloading dependencies. Please wait...
[INFO] Setting references.
[INFO] Setting version for github.com/heroku/slog to 7746152d93404575df4efa59a29adb8c168c464a.
[INFO] Setting version for github.com/mattes/migrate to ce1b59bb819416ca67422929b1cb48bb342720b6.
-----> Running: go install -v -tags heroku . github.com/heroku/fixture/vendor/github.com/mattes/migrate
vendor/github.com/mattes/migrate/main.go:13:2: cannot find package "github.com/fatih/color" in any of:
	/tmp/test1gQZC/.heroku/go/src/github.com/heroku/fixture/vendor/github.com/fatih/color (vendor tree)
	/tmp/testKRkp8/go1.6.2/go/src/github.com/fatih/color (from $GOROOT)
	/tmp/test1gQZC/.heroku/go/src/github.com/fatih/color (from $GOPATH)
vendor/github.com/mattes/migrate/driver/mysql/mysql.go:14:2: cannot find package "github.com/go-sql-driver/mysql" in any of:
	/tmp/test1gQZC/.heroku/go/src/github.com/heroku/fixture/vendor/github.com/go-sql-driver/mysql (vendor tree)
	/tmp/testKRkp8/go1.6.2/go/src/github.com/go-sql-driver/mysql (from $GOROOT)
	/tmp/test1gQZC/.heroku/go/src/github.com/go-sql-driver/mysql (from $GOPATH)
vendor/github.com/mattes/migrate/driver/cassandra/cassandra.go:11:2: cannot find package "github.com/gocql/gocql" in any of:
	/tmp/test1gQZC/.heroku/go/src/github.com/heroku/fixture/vendor/github.com/gocql/gocql (vendor tree)
	/tmp/testKRkp8/go1.6.2/go/src/github.com/gocql/gocql (from $GOROOT)
	/tmp/test1gQZC/.heroku/go/src/github.com/gocql/gocql (from $GOPATH)
vendor/github.com/mattes/migrate/driver/postgres/postgres.go:10:2: cannot find package "github.com/lib/pq" in any of:
	/tmp/test1gQZC/.heroku/go/src/github.com/heroku/fixture/vendor/github.com/lib/pq (vendor tree)
	/tmp/testKRkp8/go1.6.2/go/src/github.com/lib/pq (from $GOROOT)
	/tmp/test1gQZC/.heroku/go/src/github.com/lib/pq (from $GOPATH)
vendor/github.com/mattes/migrate/driver/sqlite3/sqlite3.go:13:2: cannot find package "github.com/mattn/go-sqlite3" in any of:
	/tmp/test1gQZC/.heroku/go/src/github.com/heroku/fixture/vendor/github.com/mattn/go-sqlite3 (vendor tree)
	/tmp/testKRkp8/go1.6.2/go/src/github.com/mattn/go-sqlite3 (from $GOROOT)
	/tmp/test1gQZC/.heroku/go/src/github.com/mattn/go-sqlite3 (from $GOPATH)

I had to fetch and re-push several times, repeating the process until go didn't need any more packages.

glide list is "broken". Arguably it's not since the help says it only reports imports that have "code references", which is the case here.

$ glide list
[INFO] Sorting...
INSTALLED packages:
	github.com/heroku/slog
$ cat glide.yaml
package: github.com/heroku/fixture
import:
- package: github.com/heroku/slog
- package: github.com/mattes/migrate
- package: github.com/fatih/color
- package: github.com/go-sql-driver/mysql
- package: github.com/gocql/gocql
- package: github.com/lib/pq
- package: github.com/mattn/go-sqlite3
- package: github.com/golang/snappy
- package: github.com/hailocab/go-hostpool
- package: golang.org/x/net
  subpackages:
  - context
- package: gopkg.in/inf.v0
$ cat glide.lock
hash: 305ab5db23b208747f5f7659ee159beae12ce993018914897acd61ccf5fcac47
updated: 2016-05-25T11:42:16.044602286-07:00
imports:
- name: github.com/fatih/color
  version: 533cd7fd8a85905f67a1753afb4deddc85ea174f
- name: github.com/go-sql-driver/mysql
  version: 7ebe0a500653eeb1859664bed5e48dec1e164e73
- name: github.com/gocql/gocql
  version: 7218e81e87ca6f3d2285c56e0aae80bc0d8fb655
- name: github.com/golang/snappy
  version: d6668316e43571d7dde95be6fd077f96de002f8b
- name: github.com/hailocab/go-hostpool
  version: e80d13ce29ede4452c43dea11e79b9bc8a15b478
- name: github.com/heroku/slog
  version: 7746152d93404575df4efa59a29adb8c168c464a
- name: github.com/lib/pq
  version: ee1442bda7bd1b6a84e913bdb421cb1874ec629d
- name: github.com/mattes/migrate
  version: ce1b59bb819416ca67422929b1cb48bb342720b6
- name: github.com/mattn/go-sqlite3
  version: 38ee283dabf11c9cbdb968eebd79b1fa7acbabe6
- name: golang.org/x/net
  version: 0c607074acd38c5f23d1344dfe74c977464d1257
  subpackages:
  - context
- name: gopkg.in/inf.v0
  version: 3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4
devImports: []

To even run glide name you have to have go installed.

doesn't unpack vendored vendor folders.

-----> Running: go install -v -tags heroku . github.com/heroku/fixture/vendor/github.com/mattes/migrate
github.com/heroku/fixture/vendor/github.com/heroku/slog
github.com/heroku/fixture/vendor/github.com/fatih/color/vendor/github.com/mattn/go-colorable
github.com/heroku/fixture/vendor/github.com/fatih/color/vendor/github.com/mattn/go-isatty
github.com/heroku/fixture
github.com/heroku/fixture/vendor/github.com/fatih/color
github.com/heroku/fixture/vendor/github.com/mattes/migrate/migrate/direction
github.com/heroku/fixture/vendor/github.com/mattes/migrate/file
github.com/heroku/fixture/vendor/github.com/mattes/migrate/driver
github.com/heroku/fixture/vendor/github.com/mattes/migrate/driver/bash
github.com/heroku/fixture/vendor/github.com/gocql/gocql/internal/lru
github.com/heroku/fixture/vendor/github.com/gocql/gocql/internal/murmur
github.com/heroku/fixture/vendor/github.com/gocql/gocql/internal/streams
github.com/heroku/fixture/vendor/github.com/golang/snappy
github.com/heroku/fixture/vendor/github.com/hailocab/go-hostpool
github.com/heroku/fixture/vendor/golang.org/x/net/context
github.com/heroku/fixture/vendor/gopkg.in/inf.v0
github.com/heroku/fixture/vendor/github.com/go-sql-driver/mysql
github.com/heroku/fixture/vendor/github.com/gocql/gocql
github.com/heroku/fixture/vendor/github.com/mattes/migrate/driver/mysql
github.com/heroku/fixture/vendor/github.com/lib/pq/oid
github.com/heroku/fixture/vendor/github.com/lib/pq
github.com/heroku/fixture/vendor/github.com/mattes/migrate/driver/postgres
github.com/heroku/fixture/vendor/github.com/mattn/go-sqlite3
github.com/heroku/fixture/vendor/github.com/mattes/migrate/driver/cassandra
github.com/heroku/fixture/vendor/github.com/mattes/migrate/pipe
github.com/heroku/fixture/vendor/github.com/mattes/migrate/migrate
github.com/heroku/fixture/vendor/github.com/mattes/migrate/driver/sqlite3
github.com/heroku/fixture/vendor/github.com/mattes/migrate

glide get stores the entire repo into vendor.

  1. This makes using ./... at the top level harder for the user than it needs to be as additional, possibly unused packages and tests are copied into vendor
  2. vcs stuff is also copied by default.

This is by design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment