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: v0.11.0 fails to find callers/references when compilation error in anciliary directory in a workspace #57727

Open
Seefooo opened this issue Jan 10, 2023 · 1 comment
Labels
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.
Milestone

Comments

@Seefooo
Copy link

Seefooo commented Jan 10, 2023

gopls version

gopls version
golang.org/x/tools/gopls v0.11.0
    golang.org/x/tools/gopls@v0.11.0 h1:/nvKHdTtePQmrv9XN3gIUN9MOdUrKzO/dcqgbG6x8EY=

go env

go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/ygamal/.cache/go-build"
GOENV="/home/ygamal/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/ygamal/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/ygamal/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go-1.18"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.18/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18.1"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/ygamal/workspace/maglev/go.mod"
GOWORK="/home/ygamal/workspace/maglev/go.work"
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-build753607085=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I updated from v0.10.1 to v0.11.0. Executing commands to get References or Callers will fail with a workspace error. Some of the our directories in src fail to build as they have an odd build setup that requires some external script to succeed.

  • gopls@v0.10.1 - gopls sees the build failures and I can see them being passed in some of the initial setup when introspecting the LSP comms between vim-go & gopls. When doing GoReferrers or GoCallers it doesn't seem to complain about the workspace errors, even though they have not really been fixed.
  • gopls@v0.11.0 - gopls sees the same build failures as above. When doing GoReferrers or GoCallers it still returns the same workspace loading failure.

The compilation failure is on a completely unrelated directory from what I can tell with some basic code poking.

What did you expect to see?

directories which are compiling to still be referable to/used by gopls.

What did you see instead?

gopls seems to ignore any workspace with compilation error in any of its directories, when it came to those calls. Finding Definitions seems to work still though.

Editor and settings

vim-go using gopls for pretty much everything. Using a go.work file also.

I can include logs or the LSP introspection if needed...but I am wondering if this is a bug or if this the correct expectation and v0.10.1 behavior was incidental. It makes gopls very difficult to use for larger projects, especially when bazel is involved, if this is the expected behavior.

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Jan 10, 2023
@gopherbot gopherbot added this to the Unreleased milestone Jan 10, 2023
@adonovan adonovan added NeedsFix The path to resolution is known, but the work has not been done. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. and removed NeedsFix The path to resolution is known, but the work has not been done. labels Jan 12, 2023
@adonovan adonovan modified the milestones: Unreleased, gopls/v0.12.0 Jan 12, 2023
@Seefooo
Copy link
Author

Seefooo commented Jan 19, 2023

Any thoughts on this? I am concerned with gopls being more restrictive about other packages' status in workspace, its going to make our life a lot harder, especially for bazel users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

No branches or pull requests

3 participants