-
Notifications
You must be signed in to change notification settings - Fork 540
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
v0.12.0 regression in nested dependencies #599
Comments
@leprechau thanks for filing this. I'll dig into this ASAP. |
@leprechau do you have an example |
@mattfarina yes ... The
This is the
|
@leprechau I created an example project at https://github.com/mattfarina/go-test2. With this I can't reproduce the problem. What I see is... [INFO] Downloading dependencies. Please wait...
[INFO] --> Fetching updates for github.com/Masterminds/vcs.
[INFO] --> Fetching updates for github.com/mattfarina/go-test.
[INFO] --> Detected semantic version. Setting version for github.com/Masterminds/vcs to 1.7.0.
[INFO] Resolving imports
[INFO] --> Fetching updates for github.com/Masterminds/semver.
[INFO] --> Detected semantic version. Setting version for github.com/Masterminds/semver to v1.1.1.
[INFO] Downloading dependencies. Please wait...
[INFO] Setting references for remaining imports
[INFO] Exporting resolved dependencies...
[INFO] --> Exporting github.com/Masterminds/vcs
[INFO] --> Exporting github.com/mattfarina/go-test
[INFO] --> Exporting github.com/Masterminds/semver
[INFO] Replacing existing vendor dependencies
[INFO] Project relies on 3 dependencies. What am I missing? Can you show me how to tweak this to reproduce the problem? |
@mattfarina It took me a bit to reproduce but I have done it with another test repo set. The issue only seems to appear when you are importing subpackages of a target repository. I used this repository: https://github.com/leprechau/glide-test1 These are the results here ...
|
@leprechau I think I see what's going on. Several versions of Glide ago we made a change. Glide looks at the imports in the source and only follows those paths. That means if you have a nested package in a dependency that is never references in the import tree Glide skips fetching the dependencies for that since it's not needed. There is a flag, |
@mattfarina This just broke for us in the 0.12.x release cycle and worked in previous versions. When designing applications with importable sub packages it's very handy to just have one |
@leprechau in the example you shared, If I was in the directory for $ glide up
$ go run main.go This will work because Glide will get all the imports referenced (needed) by the code. If Using Glide 0.11.1 I just got the following... $ glide up
[INFO] Downloading dependencies. Please wait...
[INFO] --> Fetching updates for github.com/leprechau/glide-test2.
[INFO] Resolving imports
[INFO] Downloading dependencies. Please wait...
[INFO] Setting references for remaining imports
[INFO] Versions did not change. Skipping glide.lock update.
[INFO] Project relies on 1 dependencies. To walk all the directory trees as opposed to the imports use the $ glide up --all-dependencies Please note #601. I plan to release 0.12.2 with fixes either Friday or Monday. |
@mattfarina Sorry, you're right I hadn't pushed my last example from where I had reproduced this. The code I had locally in import (
"fmt"
_ "github.com/leprechau/glide-test2/bar"
_ "github.com/leprechau/glide-test2/foo"
) It's updated in my example repository now. Sorry for the confusion. |
@leprechau "I think" I see your problem. Working on it before the next release. Thanks for your patience in explaining it. |
@mattfarina Thank you and thank you for your work on glide. It's definitely improved our Go development process and become a crucial piece of our stack. |
PR is in #603. If this works for you then I think we're ready to roll this in and do a 0.12.2 release. |
I'm still getting the same behavior on my test repo with the using the latest master with #603 applied.
|
Fixed #599: In some cases not importing dependencies config
This was happening when a sub-package imported before the top level or if the top level for the project not imported at all.
When running glide update with version 0.11.1 we see the following:
With 0.12.0+ we see something quite different:
The exact same
glide.yaml
is being used and does not explicitly pin the version of any packages other thanena-community
. The versions are pinned by included packages that have their ownglide.yaml
files checked into the repository. The 0.11.1 code properly finds and handles the nested dependencies whereas the 0.12.0+ does not.The text was updated successfully, but these errors were encountered: