make lint errors running golangci-lint during make presubmit

4,816 views
Skip to first unread message

George K

unread,
Jul 20, 2022, 5:59:22 PM7/20/22
to syzkaller
Doing dry run with the steps from here and getting errors: https://github.com/google/syzkaller/blob/master/docs/contributing.md

Ran make install_prerequisites followed by make presubmit and get these errors (have not touched any files):

go build ./...
make lint
# This should install the command from our vendor dir.
CGO_ENABLED=1 go install github.com/golangci/golangci-lint/cmd/golangci-lint
CGO_ENABLED=1 go build -buildmode=plugin -o bin/syz-linter.so ./tools/syz-linter
bin/golangci-lint run ./...
WARN [runner] Can't run linter goanalysis_metalinter: deadcode: analysis skipped: errors in package: [/work/syzkaller/src/github.com/google/syzkaller/dashboard/dashapi/dashapi.go:9:2: could not import bytes (/usr/local/go/src/bytes/buffer.go:10:2: could not import errors (/usr/local/go/src/errors/wrap.go:8:2: could not import internal/reflectlite (/usr/local/go/src/internal/reflectlite/swapper.go:8:2: could not import internal/goarch (-: could not load export data: cannot import "internal/goarch" (unknown iexport format version 2), export data is newer version - update tool)))) /work/syzkaller/src/github.com/google/syzkaller/dashboard/dashapi/dashapi.go:10:2: could not import compress/gzip (/usr/local/go/src/compress/gzip/gunzip.go:10:2: could not import bufio (/usr/local/go/src/bufio/bufio.go:11:2: could not import bytes (/usr/local/go/src/bytes/buffer.go:10:2: could not import errors (/usr/local/go/src/errors/wrap.go:8:2: could not import internal/reflectlite (/usr/local/go/src/internal/reflectlite/swapper.go:8:2: could not import internal/goarch (-: could not load export data: cannot import "internal/goarch" (unknown iexport format version 2),
...
/work/syzkaller/src/github.com/google/syzkaller/dashboard/dashapi/dashapi.go:22:2: could not import github.com/google/syzkaller/pkg/auth (/work/syzkaller/src/github.com/google/syzkaller/pkg/auth/auth.go:30:2: could not import encoding/json (/usr/local/go/src/encoding/json/decode.go:11:2: could not import encoding (-: could not load export data: cannot import "encoding" (unknown iexport format version 2), export data is newer version - update tool)))]
WARN [runner] Can't run linter unused: buildir: failed to load package goarch: could not load export data: cannot import "internal/goarch" (unknown iexport format version 2), export data is newer version - update tool
ERRO Running error: buildir: failed to load package goarch: could not load export data: cannot import "internal/goarch" (unknown iexport format version 2), export data is newer version - update tool
make[2]: *** [Makefile:284: lint] Error 3
make[1]: *** [Makefile:303: presubmit_build] Error 2
make: *** [Makefile:288: presubmit] Error 2

On ubuntu at latest Syzkaller. Any idea what I'm doing wrong?

Thank you,
George

Dmitry Vyukov

unread,
Jul 21, 2022, 5:32:34 AM7/21/22
to George K, syzkaller
Hi George,

It looks like your Go installation is broken. It fails to import
standard library packages.

What I would try is to download the latest Go distribution from:
https://go.dev/dl/
then unpack it into, say, /home/me/go
then set GOROOT=/home/me/go
and PATH=/home/me/go/bin:$PATH
Reply all
Reply to author
Forward
0 new messages