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

x/tools/go/packages: internal error : without types was imported from #49164

Closed
nzlov opened this issue Oct 26, 2021 · 10 comments
Closed

x/tools/go/packages: internal error : without types was imported from #49164

nzlov opened this issue Oct 26, 2021 · 10 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@nzlov
Copy link

nzlov commented Oct 26, 2021

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

$ go version
go version devel go1.18-adfb85b315 Tue Oct 26 01:22:47 2021 +0000 darwin/amd64

Does this issue reproduce with the latest release?

no

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

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/jincai/Library/Caches/go-build"
GOENV="/Users/jincai/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/jincai/workspaces/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/jincai/workspaces/go"
GOPRIVATE=""
GOPROXY="https://goproxy.cn,direct"
GOROOT="/Users/jincai/program/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/jincai/program/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="devel go1.18-9ff91b9098 Fri Oct 22 00:57:18 2021 +0000"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/jincai/workspaces/jincai/jincai/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 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/8p/jydpmkt57bg0crgv50pf52gc0000gn/T/go-build1108979311=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

go run github.com/99designs/gqlgen --verbose

What did you expect to see?

nothing

What did you see instead?

internal error: package "github.com/vektah/gqlparser/v2/ast" without types was imported from "github.com/99designs/gqlgen/graphql/introspection"
exit status 1

Demo

@cuonglm
Copy link
Member

cuonglm commented Oct 26, 2021

Should be fixed on current tip a2b8c18

@nzlov
Copy link
Author

nzlov commented Oct 26, 2021

@cuonglm not fixed yet.

go version devel go1.18-283d8a3d53 Tue Oct 26 14:24:17 2021 +0000 darwin/amd64
internal error: package "github.com/vektah/gqlparser/v2/ast" without types was imported from "github.com/99designs/gqlgen/graphql/introspection"
exit status 1

@cuonglm cuonglm added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 26, 2021
@cuonglm cuonglm added this to the Go1.18 milestone Oct 26, 2021
@cuonglm
Copy link
Member

cuonglm commented Oct 26, 2021

cc @danscales @findleyr

@cuonglm
Copy link
Member

cuonglm commented Oct 26, 2021

@cuonglm not fixed yet.

go version devel go1.18-283d8a3d53 Tue Oct 26 14:24:17 2021 +0000 darwin/amd64
internal error: package "github.com/vektah/gqlparser/v2/ast" without types was imported from "github.com/99designs/gqlgen/graphql/introspection"
exit status 1

Oh, sounds like 99designs/gqlgen must be updated to use latest version of x/tools to support generic? The current version: https://github.com/99designs/gqlgen/blob/master/go.mod#L17

@cuonglm
Copy link
Member

cuonglm commented Oct 26, 2021

@cuonglm not fixed yet.

go version devel go1.18-283d8a3d53 Tue Oct 26 14:24:17 2021 +0000 darwin/amd64
internal error: package "github.com/vektah/gqlparser/v2/ast" without types was imported from "github.com/99designs/gqlgen/graphql/introspection"
exit status 1

Oh, sounds like 99designs/gqlgen must be updated to use latest version of x/tools to support generic? The current version: https://github.com/99designs/gqlgen/blob/master/go.mod#L17

Seems that update your repo is enough.

$ go get golang.org/x/tools@master
$ go mod tidy
$ go run github.com/99designs/gqlgen --verbose
Int is incompatible with uint
Int is incompatible with uint
/Users/cuonglm/godemo/models/todo.go:3 adding resolver method for Todo.user, nothing matched

@findleyr
Copy link
Contributor

Thanks @cuonglm

This looks similar to #49159 -- an error from go/packages due to mismatching export data version.

@seankhliao seankhliao changed the title internal error : without types was imported from x/tools/go/packages: internal error : without types was imported from Oct 26, 2021
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Oct 26, 2021
@seankhliao
Copy link
Member

Seems like this is fixed on HEAD

@mvdan
Copy link
Member

mvdan commented Nov 19, 2021

@findleyr will you make an x/tools release before 1.18beta1? A couple of my tools have started running into this error, and I hadn't picked up this fix because I generally avoid reaching for master dependency updates.

@findleyr
Copy link
Contributor

@mvdan thanks for calling this out! I will be sure to do an x/tools release before beta1, probably next week.

@findleyr
Copy link
Contributor

findleyr commented Dec 6, 2021

(we tagged x/tools on Friday)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

6 participants