-
Notifications
You must be signed in to change notification settings - Fork 542
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 fails for dependency in detached HEAD state #360
Comments
Can you drop your |
Also, just to rule out one possibility... did you commit your |
~/gocode/src/example$ cat glide.lock
hash: 508d7f512759bda6eb412a18ab30d992fbfdcd05fd0ded5d50511345ca065181
updated: 2016-03-30T01:01:41.170110135Z
imports:
- name: github.com/cactus/go-statsd-client
version: 5517f304319b9a066354b84860cb264c89655f69
subpackages:
- statsd
- name: github.com/onsi/ginkgo
version: c3a655f9b37a2207fa39721b078b3173ee9218d6
subpackages:
- config
- internal/codelocation
- internal/failer
- internal/remote
- internal/suite
- internal/testingtproxy
- internal/writer
- reporters
- reporters/stenographer
- types
- internal/containernode
- internal/leafnodes
- internal/spec
- internal/specrunner
- name: github.com/onsi/gomega
version: 7ce781ea776b2fd506491011353bded2e40c8467
subpackages:
- internal/assertion
- internal/asyncassertion
- internal/testingtsupport
- matchers
- types
- internal/oraclematcher
- format
- matchers/support/goraph/bipartitegraph
- matchers/support/goraph/edge
- matchers/support/goraph/node
- matchers/support/goraph/util
- name: github.com/opentracing/opentracing-go
version: 01498abd158dfdbe8e251856bc7d14cb0f046fa3
- name: github.com/pborman/uuid
version: c55201b036063326c5b1b89ccfe45a184973d073
- name: github.com/Sirupsen/logrus
version: 4b6ea7319e214d98c938f12692336f7ca9348d6b
- name: github.com/uber/tchannel-go
version: 8f1ed1aa5bb22b4e9f2ced0e736ff771b34dcb39
subpackages:
- atomic
- tnet
- typed
- name: golang.org/x/net
version: 6c89489cafabcbc76df9dbf84ebf07204673fecf
subpackages:
- context
- name: golang.org/x/sys
version: 320cb01ddbbf0473674c2585f9b6e245721de355
subpackages:
- unix
devImports: [] No committed |
Hmm... I tried to reproduce and can't get that result. My glide.yaml file: package: technosophos.com/x/example
import:
- package: github.com/pborman/uuid
- package: github.com/uber/tchannel-go
- package: github.com/onsi/ginkgo
- package: github.com/onsi/gomega
- package: github.com/Sirupsen/logrus
- package: github.com/cactus/go-statsd-client
subpackages:
- statsd My console: ⇒ glide up
[INFO] Downloading dependencies. Please wait...
[INFO] Fetching updates for github.com/uber/tchannel-go.
[INFO] Fetching updates for github.com/pborman/uuid.
[INFO] Fetching updates for github.com/onsi/ginkgo.
[INFO] Fetching updates for github.com/cactus/go-statsd-client.
[INFO] Fetching updates for github.com/Sirupsen/logrus.
[INFO] Fetching updates for github.com/onsi/gomega.
[INFO] Resolving imports
[INFO] Found Godeps.json file.
[INFO] Fetching golang.org/x/net/context into /Users/mattbutcher/Code/Go/src/technosophos/x/example/vendor
[INFO] Setting version for golang.org/x/net to 6c89489cafabcbc76df9dbf84ebf07204673fecf.
[INFO] Downloading dependencies. Please wait...
[INFO] Setting references for remaining imports
[INFO] Project relies on 7 dependencies.
☃ @ENG001590.local ~/Code/Go/src/technosophos/x/example «/Users/mattbutcher/Code»
⇒ glide up
[INFO] Downloading dependencies. Please wait...
[INFO] Fetching updates for github.com/onsi/gomega.
[INFO] Fetching updates for github.com/uber/tchannel-go.
[INFO] Fetching updates for github.com/onsi/ginkgo.
[INFO] Fetching updates for github.com/Sirupsen/logrus.
[INFO] Fetching updates for github.com/cactus/go-statsd-client.
[INFO] Fetching updates for github.com/pborman/uuid.
[INFO] Resolving imports
[INFO] Found Godeps.json file.
[INFO] Fetching updates for golang.org/x/net.
[INFO] golang.org/x/net is already set to version 6c89489cafabcbc76df9dbf84ebf07204673fecf. Skipping update.
[INFO] Setting version for golang.org/x/net to 6c89489cafabcbc76df9dbf84ebf07204673fecf.
[INFO] Downloading dependencies. Please wait...
[INFO] Setting references for remaining imports
[INFO] Project relies on 7 dependencies. Go env:
I'm on Glide 0.10.1 |
I'm going to tag @mattfarina on this one, since he's the owner of the VCS code, too. I took a look again this morning, and am not sure why a detached head state should cause a problem in this case. |
Strange, thanks for investigating so far. I'm building glide from a1e937b, which looks like it's 0.9.3 and then some. |
Any chance you could try with |
No dice on 0.10.1-1-g844a771, or 0.9.3 proper. Something strange though, why does your output say |
Now that I'm back from vacation I'll take a look at this. |
To help with investigating... there are a few things at play here.
If this is the case there is a possibility to get into a detached head state and updates stop. This is a bug. What we need to do if try to make the default (when no version is set) smarter so this detached head state isn't such an issue. |
Just to help those who (like me) have been repeatedly bitten by this, adding |
@ax-nathan I'd actually like to automate some of those things. I recently made changes to the vcs package to allow me to do that more easily. So, I agree completely. |
@mattfarina, sounds like a good idea to me! |
A couple things....
|
This seems to work now for me with Without |
@ippy04 did you try the tip of master? The latest code as of today? |
@mattfarina Just tried with latest tip of master and everything seems to work without |
@ippy04 thanks for checking. Glad this is fixed. |
I'm not entirely sure the root cause of this yet, but hopefully you can shed some light on what is going on, and whether this is a bug or not (it certainly feels like it).
My example project is as follows. Is it silly, but it is a combination of dependencies that experience this issue so bear with me:
main.go
glide.yaml
With the project in this state, I can call
glide update
no problem, and the dependencies are installed:However, if I immediately run
glide update
again, it errors:Now,
'Download Failed'
is not a terribly helpful message, so I did a bit of digging into glide leading me to vcs to try to get a bit more out. I had to (1) patch a proper logger to stdout onto vcs.Logger, and (2) updaterunFromDir
to callb.log(out)
just likerun
does after theCombinedOutput
call, but that's a complaint for another repo.With these fixes in place, and a recompiled glide, I can get a proper error!
So, somehow I ended up with a repo that was checked out to a ref which no longer allowed
glide update
to update it.Note: I came across #356 earlier, and with that in mind tested adding
version: master
to every package listed inglide.yaml
. After deleting the vendor directory and doing a fresh install from glide, this seemed to fix this particular issue.I still can't figure out exactly why that combination of dependencies results in an unrecoverable detached HEAD state, since in my testing the vendor directory always has its git repos in a detached state to the ref in
glide.lock
, but maybe I am missing something.Thoughts?
The text was updated successfully, but these errors were encountered: