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: can't resolve symbols from gVisor #48232

Closed
benbuzbee opened this issue Sep 8, 2021 · 3 comments
Closed

x/tools/gopls: can't resolve symbols from gVisor #48232

benbuzbee opened this issue Sep 8, 2021 · 3 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. 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. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@benbuzbee
Copy link

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

$go version
go version go1.16.2 linux/amd64

$ gopls version
golang.org/x/tools/gopls master
    golang.org/x/tools/gopls@(devel)
    
$ git log
commit 36045662144327e4475f9d356f49ab32ce730049 (HEAD -> master, origin/master, origin/HEAD)

Does this issue reproduce with the latest release?

Yes

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

go env Output
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/vagrant/.cache/go-build"
GOENV="/home/vagrant/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/vagrant/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/vagrant/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16.2"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/vagrant/go/src/golang.org/x/tools/gopls/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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1599495596=/tmp/go-build -gno-record-gcc-switches"

What did you do?

git clone --recursive https://github.com/google/gvisor.git
code ./gvisor

Open "pkg/sentry/watchdog/watchdog.go

Line 135, highlight *kernel.Kernel and press F12

	// k is where the tasks come from.
	k *kernel.Kernel

What did you expect to see?

gopls can resolve the symbol

What did you see instead?

[Error - 12:12:15 AM] Request textDocument/definition failed.
  Message: no object found for ident Kernel: no object found
  Code: 0 
@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Sep 8, 2021
@findleyr findleyr changed the title gopls Can't resolve symbols from gVisor x/tools/gopls Can't resolve symbols from gVisor Sep 8, 2021
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Sep 8, 2021
@gopherbot gopherbot added this to the Unreleased milestone Sep 8, 2021
@thanm
Copy link
Contributor

thanm commented Sep 8, 2021

I tried this same experiment using emacs + eglot (which uses gopls under the hood). It seems to resolve the symbol properly from what I can tell:

Screenshot from 2021-09-08 09-30-20

@thanm thanm added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 8, 2021
@stamblerre stamblerre changed the title x/tools/gopls Can't resolve symbols from gVisor x/tools/gopls: can't resolve symbols from gVisor Sep 8, 2021
@stamblerre
Copy link
Contributor

It looks like this project uses Bazel, which is not currently supported in gopls: https://github.com/golang/tools/blob/master/gopls/README.md#supported-go-versions-and-build-systems. However, there has been some work to improve support, and instructions can be found here: https://github.com/bazelbuild/rules_go/wiki/Editor-setup.

@stamblerre stamblerre added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Sep 8, 2021
@stamblerre stamblerre modified the milestones: Unreleased, gopls/unplanned Sep 9, 2021
@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.)

@stamblerre stamblerre removed this from the gopls/unplanned milestone Oct 14, 2021
@golang golang locked and limited conversation to collaborators Oct 14, 2022
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. 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. 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