-
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
Glide update does not update packages to the latest version unless git cache is cleared #592
Comments
I'm a little confused about something and I think I need some more information to understand what's going on. The There was never the intent for someone to manually checkout a version inside the repo within the This happens via the Is that not happening for you? |
When I run Let me clarify again: my This doesn't seem to be happening. After the update of local cache, my
Yes, that was my misguided attempt to get a pinned version of a package updated in |
@a13xb it sounds like there is a problem and one I'm not experiencing. Can you provide an example project or |
OSX: 10.11.6
Sample project: glide.yaml
glide.lock
Commit Running
|
Quick question, do you have I setup an example with a file: package main
import (
"fmt"
_ "github.com/gorilla/mux"
)
func main() {
fmt.Println("test")
} It fetched the dependencies. Does this fix your problem? |
I've added this sample Go file and it adds the transitive dependency, so it completes the example, but the problem is still there. I think it has something to do with cache.
|
+1 |
I had a similar issue. Removing the cache fixed it for me. |
Same here. Seems like Glide does not switch to the latest version before export to vendor. |
👍 This also seems to affect me. Go Version:
|
I confirm this is happening to me too. I was wondering if I was doing something wrong, until I read this issue :) I even removed the entry of my dep from the glide.lock file (my dep is on github), ran update again, saw that the .lock file put the dep back, but vendor/ is still the old version and the entry in the .lock file is still the old hash. I want to pull the lastest from master branch, but it isn't setting my dep to the latest hash - the lock file is showing the git hash from the first time I pulled the dep via glide. Workaround: "rm -rf ~/.glide/cache/src/my-dep-directory" then run glide update. |
same problem I was having "rm -rf ~/.glide/cache/" worked for me, glide.lock was not updating to the latest commit hash regardless of doing a glide update |
i'm pretty sure the answer is "no," but just to be sure: have any of you who are experiencing this bug done any direct manipulation of the also, if anyone is able to create some exact steps to reproduce, it would be tremendously helpful in solving this problem. |
@sdboyer the answer for me is "no" - in fact, I didn't even know this cache existed let alone where it was until I researched this issue and found someone said "clear you cache" and I had to go hunt for what this cache even was :) |
I just ran through a set of replication steps for you to try. FYI, my versions are as follows: 1: Clone this repo and make it your GOPATH: https://github.com/hawkular/hawkular-openshift-agent 2: Make sure glide is in your path obviously (to do this, I run "make install_glide" from the root GOPATH directory - there is a Makefile in there - and glide goes in my GOPATH/bin that I then run) 3: cd src/github.com/hawkular/hawkular-openshift-agent/ (you will find the glide yaml and lock files here) 4: Run "glide update" - notice this:
5: See that you have the latest code for that dependency (hawkular-client-go) in vendor directory by grepping for "Username" - this was a new field added in the latest PR merge and is now in the HEAD of master branch:
6: edit the glide.yaml and add a "ref" so that dependency gets locked on a new hash (this hash is the one before the latest PR merge and did NOT have that "Username string" field) - so add the two lines "vcs" and "ref" below under the hawkular-client-go package dependency:
7: Run "glide update" - notice this:
8: Run the grep again, and notice the Username is missing (this is correct, it means glide updated the dependency source under vendor properly)
9: Now go back to glide.yaml, remove that "vcs" and "ref" that you added in step 6 thus bringing back your dependency to the master head. 10: Run "glide update" - notice this:
11: Now, you are back to where we were (or we should be) - the latest code of master HEAD that has the new Username field in the dependency code. But run that grep command and see that it is missing under vendor directory:
12: To confirm the cache is now bad, go to it and look at what is checked out of git:
That is NOT the git hash of the latest master. That's the git hash we put in in step 6. But we want master, which currently is:
So when I removed the ref: from the yaml file and I "glide update", it never pulled the HEAD from master - the cache stayed on the old hash that I pulled before and thus my vendor/ never updated. Hope this helps. |
@jmazzitelli 👼 👼 ✨ 💖 🎉 i won't have time to actually run these through until later today or tomorrow, but these kinds of reproducibility procedures are like manna from heaven. |
@sdboyer - any word on this? Did my replication procedures yield any clues as to the problem and potential fix? |
sorry, i've had a ridiculous couple weeks, and just totally forgot about this 😞 i'll look today |
@sdboyer those replicate steps might be slightly different - I just committed a change to that repo that changes the project structure to be more like a "normal" golang project. Just follow the README.adoc to install it (it should now be more as you would expect anyway). Its not really different, I just move the src/ files up to the top directory rather than committing the files under the src/github.com.... directory structure. |
This is hitting another, i guess different issue:
it went away when I
Yep, I figured the issue would be something like this. The git commands glide is issuing to get information from the repo aren't working correctly because they're using porcelain commands that have subtle dependencies on local repo state. Specifically, I need to track down where the actual calls are in the code to fix this up, but it shouldn't be too terrible to deal with. Also, just a note for the future - the cache having a particular version checked out in the working directory isn't necessarily an indication that it's "bad". The technique we use to quickly get files onto disk under |
This is why I have step 11 in my replication procedure. I actually do look in /vendor to see that the code is "bad" there. |
I have the same issue. I track a package as a fork I made and when I push updates to the fork, |
So, the fix over in #703 should address this. The only note to make is that you have to specify the branch you want to follow in I've verified this against @jmazzitelli's replication procedure, but if someone else could try with that PR, that'd be awesome. |
@sdboyer I just tried it using your PR branch and it still failed. But maybe I'm not doing it right. What do you mean "you have to specify the branch you want to follow in glide.yaml". I was using:
So I'm giving a hash reference, not an actual branch name. Is that not correct anymore? And what about tags? Can you use tag names rather than branch names? |
Fwiw I worked around this issue by reverting back to v0.11.1 https://github.com/Masterminds/glide/releases/tag/v0.11.1 |
I also see this with glide v0.13; i've been in the habit of manually deleting the cached checkout of a dependency before updating. |
https://glide.sh/ Pins dependencies, so that the entire project doesn't mysteriously break when built on a different machine. Glide was picked for having a large community, and its claim that the official vendoring tool - developed by the golang maintainers - resembles the ideals of glide. Brief research backs this up: https://github.com/golang/dep Glide does have an issue with caching, which can make updating difficult. Ref: Masterminds/glide#592 Basically, if you're looking to update dependencies to later versions, first run `glide clear-cache`, then `glide update`.
The behavior suggests that glide is using the latest tag if no But to be clear, I might be completely confused here :) |
For detail on the glide configuration fixes: Masterminds/glide#592
@jmcfarlane I had to use |
Masterminds/glide#592 (comment) Otherwise once at "master", the glide cache would not be updated
I think I hit this as well. glide update; go build ./... ==> build failed because k8s.io/api was not update |
I also had to clear my glide cache (~/.glide/cache) because I hit Masterminds/glide#592 . Do this to pick up Nikhil's change in ingress-gce to stop showing testing flags in kubemci -h (kubernetes/ingress-gce#69) Testing: Since this picks up a fair amount of new ingress-gce/ code (like NEGs support), I ran demo.sh and saw that the ingress works.
@G-Harmon Can you run |
If a glide dependency ever gets --force updated, See #961 |
Hi @mattfarina, are you asking for debug output on the faulty update or the successful one? I assume the faulty one, but I'm not quite sure what it takes to get into that state. I normally only run glide update once in awhile. |
Faulty one |
A new dev cycle means it's a good time to update. I had to remember to clear my glide cache before updating due to a long standing bug (see: Masterminds/glide#592). I was definitely motivated, to see if we can benefit from first-class middleware support in `gorilla/mux` (see: gorilla/mux#293).
Any updates here? This is still an issue... |
Hey @wellsjo, I haven't had a time to repro and provide debug data. Can you? |
@G-Harmon I'll see if I can find time in the next couple days to reproduce this in a digestible way. I'm baffled though, this is a glaringly obvious issue that many people are facing, and it breaks one of the most important features of a dependency management system. Many projects' dependencies rely on the master branch...and they don't update. This has been an open issue since August 2016, which makes me inclined to drop glide. It's somewhat reassuring that GCP is using it, but this is clearly buggy/unfinished software. |
If possible I would definitely try switching to dep:
https://github.com/golang/dep/
It's the "official" dependency tool and has much less of these bug bugs in
my opinion. The glide README also recommends it actually.
…On Thu, Feb 1, 2018, 03:24 Wells Johnston ***@***.***> wrote:
@G-Harmon <https://github.com/g-harmon> I'll see if I can find time in
the next couple days to reproduce this in a digestible way.
I'm baffled though, this is a glaringly obvious issue that many people are
facing (and easily reproduced), and it breaks one of the most important
features of a dependency management system. Many projects dependencies rely
on the master branch...and they don't update. This has been an open issue
since *August 2016*, which makes me inclined to drop glide. It's somewhat
reassuring that GCP is using it, but this is clearly buggy/unfinished
software.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#592 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABG8JkXUD0dXGVT0Y2t06UQb2dvq7DD-ks5tQSBogaJpZM4JxUEK>
.
|
Masterminds/glide#592 Holy cow, what a terrible bug open for a year and a half. We should get rid of glide soon. Signed-off-by: Tycho Andersen <[email protected]>
I was facing the same issue that 'glide up' wasn't updating my vendor folder,and project was referring to an older version of the dependency which was already present. I see from this thread that clearing glide cache also did not help some people, same for me too.
This refreshed my vendor folder with required commit or created a dependency if it dint exist. |
@ashubalike that worked for me! |
Your usage example states:
However, it doesn't seem to do that at all. If I start with a clean repository with
glide.yaml
, where none of the packages are constrained, and a matchingglide.lock
, none of the dependencies are updated, even though upstream has new commits. Repository remains clean.When (pre-0.12) Glide was still not stripping VCS files, I used to be able to go into
venvor
tree, checkout a specific version of a single dependency and runglide update
, it would update the lock file to pin the dependency at the version I checked out. So I've been left with the impression that allglide update
does is transfer the state of yourvendor
tree intoglide.lock
, that's it.Obviously now
vendor
tree doesn't retain VCS information, I'm not sure what exactlyglide update
is supposed to do, and how to actually properly update dependencies to the latest version of the upstream.The text was updated successfully, but these errors were encountered: