Skip to content
This repository has been archived by the owner on May 9, 2021. It is now read-only.

Master doesn't build anymore: undefined: types.NewInterface2 #402

Closed
Soulou opened this issue Jun 13, 2018 · 22 comments
Closed

Master doesn't build anymore: undefined: types.NewInterface2 #402

Soulou opened this issue Jun 13, 2018 · 22 comments
Assignees

Comments

@Soulou
Copy link

Soulou commented Jun 13, 2018

└> go get -u golang.org/x/lint/golint
# golang.org/x/tools/go/internal/gcimporter
Projects/Go/src/golang.org/x/tools/go/internal/gcimporter/bimport.go:541:8: undefined: types.NewInterface2
Projects/Go/src/golang.org/x/tools/go/internal/gcimporter/iimport.go:540:10: undefined: types.NewInterface2
@sosiska
Copy link

sosiska commented Jun 13, 2018

any workaround?

@JackBracken
Copy link

+1

Seeing failed builds in prudhvitella/terraform-provider-infoblox#32

Verified it fails on my local machine also.

@tkanos
Copy link

tkanos commented Jun 13, 2018

the same when you run the command

go get -u golang.org/x/lint/golint                                                                        
# golang.org/x/tools/go/internal/gcimporter
../../golang.org/x/tools/go/internal/gcimporter/bimport.go:541:8: undefined: types.NewInterface2
../../golang.org/x/tools/go/internal/gcimporter/iimport.go:540:10: undefined: types.NewInterface2

So we are unable to install it.

@tkanos
Copy link

tkanos commented Jun 13, 2018

Actually, it's not the fault of golint that only uses golang/tools that have recently done a new commit :

golang/tools@9a70f1f

WORKAROUND :
use the release version of tool for go 1.10

git checkout release-branch.go1.10

@lowzj
Copy link

lowzj commented Jun 13, 2018

same problem. It seems that the source bimport.go was changed on 2018-06-12 22:33:41.

9a70f1fcb go/internal/gcimporter/bimport.go (Robert Griesemer     2018-06-12 22:33:41 -0700  541)               t := types.NewInterface2(p.methodList(parent, tname), embeddeds)

@slawo
Copy link

slawo commented Jun 13, 2018

all projects with go get -u github.com/golang/lint/golint in CI are now bust

@zjshen14
Copy link

Any ETA on this? It blocks all our CI jobs.

@andybons
Copy link
Member

Looking into this.

@andybons andybons self-assigned this Jun 13, 2018
@andybons
Copy link
Member

@griesemer is working on a fix as we speak.

@griesemer
Copy link

All: sorry about this. On it.

gopherbot pushed a commit to golang/tools that referenced this issue Jun 13, 2018
…r builds before Go 1.11

For golang/lint#402.

Change-Id: If8802c93679af57bcb50c43f386f37458813d910
Reviewed-on: https://go-review.googlesource.com/118563
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
@griesemer
Copy link

griesemer commented Jun 13, 2018

Well, I missed a few more places. One more CL to come.
Several CLs to come... :-(

gopherbot pushed a commit to golang/tools that referenced this issue Jun 13, 2018
For golang/lint#402.

Change-Id: Ideaac18b4f0be1674bb07010840b3d10e6ebe9d6
Reviewed-on: https://go-review.googlesource.com/118639
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
gopherbot pushed a commit to golang/tools that referenced this issue Jun 13, 2018
… for builds before Go 1.11

For golang/lint#402.

Change-Id: I06d944aaa168fb595ff96eb27a7d6e7da344ebd6
Reviewed-on: https://go-review.googlesource.com/118564
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
gopherbot pushed a commit to golang/tools that referenced this issue Jun 13, 2018
…efore go1.11

For golang/lint#402.

Change-Id: I3f4eab123e52460980e76f5ffaca3a77a3af7374
Reviewed-on: https://go-review.googlesource.com/118565
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
@griesemer
Copy link

There's one more CL pending for review but it's only affecting tests. Please let me know if

go get -u golang.org/x/lint/golint

still doesn't work for non 1.11 builds.

gopherbot pushed a commit to golang/tools that referenced this issue Jun 13, 2018
…ds (fix build)

TBR=adonovan

The tests TestImportedTypes and TestIssue25301 are dependent on many
1.11-specific bug fixes that went into go/types. Just move them out
of non-1.11 builds.

While doing so, also extended the set of test cases run by
TestImportedTypes (now matching the corresponding tests cases
in the std lib).

This also makes it again unnecessary to factor out the embeddedType
function into build-specific versions. Removed again.

For golang/lint#402.

Change-Id: I45eb8c3d1dcca7b392f14a7660bc1599a44a0d41
Reviewed-on: https://go-review.googlesource.com/118567
Reviewed-by: Robert Griesemer <gri@golang.org>
@msound
Copy link

msound commented Jun 13, 2018

We are using Travis CI and go 1.9.7, the build is now successful and go get -u golang.org/x/lint/golint is working fine now.

@griesemer
Copy link

Post-mortem: Late last night (with emphasis on "late") I created a larger CL in an attempt to finally update x/tools with all the latest fixes and changes that we've made to the various importers in the std lib. This also included fixes to go/types and new tests. The CL was approved and passed all (1.11) tests and I submitted it somewhat in a rush this morning while running out of the door, not thinking abut pre-1.11 builds. As we all saw, the non-1.11 builds failed quickly, and with it tools such as lint that depend on go/types. It was "obvious" what needed to be fixed (the go/types.NewInterface2 call is missing pre-1.11). While submitting that fix, I missed a couple of places (sigh), and also the fact that Interface.EmbeddedType was new as well. Finally, some of the new tests don't pass at all pre-1.11 due to larger fixes in go/types. I've split up the code into version-tagged files and I believe it works now. The primary reason for having these problems in the first place (and not fixing it all with a single CL) is that I relied on the builders to test non-1.11 versions for "expediency" (I hoped to get around installing a pre-1.11 setup on my new laptop while on the go.) Lesson (re-)learned.

I still see a build failure for 1.9 but it is unrelated to the importers.

Please confirm this is now working again and close if so. Thanks.

@tkanos
Copy link

tkanos commented Jun 15, 2018

Hello @griesemer,
Next time, to do all your changes with calm,
Isn't it better to revert the changes that cause the issue, instead trying to resolve them on the hurry (that shouldn't be comfortable for you) ?

Good point of the adventure : Now all gophers know your name :D

@dominikh
Copy link
Member

Now all gophers know your name

All decent gophers should've already known his name :-)

@griesemer
Copy link

Hi @tkanos, you're absolutely right, of course.

maikelmclauflin added a commit to brave-intl/bat-go that referenced this issue Jul 9, 2018
@iwanbk
Copy link

iwanbk commented Jan 29, 2020

hi @griesemer

i still got this error with Go 1.10.8

$ go version
go version go1.10.8 darwin/amd64
$ go get -u golang.org/x/lint/golint
# golang.org/x/tools/go/internal/gcimporter
../../../golang.org/x/tools/go/internal/gcimporter/gcimporter.go:699:9: undefined: types.NewInterfaceType

@olivertang
Copy link

same issue, getting

$ go get -u golang.org/x/lint/golint
# golang.org/x/tools/go/internal/gcimporter
../../../golang.org/x/tools/go/internal/gcimporter/gcimporter.go:699:9: undefined: types.NewInterfaceType

can someone please help?

@griesemer
Copy link

It looks like golint is using an old version of x/tools/go/internal/gcimporter. The current version supports both 1.10 and newer.

@andybons
Copy link
Member

Making a CL...

@andybons andybons reopened this Jan 30, 2020
@iwanbk
Copy link

iwanbk commented Jan 31, 2020

thanks, works for Go 1.10 now

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

No branches or pull requests