-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: "no metadata for" error when mode contains LoadTypes without LoadImports #32814
Comments
cc @matloob |
Change https://golang.org/cl/184165 mentions this issue: |
I've got a fix in progress. It doesn't quite work completely yet. |
I'm hitting this for packages that use Cgo ( Might also be related to this golangci issue. |
Before separating Load* into Need* we could use LoadSyntax to get types information by loading inital packages from source code and loading it's direct dependencies from export data. It was broken when separation was introduced and before this commit everything was loading from source code what resulted into slow loading times. This commit fixes it. Also, do backwards-incompatible fix of definition of deprecated LoadImports and LoadAllSyntax. Improve an internal error message "internal error: nil Pkg importing x from y": replace it with "internal error: package x without types was imported from y". Remove packages.NeedDeps request for loading in tests TestLoadTypesBits and TestContainsOverlayXTest. Fixes golang/go#31752, fixes golang/go#33077, fixes golang/go#32814, fixes golang/go#31699, golang/go#31930
Before separating Load* into Need* we could use LoadSyntax to get types information by loading inital packages from source code and loading it's direct dependencies from export data. It was broken when separation was introduced and before this commit everything was loading from source code what resulted into slow loading times. This commit fixes it. Also, do backwards-incompatible fix of definition of deprecated LoadImports and LoadAllSyntax. Improve an internal error message "internal error: nil Pkg importing x from y": replace it with "internal error: package x without types was imported from y". Remove packages.NeedDeps request for loading in tests TestLoadTypesBits and TestContainsOverlayXTest. Fixes golang/go#31752, fixes golang/go#33077, fixes golang/go#32814, fixes golang/go#31699, fixes golang/go#31930
Change https://golang.org/cl/186337 mentions this issue: |
Before separating Load* into Need* we could use LoadSyntax to get types information by loading inital packages from source code and loading it's direct dependencies from export data. It was broken when separation was introduced and before this commit everything was loading from source code what resulted into slow loading times. This commit fixes it. Also, do backwards-incompatible fix of definition of deprecated LoadImports and LoadAllSyntax. Improve an internal error message "internal error: nil Pkg importing x from y": replace it with "internal error: package x without types was imported from y". Remove packages.NeedDeps request for loading in tests TestLoadTypesBits and TestContainsOverlayXTest. Fixes golang/go#31752, fixes golang/go#33077, fixes golang/go#32814, fixes golang/go#31699, fixes golang/go#31930
Before separating Load* into Need* we could use LoadSyntax to get types information by loading inital packages from source code and loading it's direct dependencies from export data. It was broken when separation was introduced and before this commit everything was loading from source code what resulted into slow loading times. This commit fixes it. Also, do backwards-incompatible fix of definition of deprecated LoadImports and LoadAllSyntax. Improve an internal error message "internal error: nil Pkg importing x from y": replace it with "internal error: package x without types was imported from y". Remove packages.NeedDeps request for loading in tests TestLoadTypesBits and TestContainsOverlayXTest. Fixes golang/go#31752, fixes golang/go#33077, fixes golang/go#32814, fixes golang/go#31699, fixes golang/go#31930 Change-Id: I416e3c1035d555d67039e45a4fdd1deb9b2184ef GitHub-Last-Rev: 2e3a46e GitHub-Pull-Request: #139 Reviewed-on: https://go-review.googlesource.com/c/tools/+/186337 Reviewed-by: Michael Matloob <[email protected]>
Before separating Load* into Need* we could use LoadSyntax to get types information by loading inital packages from source code and loading it's direct dependencies from export data. It was broken when separation was introduced and before this commit everything was loading from source code what resulted into slow loading times. This commit fixes it. Also, do backwards-incompatible fix of definition of deprecated LoadImports and LoadAllSyntax. Improve an internal error message "internal error: nil Pkg importing x from y": replace it with "internal error: package x without types was imported from y". Remove packages.NeedDeps request for loading in tests TestLoadTypesBits and TestContainsOverlayXTest. Fixes golang/go#31752, fixes golang/go#33077, fixes golang/go#32814, fixes golang/go#31699, fixes golang/go#31930 Change-Id: I416e3c1035d555d67039e45a4fdd1deb9b2184ef GitHub-Last-Rev: 2e3a46e GitHub-Pull-Request: golang#139 Reviewed-on: https://go-review.googlesource.com/c/tools/+/186337 Reviewed-by: Michael Matloob <[email protected]>
What version of Go are you using (
go version
)?go version devel +0d4de70c1c2 Thu Jun 27 17:26:05 2019 +0000 darwin/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I want to load type information for a set of packages. I tried to use this mode:
This doesn't include
NeedImports
orNeedDeps
. I know thatgo/packages
needs to load transitive imports (or their export data) to get type information, but I don't care if theImports
field is populated in the returned packages.This can be reproduced with the program below using golang.org/x/tools v0.0.0-20190627185803-429858501117:
What did you expect to see?
I get a strange error message like:
The message changes from run to run (I think it can be any imported package).
What did you see instead?
Type information loaded successfully.
Imports
fieldnil
in returned packages.The text was updated successfully, but these errors were encountered: