digitalocean / doctl

The official command line interface for the DigitalOcean API.
https://docs.digitalocean.com/reference/doctl/
Apache License 2.0
3.26k stars 395 forks source link

plain "go get" doesn't work on the repository #42

Closed danstender closed 7 years ago

danstender commented 8 years ago

$ go get github.com/digitalocean/doctl/cmd/doctl doesn't work out of the box:

$ go get github.com/digitalocean/doctl/cmd/doctl
# cd /home/user/mygo/src/github.com/digitalocean/doctl; git submodule update --init --recursive
fatal: no submodule mapping found in .gitmodules for path 'vendor/github.com/inconshreveable/mousetrap'
package github.com/digitalocean/doctl/cmd/doctl: exit status 128

DS

jungle-boogie commented 8 years ago

Yep, I experienced this and thought it was something in my setup.

I can't use the binaries as there's no version for freebsd 32/64bit.

jakebasile commented 8 years ago

Ran into this too. Looks like when #1 copied everything in, a few deps were missed. go get gets confused and complains.

I fixed it in jakebasile/doctl@aa6995516140ddbc143eb50473aaf3cd32332f1c by checking out the referenced commits and it appears to work when I try go get github.com/jakebasile/doctl, but it will not work with -u as it fails to get the correct paths from my project.

Not sure if I did the vendoring the preferred way, but it seems to work. Let me know if you'd like a PR, or maybe there's a better way to fix this.

bryanl commented 8 years ago

You should be able to do go get github.com/digitalocean/doctl/.... Currently, one of the vendored repos has a weird submodule thing I need to explore. The good news is that even with the error 1, you can still install a binary with go install github.com/digitalocean/doctl/cmd/doctl. I'll work on tracking down that submodule issue.

macktic commented 8 years ago

This issue seems to still be open, I have to install from source as there is no arm version. downloading the source and using go build doctl/cmd/doctl works fine.

nesv commented 8 years ago

Just to tack onto this issue, I'm getting the following error:

$ go get -v -u github.com/digitalocean/doctl/...
github.com/digitalocean/doctl (download)
# cd /home/nesv/src/github.com/digitalocean/doctl; git submodule update --init --recursive
fatal: no submodule mapping found in .gitmodules for path 'vendor/github.com/vektra/errors'
package github.com/digitalocean/doctl: exit status 128

@bryanl: Is this the "weird submodule thing" you referred to?

klauern commented 8 years ago

@nesv Yes, I got that too. It works when you follow the go install instructions that @bryanl mentioned above.

nesv commented 8 years ago

@klauern Yep! I was just adding the error I received in hopes that it would help. :)

claudioandre-br commented 8 years ago

There are special entries in the index indicating submodules. Inside doctl dir, do:

$ git ls-files --stage | grep 160000
160000 c64d83aba85aa4392895aadeefabbd24e89f3580 0   vendor/github.com/vektra/errors
160000 47a058062601e235731714f89d7ec95c1ec47a5e 0   vendor/github.com/vektra/mockery
160000 f3a63969dd29f8cfa913fdaea22f30c1ed537cb3 0   vendor/golang.org/x/tools

If that special entry path isn't referenced in the .gitmodule, then I guess DigitalOcean needs to remove it (one can add it again later).


After the removal, I was able to build using go get github.com/MyFork). And voila:

$ ls -l temp/bin/
total 15608
-rwxrwxr-x 1 me me 15979048 Ago 29 16:33 doctl
dch commented 7 years ago

@claudioandre any chance of you sharing a few more steps on how you managed this? specifically how to remove this entry path, and what command you needed to generate the binary?

dch commented 7 years ago

I worked out the incantation to do this, see https://github.com/digitalocean/doctl/issues/47#issuecomment-278467149 for details.

xmudrii commented 7 years ago

@mauricio i think this one should be fixed as well with #201