Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unknown iexport format version 2 with Go 1.18beta1 #1145

Closed
leighmcculloch opened this issue Dec 15, 2021 · 2 comments
Closed

unknown iexport format version 2 with Go 1.18beta1 #1145

leighmcculloch opened this issue Dec 15, 2021 · 2 comments
Labels

Comments

@leighmcculloch
Copy link

leighmcculloch commented Dec 15, 2021

Environment

$ go run honnef.co/go/tools/cmd/[email protected] -version
staticcheck 2021.1.2 (v0.2.2)
$ go run honnef.co/go/tools/cmd/[email protected] -debug.version
staticcheck 2021.1.2 (v0.2.2)

Compiled with Go version: go1.18beta1
Main module:
        honnef.co/go/[email protected] (sum: h1:MNh1AVMyVX23VUHE2O27jm6lNj3vjO5DexS4A1xvnzk=)
Dependencies:
        github.com/BurntSushi/[email protected] (sum: h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=)
        golang.org/x/[email protected] (sum: h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=)
        golang.org/x/[email protected] (sum: h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k=)
        golang.org/x/[email protected] (sum: h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY=)
        golang.org/x/[email protected] (sum: h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=)
$ go version
go version go1.18beta1 darwin/amd64
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN="/Users/leighmcculloch/.local/bin"
GOCACHE="/Users/leighmcculloch/Library/Caches/go-build"
GOENV="/Users/leighmcculloch/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/leighmcculloch/.local/gopath/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/leighmcculloch/.local/gopath"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/leighmcculloch/.local/bin/go/latest"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/leighmcculloch/.local/bin/go/latest/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.18beta1"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="0"
GOMOD="/Users/leighmcculloch/Code/stellar--go/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/q5/xb4dl4bs3cs32khlg0ryy0vw0000gp/T/go-build1834563609=/tmp/go-build -gno-record-gcc-switches -fno-common"

Command Run

$ git clone https://github.com/stellar/go
$ cd go
$ go run honnef.co/go/tools/cmd/[email protected] ./...
-: cannot import "container/list" (unknown iexport format version 2), export data is newer version - update tool (compile)
-: cannot import "github.com/onsi/gomega/matchers/support/goraph/node" (unknown iexport format version 2), export data is newer version - update tool (compile)
-: cannot import "github.com/onsi/gomega/types" (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 "math/bits" (unknown iexport format version 2), export data is newer version - update tool (compile)
exit status 1
$ go run honnef.co/go/tools/cmd/staticcheck@master ./...
go: downloading honnef.co/go/tools v0.3.0-0.dev.0.20211201164145-eac08b4651cf
go: downloading golang.org/x/tools v0.1.8-0.20211111032514-c116b727ec7e
-: cannot import "container/list" (predeclared type missing from cache: 31), export data is newer version - update tool (compile)
-: cannot import "internal/abi" (predeclared type missing from cache: 31), export data is newer version - update tool (compile)
exit status 1

Discussion

Running staticcheck with Go 1.18beta1 appears to raise some errors about export data being a newer version. This isn't surprising as 1.18 is only in beta and I assume export data within staticcheck needs updating.

The examples above are being run on the public repo https://github.com/stellar/go, and can be reproduced using the steps above.

Related stellar/go#4143

@leighmcculloch leighmcculloch added bug needs-triage Newly filed issue that needs triage labels Dec 15, 2021
@dominikh
Copy link
Owner

You can use the master branch of Staticcheck and it might work to some extent; but Staticcheck doesn't support generics yet, so the moment it encounters those (even if they're in the standard library), it will fail.

This is pretty much expected behavior. Staticcheck supports the last two released versions of Go. We don't support Go 1.18 yet, and won't for a couple more months. We'll support it in time for the full release of 1.18.

@dominikh dominikh removed the needs-triage Newly filed issue that needs triage label Dec 15, 2021
@leighmcculloch
Copy link
Author

leighmcculloch commented Dec 15, 2021

Got it, thanks for the further details.

For anyone who is also experiencing this, the master branch won't suffice as noted in the above message the stdlib is using generics and causes the errors noted in the PR description above in the second example that uses master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants