guyuqi commented on pull request #12540:
URL: https://github.com/apache/arrow/pull/12540#issuecomment-1072116843


   1. The root cause for `compile: version "go1.17.7" does not match go tool 
version "go1.17"`  
    is  Go packages conflict:
   `mingw-w64-x86_64-go-1.17-1` would be installed by `msys2_setup.sh` and 
`mingw-w64-x86_64-go-1.17-1` seems incompatible with staticcheck.
   So removed `mingw-w64-x86_64-go-1.17-1` installation from `msys2_setup.sh` 
and install Go by `actions/setup-go@v2`.
   
   2. `staticcheck ` package was successfully installed, but staticcheck failed 
in MinGW 
(https://github.com/apache/arrow/runs/5595693539?check_suite_focus=true) :
   ```
   + 'C:\Users\runneradmin\go/bin/staticcheck' ./...
   -: cannot import "gonum.org/v1/gonum/blas" (unknown iexport format version 
2), export data is newer version - update tool (compile)
   -: cannot import "internal/cpu" (unknown iexport format version 2), export 
data is newer version - update tool (compile)
   -: cannot import "internal/goarch" (unknown iexport format version 2), 
export data is newer version - update tool (compile)
   -: cannot import "internal/goos" (unknown iexport format version 2), export 
data is newer version - update tool (compile)
   -: cannot import "internal/unsafeheader" (unknown iexport format version 2), 
export data is newer version - update tool (compile)
   -: cannot import "math/bits" (unknown iexport format version 2), export data 
is newer version - update tool (compile)
   ```
   From https://github.com/google/pprof/issues/662 and 
https://github.com/dominikh/go-tools/issues/1107, `staticcheck` does not 
support `Go tip` compiler. 
   I'm confuesd why the same issues occurred in `MinGW` environment with `Go 
`not `Gotip` compiler. 
   ( May be environment dependencies ?)
   
   How about skipping `staticcheck` in this tricky environment(MinGW)? 
   `staticcheck` is to check Golang source files which may have been verified 
on other CI envrionment(windows, Linux , macos).
   ```
   ....
   ...
       env:
         MINGW_LINT: "1"
   ......
   ...
   # Go static check (skipped in MinGW)
   if [[ -z "${MINGW_LINT}" ]]; then
       pushd ${source_dir}
       "$(go env GOPATH)"/bin/staticcheck ./...
       popd
   fi
   ```
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to