I'm building gaiacli. As far as I can tell I'm following the instructions on the front page. I'm using Debian and I have go1.12.5 linux/amd64. "make tools install" results in:
...@debian:~/go/src/github.com/cosmos/cosmos-sdk$ make tools install
bash contrib/install-golangci-lint.sh .../go/bin v1.15.0 ac897cadc180bf0c1a4bf27776c410debad27205b22856b861d41d39d06509cf
scripts/Makefile:51: recipe for target '.../go/bin/golangci-lint' failed
make: * [.../go/bin/golangci-lint] Error 1
v0.34.4 from git
make tools install
/cc @alessio
Ciao @odinlake! Thanks for filing this report. Mind pasting the output of the following command please?
git describe
...:~/go/src/github.com/cosmos/cosmos-sdk$ git describe
v0.34.4
I'm struggling to reproduce this really (I'm on Ubuntu 18.04):
$ git checkout v0.34.4
Note: checking out 'v0.34.4'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at 62fa99e7 Merge PR #4266: Release v0.34.4 (RC1)
$ make tools-clean tools
cd /home/alessio/go/bin && rm -f golangci-lint statik goimports gosum sdkch
rm -f tools-stamp
go install -mod=readonly ./cmd/gosum/
bash contrib/install-golangci-lint.sh /home/alessio/go/bin v1.15.0 ac897cadc180bf0c1a4bf27776c410debad27205b22856b861d41d39d06509cf
Downloading golangci-lint v1.15.0 installer ...
Checking hashsum ...
Launching installer ...
golangci/golangci-lint info checking GitHub for tag 'v1.15.0'
golangci/golangci-lint debug http_download https://github.com/golangci/golangci-lint/releases/v1.15.0
golangci/golangci-lint info found version: 1.15.0 for v1.15.0/linux/amd64
golangci/golangci-lint debug downloading files into /tmp/tmp.39PrxRN497
golangci/golangci-lint debug http_download https://github.com/golangci/golangci-lint/releases/download/v1.15.0/golangci-lint-1.15.0-linux-amd64.tar.gz
golangci/golangci-lint debug http_download https://github.com/golangci/golangci-lint/releases/download/v1.15.0/golangci-lint-1.15.0-checksums.txt
golangci/golangci-lint info installed /home/alessio/go/bin/golangci-lint
mkdir -p /home/alessio/go/src/github.com/rakyll && (test ! -d /home/alessio/go/src/github.com/rakyll/statik && cd /home/alessio/go/src/github.com/rakyll && git clone https://github.com/rakyll/statik) || true && cd /home/alessio/go/src/github.com/rakyll/statik && git fetch origin && git checkout -q v0.1.5 && cd /home/alessio/go/src/github.com/rakyll/statik && /usr/local/bin/go install
go get golang.org/x/tools/cmd/[email protected]
go: finding golang.org/x/tools/cmd/goimports v0.0.0-20190114222345-bf090417da8b
go: finding golang.org/x/tools/cmd v0.0.0-20190114222345-bf090417da8b
go install -mod=readonly ./cmd/sdkch/
touch tools-stamp
@odinlake @alessio I suspect it's because the GOPATH environment variable may not have been set and added to PATH.
Something like (use whatever paths are correct for you):
mkdir -p $HOME/go/bin
echo "export GOPATH=$HOME/go" >> ~/.bash_profile
echo "export GOBIN=\$GOPATH/bin" >> ~/.bash_profile
echo "export PATH=\$PATH:\$GOBIN" >> ~/.bash_profile
source ~/.bash_profile
This is my configuration:
mikael@debian:~/go/src/github.com/cosmos/cosmos-sdk$ set | grep GO
GOBIN=/home/mikael/go/bin
GOPATH=/home/mikael/go:/usr/local/go
GOROOT=/usr/local/go
And /home/mikael/go/bin:/usr/local/go/bin is on PATH. Anything else you can suggest would be appreciated.
GOPATH=/home/mikael/go:/usr/local/go
You shouldn't append GOROOT to GOPATH.
I did that only once I ran into trouble. Same problem either way.
OK try this one then:
bash contrib/install-golangci-lint.sh /home/mikael/go/bin v1.15.0 ac897cadc180bf0c1a4bf27776c410debad27205b22856b861d41d39d06509cf
that line produces no output of any kind
I had similar problem when I installed 0.34.2, and installing golangci-lint with curl (v0.15.0 is the latest then) worked at that time.
However, during I try to install 0.34.5 today, I met the another golangci-lint realted problem and installing gloangci-lint doesnot work at all.
I met following error.
Downloading golangci-lint v1.16.0 installer ...
Checking hashsum ...
/home/---/go/src/github.com/cosmos/cosmos-sdk/contrib/devtools/install-golangci-lint.sh: line 8: python: command not found
contrib/devtools/Makefile:59: recipe for target '/home/---/go/bin/golangci-lint' failed
make: *** [/home/---/go/bin/golangci-lint] Error 1
This seems like a local configuration issue with Golang. Going to close this issue
@odinlake This can be resolved manually installing golangci-lint with the following command
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin latest
Reference: official golangci-link repo
/home/---/go/src/github.com/cosmos/cosmos-sdk/contrib/devtools/install-golangci-lint.sh: line 8: python: command not found
You need to install python
Most helpful comment
@odinlake This can be resolved manually installing
golangci-lintwith the following commandReference: official golangci-link repo