Installation on MacOS High Sierra 10.3.6 fails following exactly the steps in the install guide.
$ go version
go1.11.1 darwin/amd64
My environment:
$ cat $HOME/.bash_profile
export GOPATH=$HOME/go
export GOBIN=$GPOPATH/bin
export PATH=$PATH:$GOBIN
Possibly related to #2469
Followed https://cosmos.network/docs/getting-started/installation.html#install-cosmos-sdk
$ make get_tools && make get_vendor_deps && make install
--> Installing tools
./scripts/get_tools.sh
--> Installing golang/dep (22125cfaa6ddc71e145b1535d4b7ee9744fefff2)...
~/go/src/github.com/golang/dep ~/go/src/github.com
go install github.com/golang/dep/cmd/dep: open /bin/dep: permission denied
make: * [get_tools] Error 1
After installing "dep", the same error occurs. Trying with sudo fails to find the $GOPATH environment variable although is actually set.
$ sudo make get_tools && make get_vendor_deps && make install
--> Installing tools
./scripts/get_tools.sh
please set GOPATH (https://github.com/golang/go/wiki/SettingGOPATH)
make: * [get_tools] Error 1
titan:cosmos-sdk mvs$ env | grep -i GO
GOBIN=/bin
OLDPWD=/Users/mvs/go/src/github.com/cosmos
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/opt/local/bin:/opt/local/sbin:/bin
PWD=/Users/mvs/go/src/github.com/cosmos/cosmos-sdk
GOPATH=/Users/mvs/go
$ dep version
dep:
version : v0.5.0
build date : 2018-07-26
git hash : 224a564
go version : go1.10.3
go compiler : gc
platform : darwin/amd64
features : ImportDuringSolve=false
I'm confused. Did you have to install dep manually?
@ValarDragon why aren't we just go installing things like dep?
I'm confused. Did you have to install
depmanually?
Yes, I had to instal dep manually. I just installed Go by downloading the .pkg from here: https://golang.org/dl/ which is the official docs as suggested. No dep was installed, it was supposed to be included with the Go pkg?
I see. I don't quite understand our tools setup scripts. It's a bit convoluted to me. Would like @ValarDragon input here as maybe he can explain.
@alexanderbez We are go installing it in make get_tools. We pull the repo, checkout the commit, and then go install.
./scripts/get_tools.sh
--> Installing golang/dep (22125cfaa6ddc71e145b1535d4b7ee9744fefff2)...
~/go/src/github.com/golang/dep ~/go/src/github.com
go install github.com/golang/dep/cmd/dep: open /bin/dep: permission denied
Its installing to /bin, so I think this is an issue with not having the $GOPATH$ and $GOBIN$ set
Ahhh figured so. Thanks!
@hernanmd mind double checking your environment setup?
I debugged the get_tools.sh script a little bit. Here is what I found.
Commenting the line
if [ ! -z ${subdir+x} ]; then cd "$subdir" || exit 1; fi && \
makes the go installer actually finds "dep" however failing at subsequent tool installation, which produces the output:
$ make get_tools && make get_vendor_deps && make install
--> Installing tools
./scripts/get_tools.sh
+ '[' -z /Users/mvs/go ']'
+ '[' -z /bin ']'
+ mkdir -p /Users/mvs/go/src/github.com
+ cd /Users/mvs/go/src/github.com
+ installFromGithub golang/dep 22125cfaa6ddc71e145b1535d4b7ee9744fefff2 cmd/dep
+ repo=golang/dep
+ commit=22125cfaa6ddc71e145b1535d4b7ee9744fefff2
+ subdir=cmd/dep
+ echo '--> Installing golang/dep (22125cfaa6ddc71e145b1535d4b7ee9744fefff2)...'
--> Installing golang/dep (22125cfaa6ddc71e145b1535d4b7ee9744fefff2)...
+ '[' '!' -d golang/dep ']'
+ '[' '!' -z x ']'
+ '[' '!' -d golang/dep/cmd/dep ']'
+ pushd golang/dep
~/go/src/github.com/golang/dep ~/go/src/github.com
+ git fetch origin
+ git checkout -q 22125cfaa6ddc71e145b1535d4b7ee9744fefff2
+ go install
+ '[' '!' -z cmd/dep ']'
+ cd -
/Users/mvs/go/src/github.com
+ popd
~/go/src/github.com
+ echo '--> Done'
--> Done
+ echo ''
+ installFromGithub alecthomas/gometalinter 17a7ffa42374937bfecabfb8d2efbd4db0c26741
+ repo=alecthomas/gometalinter
+ commit=17a7ffa42374937bfecabfb8d2efbd4db0c26741
+ subdir=
+ echo '--> Installing alecthomas/gometalinter (17a7ffa42374937bfecabfb8d2efbd4db0c26741)...'
--> Installing alecthomas/gometalinter (17a7ffa42374937bfecabfb8d2efbd4db0c26741)...
+ '[' '!' -d alecthomas/gometalinter ']'
+ mkdir -p alecthomas/gometalinter
+ git clone https://github.com/alecthomas/gometalinter.git alecthomas/gometalinter
Cloning into 'alecthomas/gometalinter'...
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4438 (delta 0), reu
sed 0 (delta 0), pack-reused 4434
Receiving objects: 100% (4438/4438), 5.49 MiB | 698.00 KiB/s, done.
Resolving deltas: 100% (1648/1648), done.
+ '[' '!' -z x ']'
+ '[' '!' -d alecthomas/gometalinter/ ']'
+ pushd alecthomas/gometalinter
~/go/src/github.com/alecthomas/gometalinter ~/go/src/github.com
+ git fetch origin
+ git checkout -q 17a7ffa42374937bfecabfb8d2efbd4db0c26741
+ go install
go install github.com/alecthomas/gometalinter: open /bin/gometalinter: permission denied
+ exit 1
make: *** [get_tools] Error 1
Sorry I cannot help more, I am learning Go myself now.
This is a problem with your Golang environment. get_tools functions as it's supposed to. For example:
docker run --name test -it golang:1.11 bashgo get -u github.com/cosmos/cosmos-sdk && cd $GOPATH/src/github.com/cosmos/cosmos-sdk/make get_tools.Everything works as is. I will be closing this issue shortly 馃憤