Dep: Override ignored with specific tag

Created on 30 Aug 2017  ยท  6Comments  ยท  Source: golang/dep

Compare https://github.com/sttts/kube-vendor-test/tree/release-1.6. The override for github.com/emicklei/go-restful is ignored. Instead of 1.0.0 the v1.2 version is chosen which breaks the build.

What version of dep are you using (dep version)?

d8d1205e42cc7d51abbf194e8cd14ee14a00b266

What dep command did you run?

dep ensure -v

What did you expect to see?

Version 1.0.0 of go-restful.

What did you see instead?

Root project is "k8s.io/kube-vendor-test"
 1 transitively valid internal packages
 4 external packages imported from 4 projects
(0)   โœ“ select (root)
(1) ? attempt k8s.io/apimachinery (from github.com/sttts/apimachinery) with 1 pkgs; at least 1 versions to try
(1)     try k8s.io/apimachinery (from github.com/sttts/apimachinery)@release-1.6
(1) โœ“ select k8s.io/apimachinery (from github.com/sttts/apimachinery)@release-1.6 w/20 pkgs
(2) ? attempt github.com/emicklei/go-restful with 1 pkgs; at least 1 versions to try
(2)     try github.com/emicklei/[email protected]
(2) โœ“ select github.com/emicklei/[email protected] w/2 pkgs
(3) ? attempt github.com/go-openapi/spec with 1 pkgs; at least 1 versions to try
(3)     try github.com/go-openapi/spec@master
(3) โœ“ select github.com/go-openapi/spec@master w/1 pkgs
(4) ? attempt github.com/go-openapi/jsonpointer with 1 pkgs; at least 1 versions to try
(4)     try github.com/go-openapi/jsonpointer@master
(4) โœ“ select github.com/go-openapi/jsonpointer@master w/1 pkgs
(5) ? attempt github.com/go-openapi/jsonreference with 1 pkgs; at least 1 versions to try
(5)     try github.com/go-openapi/jsonreference@master
(5) โœ“ select github.com/go-openapi/jsonreference@master w/1 pkgs
(6) ? attempt github.com/PuerkitoBio/purell with 1 pkgs; at least 1 versions to try
(6)     try github.com/PuerkitoBio/[email protected]
(6) โœ“ select github.com/PuerkitoBio/[email protected] w/1 pkgs
(7) ? attempt github.com/PuerkitoBio/urlesc with 1 pkgs; at least 1 versions to try
(7)     try github.com/PuerkitoBio/urlesc@master
(7) โœ“ select github.com/PuerkitoBio/urlesc@master w/1 pkgs
(8) ? attempt github.com/spf13/pflag with 1 pkgs; at least 1 versions to try
(8)     try github.com/spf13/[email protected]
(8) โœ“ select github.com/spf13/[email protected] w/1 pkgs
(9) ? attempt github.com/go-openapi/swag with 1 pkgs; at least 1 versions to try
(9)     try github.com/go-openapi/swag@master
(9) โœ“ select github.com/go-openapi/swag@master w/1 pkgs
(10)  ? attempt k8s.io/client-go (from github.com/sttts/client-go) with 1 pkgs; at least 1 versions to try
(10)      try k8s.io/client-go (from github.com/sttts/client-go)@release-3.0
(10)  โœ“ select k8s.io/client-go (from github.com/sttts/client-go)@release-3.0 w/75 pkgs
(11)  ? revisit github.com/emicklei/go-restful to add 1 pkgs
(11)    โœ“ include 3 more pkgs from github.com/emicklei/[email protected]
(11)  ? revisit k8s.io/apimachinery (from github.com/sttts/apimachinery) to add 21 pkgs
(12)    โœ“ include 38 more pkgs from k8s.io/apimachinery (from github.com/sttts/apimachinery)@release-1.6
(11)  ? attempt github.com/davecgh/go-spew with 1 pkgs; at least 1 versions to try
(13)      try github.com/davecgh/[email protected]
(13)  โœ“ select github.com/davecgh/[email protected] w/1 pkgs
(12)  ? attempt github.com/docker/distribution with 1 pkgs; at least 1 versions to try
(14)      try github.com/docker/[email protected]
(14)  โœ“ select github.com/docker/[email protected] w/2 pkgs
(13)  ? attempt github.com/mailru/easyjson with 2 pkgs; at least 1 versions to try
(15)      try github.com/mailru/easyjson@master
(15)  โœ“ select github.com/mailru/easyjson@master w/3 pkgs
(14)  ? attempt github.com/ghodss/yaml with 1 pkgs; at least 1 versions to try
(16)      try github.com/ghodss/[email protected]
(16)  โœ“ select github.com/ghodss/[email protected] w/1 pkgs
(15)  ? attempt github.com/juju/ratelimit with 1 pkgs; at least 1 versions to try
(17)      try github.com/juju/ratelimit@master
(17)  โœ“ select github.com/juju/ratelimit@master w/1 pkgs
(16)  ? attempt github.com/gogo/protobuf with 2 pkgs; at least 1 versions to try
(18)      try github.com/gogo/[email protected]
(18)  โœ“ select github.com/gogo/[email protected] w/2 pkgs
(17)  ? attempt golang.org/x/net with 1 pkgs; at least 1 versions to try
(19)      try golang.org/x/net@master
(19)  โœ“ select golang.org/x/net@master w/1 pkgs
(18)  ? attempt golang.org/x/text with 2 pkgs; at least 1 versions to try
(20)      try golang.org/x/text@master
(20)  โœ“ select golang.org/x/text@master w/7 pkgs
(19)  ? revisit golang.org/x/text to add 1 pkgs
(21)    โœ“ include 8 more pkgs from golang.org/x/text@master
(19)  ? attempt gopkg.in/inf.v0 with 1 pkgs; at least 1 versions to try
(22)      try gopkg.in/[email protected]
(22)  โœ“ select gopkg.in/[email protected] w/1 pkgs
(20)  ? revisit golang.org/x/net to add 1 pkgs
(23)    โœ“ include 4 more pkgs from golang.org/x/net@master
(20)  ? attempt k8s.io/kube-aggregator (from github.com/sttts/kube-aggregator) with 1 pkgs; at least 1 versions to try
(24)      try k8s.io/kube-aggregator (from github.com/sttts/kube-aggregator)@release-1.6
(24)  โœ“ select k8s.io/kube-aggregator (from github.com/sttts/kube-aggregator)@release-1.6 w/18 pkgs
(21)  ? revisit k8s.io/apimachinery (from github.com/sttts/apimachinery) to add 6 pkgs
(25)    โœ“ include 36 more pkgs from k8s.io/apimachinery (from github.com/sttts/apimachinery)@release-1.6
(21)  ? revisit k8s.io/client-go (from github.com/sttts/client-go) to add 12 pkgs
(26)    โœ“ include 122 more pkgs from k8s.io/client-go (from github.com/sttts/client-go)@release-3.0
(21)  ? revisit k8s.io/apimachinery (from github.com/sttts/apimachinery) to add 4 pkgs
(27)    โœ“ include 15 more pkgs from k8s.io/apimachinery (from github.com/sttts/apimachinery)@release-1.6
(21)  ? attempt github.com/docker/spdystream with 1 pkgs; at least 1 versions to try
(28)      try github.com/docker/spdystream@master
(28)  โœ“ select github.com/docker/spdystream@master w/2 pkgs
(22)  ? attempt github.com/ugorji/go with 1 pkgs; at least 1 versions to try
(29)      try github.com/ugorji/go@master
(29)  โœ“ select github.com/ugorji/go@master w/1 pkgs
(23)  ? attempt github.com/google/gofuzz with 1 pkgs; at least 1 versions to try
(30)      try github.com/google/gofuzz@master
(30)  โœ“ select github.com/google/gofuzz@master w/1 pkgs
(24)  ? attempt github.com/golang/glog with 1 pkgs; at least 1 versions to try
(31)      try github.com/golang/glog@master
(31)  โœ“ select github.com/golang/glog@master w/1 pkgs
(25)  ? attempt gopkg.in/yaml.v2 with 1 pkgs; at least 1 versions to try
(32)      try gopkg.in/yaml.v2@v2
(32)  โœ“ select gopkg.in/yaml.v2@v2 w/1 pkgs
(26)  ? attempt github.com/spf13/cobra with 1 pkgs; at least 1 versions to try
(33)      try github.com/spf13/cobra@master
(33)  โœ“ select github.com/spf13/cobra@master w/1 pkgs
(27)  ? attempt k8s.io/apiserver (from github.com/sttts/apiserver) with 1 pkgs; at least 1 versions to try
(34)      try k8s.io/apiserver (from github.com/sttts/apiserver)@release-1.6
(34)  โœ“ select k8s.io/apiserver (from github.com/sttts/apiserver)@release-1.6 w/2 pkgs
(28)  ? revisit golang.org/x/net to add 1 pkgs
(35)    โœ“ include 1 more pkgs from golang.org/x/net@master
(28)  ? revisit k8s.io/apiserver (from github.com/sttts/apiserver) to add 12 pkgs
(36)    โœ“ include 62 more pkgs from k8s.io/apiserver (from github.com/sttts/apiserver)@release-1.6
(28)  ? revisit golang.org/x/net to add 3 pkgs
(37)    โœ“ include 3 more pkgs from golang.org/x/net@master
(28)  ? revisit k8s.io/client-go (from github.com/sttts/client-go) to add 9 pkgs
(38)    โœ“ include 48 more pkgs from k8s.io/client-go (from github.com/sttts/client-go)@release-3.0
(28)  ? revisit k8s.io/apimachinery (from github.com/sttts/apimachinery) to add 12 pkgs
(39)    โœ“ include 43 more pkgs from k8s.io/apimachinery (from github.com/sttts/apimachinery)@release-1.6
(28)  ? attempt github.com/coreos/etcd with 5 pkgs; at least 1 versions to try
(40)      try github.com/coreos/[email protected]
(40)  โœ“ select github.com/coreos/[email protected] w/12 pkgs
(29)  ? attempt github.com/evanphx/json-patch with 1 pkgs; at least 1 versions to try
(41)      try github.com/evanphx/json-patch@master
(41)  โœ“ select github.com/evanphx/json-patch@master w/1 pkgs
(30)  ? revisit k8s.io/client-go (from github.com/sttts/client-go) to add 1 pkgs
(42)    โœ“ include 1 more pkgs from k8s.io/client-go (from github.com/sttts/client-go)@release-3.0
(30)  ? attempt bitbucket.org/ww/goautoneg with 1 pkgs; at least 1 versions to try
(43)      try bitbucket.org/ww/goautoneg@default
(43)  โœ“ select bitbucket.org/ww/goautoneg@default w/1 pkgs
(31)  ? attempt github.com/elazarl/go-bindata-assetfs with 1 pkgs; at least 1 versions to try
(44)      try github.com/elazarl/go-bindata-assetfs@master
(44)  โœ“ select github.com/elazarl/go-bindata-assetfs@master w/1 pkgs
(32)  ? attempt github.com/pkg/errors with 1 pkgs; at least 1 versions to try
(45)      try github.com/pkg/[email protected]
(45)  โœ“ select github.com/pkg/[email protected] w/1 pkgs
(33)  ? attempt github.com/inconshreveable/mousetrap with 1 pkgs; at least 1 versions to try
(46)      try github.com/inconshreveable/[email protected]
(46)  โœ“ select github.com/inconshreveable/[email protected] w/1 pkgs
(34)  ? attempt github.com/coreos/go-semver with 1 pkgs; at least 1 versions to try
(47)      try github.com/coreos/[email protected]
(47)  โœ“ select github.com/coreos/[email protected] w/1 pkgs
(35)  ? attempt github.com/golang/protobuf with 1 pkgs; at least 1 versions to try
(48)      try github.com/golang/protobuf@master
(48)  โœ“ select github.com/golang/protobuf@master w/1 pkgs
(36)  ? attempt github.com/golang/groupcache with 1 pkgs; at least 1 versions to try
(49)      try github.com/golang/groupcache@master
(49)  โœ“ select github.com/golang/groupcache@master w/1 pkgs
(37)  ? attempt github.com/mxk/go-flowrate with 1 pkgs; at least 1 versions to try
(50)      try github.com/mxk/go-flowrate@master
(50)  โœ“ select github.com/mxk/go-flowrate@master w/1 pkgs
(38)  ? attempt github.com/coreos/go-systemd with 1 pkgs; at least 1 versions to try
(51)      try github.com/coreos/go-systemd@v15
(51)  โœ“ select github.com/coreos/go-systemd@v15 w/1 pkgs
(39)  ? attempt github.com/pborman/uuid with 1 pkgs; at least 1 versions to try
(52)      try github.com/pborman/[email protected]
(52)  โœ“ select github.com/pborman/[email protected] w/1 pkgs
(40)  ? attempt github.com/imdario/mergo with 1 pkgs; at least 1 versions to try
(53)      try github.com/imdario/[email protected]
(53)  โœ“ select github.com/imdario/[email protected] w/1 pkgs
(41)  ? attempt github.com/prometheus/client_golang with 1 pkgs; at least 1 versions to try
(54)      try github.com/prometheus/[email protected]
(54)  โœ“ select github.com/prometheus/[email protected] w/1 pkgs
(42)  ? attempt github.com/beorn7/perks with 1 pkgs; at least 1 versions to try
(55)      try github.com/beorn7/perks@master
(55)  โœ“ select github.com/beorn7/perks@master w/1 pkgs
(43)  ? attempt github.com/prometheus/client_model with 1 pkgs; at least 1 versions to try
(56)      try github.com/prometheus/client_model@master
(56)  โœ“ select github.com/prometheus/client_model@master w/1 pkgs
(44)  ? attempt github.com/howeyc/gopass with 1 pkgs; at least 1 versions to try
(57)      try github.com/howeyc/gopass@master
(57)  โœ“ select github.com/howeyc/gopass@master w/1 pkgs
(45)  ? attempt golang.org/x/crypto with 1 pkgs; at least 1 versions to try
(58)      try golang.org/x/crypto@master
(58)  โœ“ select golang.org/x/crypto@master w/1 pkgs
(46)  ? attempt github.com/prometheus/common with 2 pkgs; at least 1 versions to try
(59)      try github.com/prometheus/common@master
(59)  โœ“ select github.com/prometheus/common@master w/3 pkgs
(47)  ? attempt github.com/matttproud/golang_protobuf_extensions with 1 pkgs; at least 1 versions to try
(60)      try github.com/matttproud/[email protected]
(60)  โœ“ select github.com/matttproud/[email protected] w/1 pkgs
(48)  ? attempt github.com/prometheus/procfs with 1 pkgs; at least 1 versions to try
(61)      try github.com/prometheus/procfs@master
(61)  โœ“ select github.com/prometheus/procfs@master w/2 pkgs
(49)  ? attempt gopkg.in/natefinch/lumberjack.v2 with 1 pkgs; at least 1 versions to try
(62)      try gopkg.in/natefinch/[email protected]
(62)  โœ“ select gopkg.in/natefinch/[email protected] w/1 pkgs
(50)  ? attempt google.golang.org/grpc with 5 pkgs; at least 1 versions to try
(63)      try google.golang.org/[email protected]
(63)  โœ“ select google.golang.org/[email protected] w/15 pkgs
(51)  ? revisit golang.org/x/net to add 2 pkgs
(64)    โœ“ include 4 more pkgs from golang.org/x/net@master
(51)  ? attempt golang.org/x/sys with 1 pkgs; at least 1 versions to try
(65)      try golang.org/x/sys@master
(65)  โœ“ select golang.org/x/sys@master w/1 pkgs
(52)  ? revisit golang.org/x/sys to add 1 pkgs
(66)    โœ“ include 1 more pkgs from golang.org/x/sys@master
(52)  ? attempt google.golang.org/genproto with 1 pkgs; at least 1 versions to try
(67)      try google.golang.org/genproto@master
(67)  โœ“ select google.golang.org/genproto@master w/1 pkgs
(53)  ? revisit github.com/golang/protobuf to add 1 pkgs
(68)    โœ“ include 2 more pkgs from github.com/golang/protobuf@master
  โœ“ found solution with 357 packages from 52 projects

Solver wall times by segment:
     b-source-exists: 44.956803421s
         b-list-pkgs:  9.784373744s
              b-gmal:  7.202868625s
  b-deduce-proj-root:  1.773824477s
             satisfy:   69.524548ms
         select-atom:    66.11282ms
            new-atom:    2.719939ms
               other:     290.601ยตs
         select-root:       79.14ยตs
            add-atom:      74.961ยตs

  TOTAL: 1m3.856672276s

Writing out bitbucket.org/ww/goautoneg@default
Writing out github.com/PuerkitoBio/[email protected]
Writing out github.com/beorn7/perks@master
Writing out github.com/golang/glog@master
Writing out github.com/PuerkitoBio/urlesc@master
Writing out github.com/emicklei/[email protected]
Writing out github.com/davecgh/[email protected]
Writing out k8s.io/kube-aggregator (from github.com/sttts/kube-aggregator)@release-1.6
Writing out github.com/go-openapi/jsonreference@master
Writing out github.com/go-openapi/spec@master
Writing out github.com/coreos/[email protected]
Writing out github.com/go-openapi/swag@master
Writing out github.com/spf13/cobra@master
Writing out github.com/coreos/go-systemd@v15
Writing out github.com/coreos/[email protected]
Writing out google.golang.org/[email protected]
Writing out github.com/spf13/[email protected]
Writing out github.com/ugorji/go@master
Writing out github.com/docker/[email protected]
Writing out github.com/gogo/[email protected]
Writing out github.com/docker/spdystream@master
Writing out github.com/golang/groupcache@master
Writing out golang.org/x/crypto@master
Writing out gopkg.in/[email protected]
Writing out gopkg.in/natefinch/[email protected]
Writing out golang.org/x/sys@master
Writing out github.com/elazarl/go-bindata-assetfs@master
Writing out gopkg.in/yaml.v2@v2
Writing out golang.org/x/text@master
Writing out github.com/evanphx/json-patch@master
Writing out github.com/mxk/go-flowrate@master
Writing out github.com/ghodss/[email protected]
Writing out google.golang.org/genproto@master
Writing out github.com/prometheus/common@master
Writing out github.com/golang/protobuf@master
Writing out k8s.io/apimachinery (from github.com/sttts/apimachinery)@release-1.6
Writing out golang.org/x/net@master
Writing out github.com/prometheus/procfs@master
Writing out github.com/google/gofuzz@master
Writing out github.com/pborman/[email protected]
Writing out github.com/go-openapi/jsonpointer@master
Writing out k8s.io/apiserver (from github.com/sttts/apiserver)@release-1.6
Writing out github.com/howeyc/gopass@master
Writing out github.com/pkg/[email protected]
Writing out k8s.io/client-go (from github.com/sttts/client-go)@release-3.0
Writing out github.com/imdario/[email protected]
Writing out github.com/prometheus/[email protected]
Writing out github.com/mailru/easyjson@master
Writing out github.com/juju/ratelimit@master
Writing out github.com/prometheus/client_model@master
Writing out github.com/inconshreveable/[email protected]
Writing out github.com/matttproud/[email protected]

Most helpful comment

If Sam catches you using both overrides _and_ revision pinning... ๐Ÿ’ฅ ๐Ÿ‘€ ๐Ÿ˜‡

All 6 comments

In your Gopkg.toml, by not specifying a range operator for that dependency, dep assumes the ^ operator.

https://github.com/sttts/kube-vendor-test/blob/7a4dbe30ceb76b46c45833d092cfaa13e84615e5/Gopkg.toml#L21-L23

You have two options:

  • Check in a lock file with the currently desired version and revision for that dependency
  • If you _really_ only want to ever use 1.0.0, and disallow later upgrades to other versions, change the override to version = "=1.0.0"

@carolynvs thanks for quick reply. My fault indeed.

And not surprisingly, with =1.0.0 it does what is should :)

Wooo! I'm glad it worked. And no it's not your fault, it's a very unexpected behavior of dep that will take a while percolate into our default habits (or perhaps rethought before inclusion into go). ๐Ÿ˜€

Now I typed revision = "=<sha1>" a couple of times. So much about habits :)

If Sam catches you using both overrides _and_ revision pinning... ๐Ÿ’ฅ ๐Ÿ‘€ ๐Ÿ˜‡

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sdboyer picture sdboyer  ยท  3Comments

carolynvs picture carolynvs  ยท  3Comments

deejross picture deejross  ยท  3Comments

michael-go picture michael-go  ยท  3Comments

cemremengu picture cemremengu  ยท  3Comments