Skip to content

godeps: fix and update dependencies#2893

Merged
xiang90 merged 1 commit intoetcd-io:masterfrom
eparis:unfuck-godeps
Jun 1, 2015
Merged

godeps: fix and update dependencies#2893
xiang90 merged 1 commit intoetcd-io:masterfrom
eparis:unfuck-godeps

Conversation

@eparis
Copy link
Contributor

@eparis eparis commented May 30, 2015

Godeps should allow me to do
godep restore
godep save -r ./...

But that doesn't work. Try it.

This requires update to the following packages:
github.com/prometheus/client_golang/
github.com/prometheus/procfs
github.com/matttproud/golang_protobuf_extensions/

There were 2 major problems.

  1. godeps have code.google.com/p/goprotobuf but that repo doesn't exist
  2. prometheus/client_golang/_vendor moved to other packages and godep
    (with -r) can't handle it.

At the end of this we should be able to use godeps again without tons of
black magic. uggh. what a pain in the ass.

The black magic to actually get godeps back in shape was:

 # remove code.google.com/p/goprotobuf (doesn't exist)
 # remove all _vendor lines from prometheus (we still have other
 # prometheus lines so restore still works)
vi Godeps/Godeps.json

 # remove all the crazy vendoring crud because godep doesn't handle it
 # correctly
find . -name \*.go | xargs sed -i 's|github.com/coreos/etcd/Godeps/_workspace/src/||'

 # ok now, restore as best we can (everything except it wines about
 # goprotobuf
godep restore

 # now update the packages which were using the old (dead) goprotobuf
go get -u github.com/prometheus/client_golang/
go get -u github.com/matttproud/golang_protobuf_extensions/
 # update prometheus procfs because prometheus/client_golang/ has a
 # dependancy on this update
go get -u github.com/prometheus/procfs

 # get rid of Godeps directory entirely
git rm -rf Godeps

 # ok, now, rewrite the Godeps directory and redo the path rewrites
godep  save -r ./...

 # now put Godeps back into git
git add Godeps/

 # commit the new code
git commit -aA

 # And now, you can use godeps!
godep restore
godep save -r ./...
git diff
 # nothing!!

Godeps should allow me to do
  godep restore
  godep save -r ./...

But that doesn't work. Try it.

This requires update to the following packages:
github.com/prometheus/client_golang/
github.com/prometheus/procfs
github.com/matttproud/golang_protobuf_extensions/

There were 2 major problems.

1. godeps have code.google.com/p/goprotobuf but that repo doesn't exist
2. prometheus/client_golang/_vendor moved to other packages and godep
(with -r) can't handle it.

At the end of this we should be able to use godeps again without tons of
black magic.  uggh.  what a pain in the ass.

The black magic to actually get godeps back in shape was:

```bash
 # remove code.google.com/p/goprotobuf (doesn't exist)
 # remove all _vendor lines from prometheus (we still have other
 # prometheus lines so restore still works)
vi Godeps/Godeps.json

 # remove all the crazy vendoring crud because godep doesn't handle it
 # correctly
find . -name \*.go | xargs sed -i
's|github.com/coreos/etcd/Godeps/_workspace/src/||'

 # ok now, restore as best we can (everything except it wines about
 # goprotobuf
godep restore

 # now update the packages which were using the old (dead) goprotobuf
go get -u github.com/prometheus/client_golang/
go get -u github.com/matttproud/golang_protobuf_extensions/
 # update prometheus procfs because prometheus/client_golang/ has a
 # dependancy on this update
go get -u github.com/prometheus/procfs

 # get rid of Godeps directory entirely
git rm -rf Godeps

 # ok, now, rewrite the Godeps directory and redo the path rewrites
godep  save -r ./...

 # now put Godeps back into git
git add Godeps/

 # commit the new code
git commit -aA

 # And now, you can use godeps!
godep restore
godep save -r ./...
git diff
 # nothing!!
```
@xiang90
Copy link
Contributor

xiang90 commented Jun 1, 2015

@eparis Thanks for fixing this... I have tried several times, but failed... I will take a careful look tomorrow!

@xiang90
Copy link
Contributor

xiang90 commented Jun 1, 2015

@eparis Ah... All very reasonable... I guess godep update should work like your script...
Can you update the commit message to "godeps: fix and update dependencies".

LGTM

@eparis eparis changed the title Fix godeps to be usable godeps: fix and update dependencies Jun 1, 2015
@eparis
Copy link
Contributor Author

eparis commented Jun 1, 2015

updated title. godep -r is just brittle. /me dislikes the coreos/-r rewrite policy, but at least now we know how to handle it if it ever fails us again!

@eparis
Copy link
Contributor Author

eparis commented Jun 1, 2015

(godep can't/shouldn't use this procedure for update, because it requires destroying the local GOPATH)

@xiang90
Copy link
Contributor

xiang90 commented Jun 1, 2015

@eparis restore already rewrite the local gopath pkg. if there is a remote git problem, godep should at least provide a clean way to let me resolve it.

@eparis
Copy link
Contributor Author

eparis commented Jun 1, 2015

@xiang90 sure, to solve this borken-ness I had to use restore, but normally "godeps update" does not require a restore...

@eparis
Copy link
Contributor Author

eparis commented Jun 1, 2015

(although admittedly I find myself using godep restore; go get -u $blah; godep save ./... often because it just such a PITA to get the godep update command correct on the shell)

xiang90 added a commit that referenced this pull request Jun 1, 2015
godeps: fix and update dependencies
@xiang90 xiang90 merged commit 8825af4 into etcd-io:master Jun 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants