-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/gopls: handle discrepancies in Go environment when connecting to daemon #37830
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
Comments
Thank you for filing a gopls issue! Please take a look at the Troubleshooting guide, and make sure that you have provided all of the relevant information here. |
My personal recommendation would be something in the middle, hashing a few known-common things to get most of the cases correct and leaving the rest to documentation/warnings. Off the top of my head I would think this list for the average user is:
Many other things can end up mattering ( |
We can still set environment variables used by My two cents: keep things super simple for the majority (for now), and experiment with making the caller do the hard work if they want to handle more complex situations. This is, incidentally, why I requested support for what @findleyr kindly delivered via This way if patterns of usage start to emerge where lots of people are running into problem X then we could look at have |
My issue with this approach is that I think
Which cases would |
I completely agree with this point. I'm very much in favour of having zero logic in the client/editor. The distinction I draw here is that it's the user who is necessarily defining the key, because the client/editor also can't know.
Basically any path. e.g. where |
That seems reasonable. Here's what I'll do: first, I'll create a key-value map of environment values that affect execution, compare them in the handshake, and raise an error if there is a mismatch. Then we can wait for people to complain that this error occurs under normal operation, and in those cases we can hash the environment value in question into the daemon path. Enough people use different versions of the |
Change https://golang.org/cl/234109 mentions this issue: |
Forked from @zikaeroh's comment on #34111:
#34111 (comment)
This point could be generalized to any change in
go env
that would affect the behavior of the daemon. One solution is to hash all relevant environment into the automatic daemon socket path (so that different environments should get different daemons) -- we do this for thegopls
build ID. But as @zikaeroh points out, this becomes a slippery slope.Another option would be to carefully document this behavior, compare environments in the forwarder-daemon handshake, and issue loud warnings.
The text was updated successfully, but these errors were encountered: