-
Notifications
You must be signed in to change notification settings - Fork 1k
Incorrect branch taken on n+1 dependency #1112
Description
What version of dep
are you using (dep version
)?
Master head from today. I tried previously with dep 0.3.0
What dep
command did you run?
I have build an exemple project.
- Commit 1.
Initial try. I did dep ensure
on the project after dep init
and changing the constraint on go_cql to a specific revision (see https://github.com/processone/dep-resolv/blob/master/Gopkg.toml#L26).
dep used the outdated branch internal_changes (the first one alphabetically) as value for branch, instead of master.
PROJECT CONSTRAINT VERSION REVISION LATEST PKGS USED
github.com/gocql/gocql * 7e9748 4
github.com/golang/snappy * branch master 553a641 553a641 1
github.com/hailocab/go-hostpool * branch internal_changes d94a633 d94a633 1
golang.org/x/net * branch master 66aacef 66aacef 1
gopkg.in/inf.v0 * v0.9.0 3887ee9 3887ee9 1
- Second stage. I added constraint on the sub dependencies:
See: processone/dep-resolv@1d6b1d3#diff-836546cc53507f6b2d581088903b1785R30
Doing dep ensure -update does nothing.
dep status is well aware of the discrepency:
$ dep status
PROJECT CONSTRAINT VERSION REVISION LATEST PKGS USED
github.com/gocql/gocql * 7e9748 4
github.com/golang/snappy * branch master 553a641 553a641 1
github.com/hailocab/go-hostpool branch master branch internal_changes d94a633 e80d13c 1
golang.org/x/net * branch master 66aacef 66aacef 1
gopkg.in/inf.v0 * v0.9.0 3887ee9 3887ee9 1
What did you expect to see?
-
I expect that Gopkg.lock would have used master branch as default branch without the need to add a specific constraint.
-
I expect adding the contraint and running go ensure -update to select the right dependency for second level dependency.
What did you see instead?
Project is stuck with outdated version of a subdependency. Only way to use the right version is to fix Gopkg.lock manually and do dep ensure.