Open quarnster opened 8 years ago
Submodules aren't checked out by go get
either. At least with glide, you get the full vendor tree checked out in one command (glide install
/ glide get
). All the other tools I looked at recommended checking in vendor/
, which seems pretty nasty to me, but doing that would probably fix vendored go get
-ability (at least by my understanding).
Submodules aren't checked out by go get either.
The documentation says it does:
If the vendoring experiment is enabled (see 'go help gopath'), then when go get checks out or updates a Git repository, it also updates any git submodules referenced by the repository.
Oh. I wasn't aware of that. In that case, I agree that we probably don't need glide.
However, it doesn't appear to work:
$ go get github.com/limetext/lime-backend/lib
# cd .; git --git-dir=/go/path/src/github.com/limetext/lime-backend/.git submodule update --init --recursive
No submodule mapping found in .gitmodules for path 'packages'
package github.com/limetext/lime-backend/lib: exit status 1
Indeed, and that issue appears to be golang/go#12573. The workaround of go get ...
followed by go get -u ...
appears to work though.
Ok, so something glide does that submodules don't is allow you to flatten the hierarchy if packages are used by both the main package and a vendored package. If we have both, go thinks they're different versions (even if they aren't), and throws errors.
Good point, might want to open up a go bug for that if there isn't one already
Though I guess the situation isn't obvious if both packages explicitly require different versions of that same package.
In which case, the importing package should probably get the say over which version to really use. In most cases, you'd expect them to use the same version, though.
I was under the impression that regular git submodules would work for the GO15VENDOREXPERIMENT support. Any particular reason to use glide instead? It just seems to me like an extra step that then also disables vendored "go get" support...