Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glide command frequently does what seems like unnecessary extra work #101

Open
albrow opened this issue Oct 9, 2015 · 2 comments
Open
Labels

Comments

@albrow
Copy link
Contributor

albrow commented Oct 9, 2015

The glide command often seems like it is doing more than what I asked it to do. I'll provide some examples.

  1. Start a new go project in an empty directory
  2. Run glide get github.com/Masterminds/cookoo
  3. Run glide get github.com/albrow/forms

The output I see from command 3 is:

[INFO] Checking dependencies for updates. Godeps: false, GPM: false, gb: false
[INFO] Inspecting /Users/abrowne/programming/go/src/github.com/albrow/glide-test/vendor.
[INFO] Looking in /Users/abrowne/programming/go/src/github.com/albrow/glide-test/vendor/github.com/Masterminds/cookoo for a glide.yaml file.
[INFO] Doing a glide in /Users/abrowne/programming/go/src/github.com/albrow/glide-test/vendor/github.com/Masterminds/cookoo
[INFO] Inspecting /Users/abrowne/programming/go/src/github.com/albrow/glide-test/vendor/github.com/Masterminds/cookoo/vendor.
[INFO] No imports.
[INFO] Looking in /Users/abrowne/programming/go/src/github.com/albrow/glide-test/vendor/github.com/albrow/forms for a glide.yaml file.
[INFO] Package github.com/albrow/forms manages its own dependencies.

Maybe I'm missing something, but why is glide looking at github.com/Masterminds/cookoo at all when I just asked it to get github.com/albrow/forms?

Here's another example. I always pin all the dependencies in glide.yaml to a specific version. I would expect glide install to not do anything if I already have the correct version, just like npm install does. However, the output I see looks like this:

[INFO] Fetching updates for github.com/vaughan0/go-ini.
[INFO] Fetching updates for github.com/stretchr/testify.
[INFO] Fetching updates for github.com/go-errors/errors.
[INFO] Fetching updates for github.com/yvasiyarov/gorelic.
[INFO] Fetching updates for github.com/garyburd/redigo.
[INFO] Fetching updates for gopkg.in/bluesuncorp/validator.v5.
[INFO] Fetching updates for github.com/gin-gonic/gin.
[INFO] Fetching updates for github.com/yvasiyarov/go-metrics.
[INFO] Fetching updates for github.com/albrow/fipple.
[INFO] Fetching updates for github.com/aws/aws-sdk-go.
[INFO] Fetching updates for github.com/manucorporat/sse.
[INFO] Fetching updates for github.com/satori/go.uuid.
[INFO] Fetching updates for github.com/mattn/go-colorable.
[INFO] Fetching updates for github.com/wsxiaoys/terminal.
[INFO] Fetching updates for golang.org/x/net.
[INFO] Fetching updates for github.com/albrow/forms.
[INFO] Fetching updates for github.com/brandfolder/gin-gorelic.
[INFO] Fetching updates for github.com/yvasiyarov/newrelic_platform_go.
[INFO] Setting version for github.com/vaughan0/go-ini.
[INFO] Setting version for github.com/stretchr/testify.
[INFO] Setting version for github.com/yvasiyarov/gorelic.
[INFO] Setting version for github.com/garyburd/redigo.
[INFO] Setting version for gopkg.in/bluesuncorp/validator.v5.
[INFO] Setting version for github.com/gin-gonic/gin.
[INFO] Setting version for github.com/yvasiyarov/go-metrics.
[INFO] Setting version for github.com/albrow/fipple.
[INFO] Setting version for github.com/aws/aws-sdk-go.
[INFO] Setting version for github.com/manucorporat/sse.
[INFO] Setting version for github.com/mattn/go-colorable.
[INFO] Setting version for github.com/wsxiaoys/terminal.
[INFO] Setting version for golang.org/x/net.
[INFO] Setting version for github.com/albrow/forms.
[INFO] Setting version for github.com/brandfolder/gin-gorelic.
[INFO] Setting version for github.com/yvasiyarov/newrelic_platform_go.
[INFO] Checking dependencies for updates. Godeps: false, GPM: false, gb: false
...

It goes on for a while. For a medium project with a decent amount of dependencies, it takes a while for glide install to finish running. When I just added a single package to glide.yaml, and all the other packages have their versions pinned, glide should be smart enough to know that it should leave the other packages alone and just install the one that is missing from vendor.

@mattfarina
Copy link
Member

@albrow thanks for the feedback. I can fill in a little detail here.

First, if you're already at the right reference it should skip updates. That's on the feature/semver branch right now via 1ec3886. I expect that will land on master in the next couple weeks before the 0.7.0 release.

We'll need to poke at glide get to see why it's checking all the things. Thanks for pointing that out.

technosophos added a commit that referenced this issue Oct 10, 2015
This addresses:

- Issue #92: glide update [repo [repo [repo [...]]]]
- Issue #96: streamlines a bit from previous commits
- Issue #101: do not do redundant work on `glide get foo`
  - Extended that to do the same for `glide update`
- Set the foundation for #85 by adding package list to UpdateReferences.
  However, there's more work to do on #85, including some that will
  break backward compat.
@technosophos
Copy link
Member

I have fixed the behavior for glide get and glide up foo.

This turned out to play nicely with several other features we're working on! Hopefully, these things all settled in correctly.

Once feature/semver gets merged, that will solve the remaining checkout issue and we should be able to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants