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/gopls: no metadata for package #41209

Closed
matthewmueller opened this issue Sep 3, 2020 · 5 comments
Closed

x/tools/gopls: no metadata for package #41209

matthewmueller opened this issue Sep 3, 2020 · 5 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@matthewmueller
Copy link

matthewmueller commented Sep 3, 2020

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

$ go version
go version go1.15 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/m/Library/Caches/go-build"
GOENV="/Users/m/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/m/Go/pkg/mod"
GONOPROXY=""
GONOSUMDB="github.com/matthewmueller"
GOOS="darwin"
GOPATH="/Users/m/Go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/m/Go/src/github.com/matthewmueller/duo-blank/go.mod"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/4f/tcxcr6_55v9bp38d8g4hjlf80000gn/T/go-build780462967=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I'm working on some code generators right now, so I'm very often deleting the entire module and re-generating. Sometimes I tweak the generated code before re-generating. I'm using rm -rf ./duo-blank from the CLI to delete the project.

In this case, I added an articles_test.go, then ran rm -rf ./duo-blank, then re-generated. The re-generated code does not include a replacement articles_test.go.

It appears there's some cached metadata hasn't been cleared out.

What did you expect to see?

I expect to see this message The code in the workspace failed to compile less often.

What did you see instead?

It shows up every time I save, so it's a bit annoying.

CleanShot 2020-09-03 at 21 56 38@2x

The code in the workspace failed to compile (see the error message below). 
If you believe this is a mistake, please file an issue: https://github.com/golang/go/issues/new. 

no metadata for github.com/matthewmueller/duo-blank/controllers/articles_test 
[github.com/matthewmueller/duo-blank/controllers/articles.test]
@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Sep 3, 2020
@stamblerre
Copy link
Contributor

Is this with gopls/v0.4.4 (gopls version)? If so, I believe this has been fixed at master. You can try it out by downloading gopls at master: GO111MODULE=on go get golang.org/x/tools/gopls@master golang.org/x/tools@master.

@stamblerre stamblerre changed the title gopls: No metadata for package x/tools/gopls: no metadata for package Sep 3, 2020
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Sep 3, 2020
@gopherbot gopherbot added this to the Unreleased milestone Sep 3, 2020
@stapelberg
Copy link
Contributor

Can confirm: I ran into this message after deleting the only _test.go file of a package with gopls/v0.4.4.

After upgrading to master, I can no longer reproduce the issue, i.e. everything seems to work fine.

@matthewmueller
Copy link
Author

matthewmueller commented Sep 6, 2020

Sure, I'll give it another go. I'm currently on master for another reason (I forget why), but maybe the SHA can help.

golang.org/x/tools/gopls master
    golang.org/x/tools/gopls@v0.0.0-20200825202427-b303f430e36d h1:QyA0HwYgL5o8rGsDjB0IV8rfGHD0lYFlot/cqL6+LTY=

@stamblerre
Copy link
Contributor

I'm not actually sure when the bug was fixed, so I'd recommend updating to the current master.

@stamblerre stamblerre added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Sep 11, 2020
@stamblerre stamblerre removed this from the Unreleased milestone Sep 11, 2020
@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@golang golang locked and limited conversation to collaborators Oct 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants