pingcap / tidb-operator

TiDB operator creates and manages TiDB clusters running in Kubernetes.
https://docs.pingcap.com/tidb-in-kubernetes/
Apache License 2.0
1.22k stars 493 forks source link

Makefile or doc needs to be enhanced since the GOPATH/GOOS/GOROOT error #2091

Closed hsqlu closed 4 years ago

hsqlu commented 4 years ago

Feature Request

Is your feature request related to a problem? Please describe:

Run make check on my MacBook Pro

➜  tidb-operator git:(master) ✗ uname                                                                                                   
Darwin       
git diff -U --exit-code go.mod go.sum                                                                                                   
gofmt checking                                                                                                                          
gofmt -s -l -w $(find $(go list ./... | grep -vE "client/(clientset|informers|listers)" | sed 's|github.com/pingcap/tidb-operator/||') -
name "*.go") 2>&1| awk '{ print } END { if (NR > 0) { exit 1 } }'                                                                       
go vet check                                                                                                                            
mispell and ineffassign checking                                                                                                        
CGO_ENABLED=0 retool do gometalinter.v2 --disable-all \                                                                                 
          --enable misspell \                                                                                                           
          --enable ineffassign \                                                                                                        
          $(go list ./... | grep -vE "client/(clientset|informers|listers)" | sed 's|github.com/pingcap/tidb-operator/||')              
end-of-file checking                                                                                                                    
./hack/check-EOF.sh                                                                                                                     
all files pass checking.                                                                                                                
./hack/verify-codegen.sh                                                                                                                
warning: ignoring symlink /Users/qiannan/go/src/github.com/pingcap/tidb-operator/deploy/gcp/charts/tidb-cluster                         
warning: ignoring symlink /Users/qiannan/go/src/github.com/pingcap/tidb-operator/deploy/gcp/charts/tidb-operator                        
warning: ignoring symlink /Users/qiannan/go/src/github.com/pingcap/tidb-operator/deploy/gcp/manifests/gke                               
Generating deepcopy funcs                                                                                                               
./vendor/k8s.io/code-generator/generate-groups.sh: line 71: GOPATH: unbound variable                                                    
make: *** [check-codegen] Error 1 

error after setup GOPATH:

diffing pkg/apis/pingcap/v1alpha1/openapi_generated.go with /var/folders/sy/0hb_gmbx087c36vy31vj398h0000gn/T/tmp.Dl8XZId5               │
./hack/verify-crd-groups.sh                                                                                                             │
I0401 14:55:40.487140    6122 main.go:123] parsing go packages in directory github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1  │
W0401 14:55:40.542687    6122 parse.go:224] Ignoring directory github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1: unable to imp│
ort "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1": go/build: importGo github.com/pingcap/tidb-operator/pkg/apis/pingcap/v│
1alpha1: exit status 2                                                                                                                  │
go: cannot find GOROOT directory: /home/travis/.gimme/versions/go1.11.11.linux.amd64                                                    │
                                                                                                                                        │
panic: runtime error: invalid memory address or nil pointer dereference                                                                 │
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x13c747c]                                                                 │
                                                                                                                                        │
goroutine 1 [running]:                                                                                                                  │
k8s.io/gengo/parser.(*Builder).AddDirRecursive(0xc0000b97c0, 0x7ffeefbff777, 0x3a, 0x0, 0x0)                                            │
        /home/travis/gopath/pkg/mod/k8s.io/gengo@v0.0.0-20190128074634-0689ccc1d7d6/parser/parse.go:229 +0x16c                          │
main.parseAPIPackages(0x7ffeefbff777, 0x3a, 0xc00013bf38, 0x1, 0x1, 0x53, 0x0)                                                          │
        /home/travis/gopath/src/github.com/ahmetb/gen-crd-api-reference-docs/main.go:197 +0x60                                          │
main.main()                                                                                                                             │
        /home/travis/gopath/src/github.com/ahmetb/gen-crd-api-reference-docs/main.go:124 +0x268                                         │
make: *** [check-crd-groups] Error 2                                                                                                    │
➜  tidb-operator git:(master) ✗          

error after setup GOOS

API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,Time,Time                                                          │
diffing pkg/apis/pingcap/v1alpha1/openapi_generated.go with /var/folders/sy/0hb_gmbx087c36vy31vj398h0000gn/T/tmp.cRzuhlDv               │
./hack/verify-crd-groups.sh                                                                                                             │
I0401 14:59:47.840160   15016 main.go:123] parsing go packages in directory github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1  │
W0401 14:59:47.873107   15016 parse.go:224] Ignoring directory github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1: unable to imp│
ort "github.com/pingcap/tidb-operator/pkg/apis/pingcap/v1alpha1": go/build: importGo github.com/pingcap/tidb-operator/pkg/apis/pingcap/v│
1alpha1: exit status 2                                                                                                                  │
go: cannot find GOROOT directory: /home/travis/.gimme/versions/go1.11.11.linux.amd64                                                    │
                                                                                                                                        │
panic: runtime error: invalid memory address or nil pointer dereference                                                                 │
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x13c747c]                                                                 │
                                                                                                                                        │
goroutine 1 [running]:                                                                                                                  │
k8s.io/gengo/parser.(*Builder).AddDirRecursive(0xc0000b97c0, 0x7ffeefbff767, 0x3a, 0x0, 0x0)                                            │
        /home/travis/gopath/pkg/mod/k8s.io/gengo@v0.0.0-20190128074634-0689ccc1d7d6/parser/parse.go:229 +0x16c                          │
main.parseAPIPackages(0x7ffeefbff767, 0x3a, 0xc000143f38, 0x1, 0x1, 0x53, 0x0)                                                          │
        /home/travis/gopath/src/github.com/ahmetb/gen-crd-api-reference-docs/main.go:197 +0x60                                          │
main.main()                                                                                                                             │
        /home/travis/gopath/src/github.com/ahmetb/gen-crd-api-reference-docs/main.go:124 +0x268                                         │
make: *** [check-crd-groups] Error 2  

Describe the feature you'd like:

Enhance the shell scripts or Makefile, or describe the detail pre-requirements in docs.

Describe alternatives you've considered:

Teachability, Documentation, Adoption, Migration Strategy:

cofyc commented 4 years ago

hi, @hsqlu

I think the current master branch is working now. Can you check again?

github-actions[bot] commented 4 years ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days