{"action":"created","issue":{"url":"https://api.github.com/repos/sgotti/glide-vc/issues/19","repository_url":"https://api.github.com/repos/sgotti/glide-vc","labels_url":"https://api.github.com/repos/sgotti/glide-vc/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/sgotti/glide-vc/issues/19/comments","events_url":"https://api.github.com/repos/sgotti/glide-vc/issues/19/events","html_url":"https://github.com/sgotti/glide-vc/pull/19","id":172943034,"number":19,"title":"Fix bug when comparing vendor paths during directory traversals","user":{"login":"dongsupark","id":10096906,"avatar_url":"https://avatars.githubusercontent.com/u/10096906?v=3","gravatar_id":"","url":"https://api.github.com/users/dongsupark","html_url":"https://github.com/dongsupark","followers_url":"https://api.github.com/users/dongsupark/followers","following_url":"https://api.github.com/users/dongsupark/following{/other_user}","gists_url":"https://api.github.com/users/dongsupark/gists{/gist_id}","starred_url":"https://api.github.com/users/dongsupark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dongsupark/subscriptions","organizations_url":"https://api.github.com/users/dongsupark/orgs","repos_url":"https://api.github.com/users/dongsupark/repos","events_url":"https://api.github.com/users/dongsupark/events{/privacy}","received_events_url":"https://api.github.com/users/dongsupark/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-08-24T12:50:44Z","updated_at":"2016-08-24T14:51:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sgotti/glide-vc/pulls/19","html_url":"https://github.com/sgotti/glide-vc/pull/19","diff_url":"https://github.com/sgotti/glide-vc/pull/19.diff","patch_url":"https://github.com/sgotti/glide-vc/pull/19.patch"},"body":"`lastVendorPath` usually could be an exact package name, but could be sometimes not exactly the same as the package name.\r\n\r\nFor example, let's assume glide-vc runs like this:\r\n\r\n``\r\n  $ glide vc --only-code --no-tests --no-legal-files \\\r\n    --keep=\"*golang.org/x/net/internal*\"\r\n``\r\n\r\nWhen `lastVendorPath` becomes `\"golang.org/x/net/internal/timeseries/timeseries.go\"`, `filePath.Dir(lastVendorPath)` becomes `\"golang.org/x/net/internal/timeseries\"`, which would be never the same as `\"golang.org/x/net/internal\"`, the given package name. As its result, `\"keep\"` is always set to false, and then glide-vc cannot keep `\"golang.org/x/net/internal\"` at all.\r\n\r\nFix it by checking if `filePath.Dir(lastVendorPath)` contains the given package name as prefix.\r\n\r\nI found it out working on https://github.com/coreos/fleet/pull/1662."},"comment":{"url":"https://api.github.com/repos/sgotti/glide-vc/issues/comments/242092014","html_url":"https://github.com/sgotti/glide-vc/pull/19#issuecomment-242092014","issue_url":"https://api.github.com/repos/sgotti/glide-vc/issues/19","id":242092014,"user":{"login":"sgotti","id":1690273,"avatar_url":"https://avatars.githubusercontent.com/u/1690273?v=3","gravatar_id":"","url":"https://api.github.com/users/sgotti","html_url":"https://github.com/sgotti","followers_url":"https://api.github.com/users/sgotti/followers","following_url":"https://api.github.com/users/sgotti/following{/other_user}","gists_url":"https://api.github.com/users/sgotti/gists{/gist_id}","starred_url":"https://api.github.com/users/sgotti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgotti/subscriptions","organizations_url":"https://api.github.com/users/sgotti/orgs","repos_url":"https://api.github.com/users/sgotti/repos","events_url":"https://api.github.com/users/sgotti/events{/privacy}","received_events_url":"https://api.github.com/users/sgotti/received_events","type":"User","site_admin":false},"created_at":"2016-08-24T14:51:24Z","updated_at":"2016-08-24T14:51:24Z","body":"@dongsupark \r\nThe problem is that `golang.org/x/net/internal/timeseries` doesn't appear in `glide.lock`. So glide-vc is only keeping  `golang.org/x/net/internal/` and not its sub packages. This is the right behavior since glide.lock lists all the required packages.\r\n\r\nSo the glide.lock should also contain `internal/timeseries` as a subpackage of `golang.org/x/net`. After this you can run `glide-vc` without the `--keep` options.\r\n\r\nTo be sure I tried to run a `glide update --strip-vcs --strip-vendor --update-vendored --delete` and the generated glide.lock contains `internal/timeseries`. Then running glide-vc kept `golang.org/x/net/internal/timeseries` . So I think that you should rerun the glide update (with `./scripts/glide-update.sh`).  You can also start with an empty vendor (and also use `--cache` to avoid refetching every repo every time you run glide).\r\n\r\n**NOTE**\r\nI saw some errors running glide update:\r\n```\r\n[ERROR] Error scanning golang.org/x/crypto/ed25519: open /home/motaboy/golang/src/github.com/coreos/fleet/vendor/golang.org/x/crypto/ed25519: no such file or directory\r\n[ERROR] Error scanning github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg: open /home/motaboy/golang/src/github.com/coreos/fleet/vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg: no such file or directory\r\n```\r\n\r\nThese are related to glide setting `golang.org/x/crypto/` to version `1351f936d976c60a0a48d728281922cf63eafb8d` becasue, since you're not providing it in the glide.yaml, it uses the version provided by etcd. An this version doesn't contains `ed25519`.\r\n\r\nThe same for the prometheus package.\r\n\r\n> I'll also try to update every package with running \"glide update\", though I'm not sure that it would help at all solve my issue.\r\n\r\nMy suggestion is that you should just use it and not touch glide.lock or you'll end with very difficult to debug out of sync situations.\r\n\r\n"}}
{"actor":{"display_login":"sgotti"}}