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: dependency leaks across modules #32499

Open
fhs opened this issue Jun 8, 2019 · 0 comments

Comments

Projects
None yet
3 participants
@fhs
Copy link
Contributor

commented Jun 8, 2019

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

$ go version
go version devel +ce656af9b5 Sun Jun 2 19:28:21 2019 +0000 linux/amd64
$ gopls version
golang.org/x/tools/cmd/gopls
    golang.org/x/tools@v0.0.0-20190608022120-eacb66d2a7c3 h1:sU3tSV6wDhWsvf9NjL0FzRjgAmYnQL5NEhdmcN16UEg=

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

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/fhs/.cache/go-build"
GOENV="/home/fhs/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/fhs/go"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/big/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/big/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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-build362340636=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Load more than one module in gopls. Each module has its own workspace folder, passed in the workspaceFolders initialization option.

What did you expect to see?

No changes to go.mod file for any of the modules.

What did you see instead?

I have 2 files open in my editor, where the two files are from two different modules. When I start the LSP client, it sends a DidOpen notification for those two files. Depending on which notification was sent first, the dependencies of one module gets added to the go.mod file of the other module. Example:

DidOpen file:///path/to/mod1/foo.go
DidOpen file:///path/to/mod2/foo.go
# mod2's go.mod file will get mod1 dependencies added

Similarly, for 3 modules:

DidOpen file:///path/to/mod1/foo.go
DidOpen file:///path/to/mod2/foo.go
DidOpen file:///path/to/mod3/foo.go
# mod2's go.mod file will get mod1 dependencies added
# mod3's go.mod file will get mod1 and mod2 dependencies added

@gopherbot gopherbot added this to the Unreleased milestone Jun 8, 2019

@gopherbot gopherbot added the gopls label Jun 8, 2019

@stamblerre stamblerre changed the title x/tools/cmd/gopls: dependency leaks across modules x/tools/gopls: dependency leaks across modules Jul 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.