Go: x/tools/go/gcexportdata: 'undefined: gcimporter.IExportData'

Created on 4 Oct 2019  路  7Comments  路  Source: golang/go

What version of Go are you using (go version)?

$ go version
go version go1.10.8 linux/amd64

Does this issue reproduce with the latest release?

No

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"

go env Output

$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/achraf/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/achraf/devspace/fmle"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build919335073=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Try to get some package, for instance lint :
go get -u golang.org/x/lint/golint

What did you expect to see?

The package to be downloaded

What did you see instead?

# golang.org/x/tools/go/gcexportdata
/build/src/golang.org/x/tools/go/gcexportdata/gcexportdata.go:103:12: undefined: gcimporter.IExportData
FrozenDueToAge NeedsInvestigation Tools

Most helpful comment

The problem is that x/tools/go/internal/gcimporter/iexport.go has a go1.11 build tag, and nothing else defines IExportData. While technically we only support the last two Go releases, it would be nice to support the 1.10 release if it's easy. From a quick test it looks like we could simply change the call to Embedded to call Anonymous instead. Embedded is the new name, Anonymous is the backward compatible name.

All 7 comments

You'll need to install musl-dev in your build system.
You might want to think about upgrading the golang version to 1.12 too?

I tried to install musl-dev on my build system, I'm having the same problem.
We are planning to upgrade golang version but not soon, we need to try to fix this in the meantime.

CC @mdempsky @ianthehat @matloob

The problem is that x/tools/go/internal/gcimporter/iexport.go has a go1.11 build tag, and nothing else defines IExportData. While technically we only support the last two Go releases, it would be nice to support the 1.10 release if it's easy. From a quick test it looks like we could simply change the call to Embedded to call Anonymous instead. Embedded is the new name, Anonymous is the backward compatible name.

On 10/4/19, Ian Lance Taylor notifications@github.com wrote:

The problem is that x/tools/go/internal/gcimporter/iexport.go has a go1.11
build tag, and nothing else defines IExportData. While technically we
only support the last two Go releases, it would be nice to support the 1.10
release if it's easy. From a quick test it looks like we could simply
change the call to Embedded to call Anonymous instead. Embedded is
the new name, Anonymous is the backward compatible name.

I came up against that this very morning, trying to build godoc.

I support any effort to keep this going a bit longer, if it is not a
major hurdle.

Lucio.

I will make the change that @ianlancetaylor suggested.

Change https://golang.org/cl/199037 mentions this issue: go/internal/gcimporter: support Go versions < 1.11

Was this page helpful?
0 / 5 - 0 ratings