tools / godep

dependency tool for go
http://godoc.org/github.com/tools/godep
BSD 3-Clause "New" or "Revised" License
5.54k stars 455 forks source link

godep update adds dependencies' vendor directories #498

Open bhcleek opened 8 years ago

bhcleek commented 8 years ago

Expected behavior

godep update does not add the updated dependencies' vendored dependencies.

Actual behavior

godep update vendors dependencies' vendored dependencies.

Step 2 (correctly) does not create $GOPATH/src/bar/vendor/foo/vendor/quux, but step 3 does.

Steps to reproduce behavior

With this tree:

$GOPATH/src/
  foo/
    vendor/
        quux/
          quux.go
    foo.go
  bar/
    bar.go

And assuming that bar imports foo,

  1. cd $GOPATH/src/bar
  2. godep save
  3. godep update foo

    godep version output

godep v74 (darwin/amd64/go1.6.2)

go version output

go version go1.6.2 darwin/amd64

dvcrn commented 8 years ago

I am also not sure whether this is normal beahvior or a bug. Is godep update supposed to vendor the vendor of the vendor?

freeformz commented 8 years ago

No, this is a bug.

On Wed, Aug 10, 2016 at 1:24 AM David Mohl notifications@github.com wrote:

I am also not sure whether this is normal beahvior or a bug. Is godep update supposed to vendor the vendor of the vendor?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tools/godep/issues/498#issuecomment-238798839, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAAZ00Orxlat6zca-cIBDXz-mfvJy6lks5qeYrVgaJpZM4JSJQ8 .

bhcleek commented 8 years ago

Here is a workaround until this gets fixed:

  1. Remove all entries for the dependency to be updated from Godeps/Godeps.json.
  2. Remove the directory root for the dependency to be updated from vendor.
  3. re-vendor the dependency using godep save [packages].
ronnylt commented 8 years ago

I think this is the expected behavior.

From https://golang.org/s/go15vendor

The second is that this does not attempt to solve the problem of vendoring resulting in multiple copies of a package being linked into a single binary. Sometimes having multiple copies of a library is not a problem; sometimes it is. At least for now, it doesn’t seem that the go command should be in charge of policing or solving that problem.

So the expected should be to also vendor vendors dependencies' and so on...

godepshould also remove the vendor directories

oscarzhao commented 8 years ago

I also want flattened dependencies . kubernetes uses github.com/golang/glog, my project uses glog too, but i cannot manage glog with godep

freeformz commented 8 years ago

FWIW: Now that work has started for a native solution ( https://groups.google.com/forum/#!msg/go-package-management/P8TehVoFLjg/Ni6VRyOjEAAJ), I'm likely not going to be working on godep very much. In the interim I'm suggesting people migrate to govendor (https://github.com/kardianos/govendor) if they are having problems with godep.

On Tue, Aug 30, 2016 at 5:00 AM oscarzhao notifications@github.com wrote:

I also want flattened dependencies

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/tools/godep/issues/498#issuecomment-243416708, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAAZ1aTsETEz26p_4ncyujWkaREuTNZks5qlBtvgaJpZM4JSJQ8 .

oscarzhao commented 7 years ago

kubernetes/client-go solved my problem, eventually