tools / godep

dependency tool for go

Home Page:http://godoc.org/github.com/tools/godep

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

odd "no packages can be updated"

jbenet opened this issue · comments

I've an old version of go.crypto/{sha3,blowfish} (two packaged from 1 repo) that i want to update. in manifest:

        {
            "ImportPath": "code.google.com/p/go.crypto/blowfish",
            "Comment": "null-219",
            "Rev": "00a7d3b31bbab5795b4a51933c04fc2768242970"
        },
        {
            "ImportPath": "code.google.com/p/go.crypto/sha3",
            "Comment": "null-219",
            "Rev": "00a7d3b31bbab5795b4a51933c04fc2768242970"
        }

i try:

> ls Godeps/_workspace/src/code.google.com/p/go.crypto/sha3
keccakf.go  sha3.go  sha3_test.go
> ls ~/go/src/code.google.com/p/go.crypto/sha3/
doc.go  hashes.go  keccakKats.json.deflate  keccakf.go  register.go  sha3.go  sha3_test.go  shake.go
> godep update code.google.com/p/go.crypto/sha3
godep: no packages can be updated

:(

I ended up blowing out the dependencies manually, and re-adding it and it worked. :)

I think I am seeing the same issue. I have a repo that contains a go package as a sub-directory in a repository where the top level is not a go package. It saves fine but won't update. I assume this is a side-affect of not wanted to allow for updating of subpackages. But in this case it isn't a subpackage, but a top level package just contained in a subdirectory of the repo.

Just encountered the same issue. Glad to see I'm not alone.

Same issue here. We vendor github.com/prometheus/client_golang/model in github.com/prometheus/prometheus, and my GOPATH now has a slightly newer version which I want to save. But alas,

$ godep update github.com/prometheus/client_golang/model
godep: no packages can be updated

The exact revision at which this is happening in Prometheus is this: prometheus/prometheus@d4ef509

I wonder if this is connected to us manually including some files in Godeps which godep didn't include (licenses of the vendored packages are legally required, but if they're in the vendored project's root and you only vendor packages from subdirectories, you're suddenly in violation).

This seems to be caused by this line here: https://github.com/tools/godep/blob/master/update.go#L205

If packages A and B are under the same root, and I try to only update B, the root will be marked for skipping update because A isn't being updated. I'm not sure what the motivation for this feature is, it seems that developers should be able to selectively update sub packages as they desire.

For what it's worth, I fixed my problem by globbing from the root in my godep update command (e.g. godep update github.com/foo/bar/... instead of github.com/foo/bar/pkg/B. A helpful error message would have gone a long way

@mpuncel thanks so much saves a lot of time!

Is this on the radar to be fixed?

@mpuncel How would godep restore work if different packages in the same repo are recorded at different versions? Which is the right version of the repository to restore to? That goes away when we can get rid of godep restore, which won't be until after Go 1.6 though.

You're totally right. A better error message would be more than sufficient, this was a very confusing error to encounter as a user.

@mpuncel Thank you for providing the information. That is very useful and saved my time :)