Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Incorrect branch taken on n+1 dependency #1112

@mremond

Description

@mremond

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.

  1. 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  
  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?

  1. I expect that Gopkg.lock would have used master branch as default branch without the need to add a specific constraint.

  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions