XiaoMi / soar

SQL Optimizer And Rewriter
Apache License 2.0
8.67k stars 1.32k forks source link

make deps wrong with gometalinter.v2 can intall "gas": executable file #20

Closed heavenruler closed 5 years ago

heavenruler commented 5 years ago

OS: macOS 10.14 Mojave SOAP Version: https://github.com/XiaoMi/soar.git (Tag v0.8.0)

已確認 echo ${PATH} 路徑指定正確

檢查相依性時使用 retool do gometalinter.v2 intall 產生錯誤

==================================================

錯誤訊息如下:

wnlin:soar wn.lin$ make deps
Dependency check
mysql found
docker found
git found
go found
govendor found
retool found
# The retool tools.json is setup from retool-install.sh
retool sync
retool do gometalinter.v2 intall
WARNING: exec: "gas": executable file not found in $PATH
retool: fatal err: failed on 'gometalinter.v2 intall': exit status 2
make: *** [deps] Error 1

從 gometalinter.v2 的觀察也沒有 gas 能重編後安裝

wnlin:gometalinter.v2 wn.lin$ pwd
/Users/wn.lin/go/src/gopkg.in/alecthomas/gometalinter.v2

wnlin:gometalinter.v2 wn.lin$ find . | grep gas | wc -l
       0

Thanks.

martianzhang commented 5 years ago

It seems to be a gometalinter bug with go version large than 1.8+.

https://github.com/alecthomas/gometalinter/issues/249

try setting GOPATH environment variable.

martianzhang commented 5 years ago

there may be another better fix method, try to edit retool-install.sh and change gometalinter.v2 version to the latest, see what will happen?

retool-install.sh:9:retool add gopkg.in/alecthomas/gometalinter.v2 v2.0.11
martianzhang commented 5 years ago

@heavenruler we have updated gometalinter to 2.0.11 in soar.

heavenruler commented 5 years ago

Thanks. I'll try it.

heavenruler commented 5 years ago

Hello @martianzhang

Only updated gometalinter is not enough.

The _tools alecthomas/gometalinter.v2 still dependencies on GoASTScanner/gas.

wnlin:src wn.lin$ pwd
/Users/wn.lin/work/git/soar/_tools/src/gopkg.in/alecthomas/gometalinter.v2/_linters/src
wnlin:src wn.lin$ cat manifest | head
{
    "version": 0,
    "dependencies": [
        {
            "importpath": "github.com/GoASTScanner/gas",
            "repository": "https://github.com/GoASTScanner/gas",
            "vcs": "git",
            "revision": "f22c701483ba201fbdb79c3667a28ef6a4e4a25c",
            "branch": "master",
            "notests": true

GoASTScanner/gas already rename to securego/gosec.

wnlin:src wn.lin$ curl -I https://github.com/GoASTScanner/gas | grep Location
Location: https://github.com/securego/gosec

My dirty workaround is link.

wnlin:bin wn.lin$ pwd
/usr/local/Cellar/go/bin
wnlin:bin wn.lin$ ls -al | grep gosec
lrwxr-xr-x   1 wn.lin  Users Users         5 10 24 16:19 gas -> gosec
-rwxr-xr-x   1 wn.lin  Users Users   7885048 10 24 15:01 gosec

It's should be working.

wnlin:soar wn.lin$ make deps
Dependency check
mysql found
docker found
git found
go found
govendor found
retool found
# The retool tools.json is setup from retool-install.sh
retool sync
retool do gometalinter.v2 intall

I am still looking for something interesting in soar.

Thanks.

Becivells commented 5 years ago

tks