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: make -remote=auto resilient to changing TMPDIR #41266

Closed
findleyr opened this issue Sep 7, 2020 · 2 comments
Closed

x/tools/gopls: make -remote=auto resilient to changing TMPDIR #41266

findleyr opened this issue Sep 7, 2020 · 2 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.
Milestone

Comments

@findleyr
Copy link
Contributor

findleyr commented Sep 7, 2020

Recently, each neovim/coc.nvim process has started assigning a unique $TMPDIR (e.g. /tmp/nvimPuWNII). This breaks the current daemon discovery (when using -remote=auto), which looks for a deterministic unix domain socket path inside os.TempDir().

We should either make -remote=auto behave independently of os.TempDir(), or (more feasibly) provide the means to work-around it without having to manage the daemon manually. Something like -remote.tempdir=/tmp, though I may have to rethink the way that the remote is parameterized, as we already have a lot of -remote.* flags.

Reported here: https://groups.google.com/g/golang-tools/c/y3OQNIudLzQ/m/7JYRgEZSAgAJ

@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 Sep 7, 2020
@gopherbot gopherbot added this to the Unreleased milestone Sep 7, 2020
@findleyr findleyr changed the title x/tools/gopls: make --remote=auto resilient to changing TMPDIR x/tools/gopls: make -remote=auto resilient to changing TMPDIR Sep 7, 2020
@findleyr findleyr self-assigned this Sep 7, 2020
@stamblerre stamblerre removed this from the Unreleased milestone Sep 11, 2020
@stamblerre stamblerre added this to the gopls/unplanned milestone Oct 21, 2020
@stamblerre stamblerre added this to Needs Triage in vscode-go: gopls by default Nov 13, 2020
@stamblerre stamblerre moved this from Needs Triage to Critical in vscode-go: gopls by default Nov 13, 2020
@stamblerre stamblerre removed this from Critical in vscode-go: gopls by default Nov 18, 2020
@gopherbot
Copy link

Change https://golang.org/cl/274272 mentions this issue: internal/lsp/lsprpc: prefer XDG_RUNTIME_DIR for the daemon socket

gopherbot pushed a commit to golang/tools that referenced this issue Dec 1, 2020
If XDG_RUNTIME_DIR is set, it makes more sense as a location for the
gopls daemon socket than TMPDIR.

This avoids auto discovery issues when TMPDIR is overridden for certain
editors.

For golang/go#41266

Change-Id: I5a0a20c6185ca60d8ff03b8d948b17a636aa8404
Reviewed-on: https://go-review.googlesource.com/c/tools/+/274272
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
@findleyr
Copy link
Contributor Author

I think using XDG_RUNTIME_DIR was the correct fix, so I'll mark this closed.

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.
Projects
None yet
Development

No branches or pull requests

3 participants