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: update to use the GOWORK environment variable rather than -workfile #51215

Closed
findleyr opened this issue Feb 15, 2022 · 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

In #51171, the go command is going to be updated to use the GOWORK environment variable to detect the active go.work file, rather than -workfile.

Once this is done we will need to update gopls accordingly. Ideally, we could also detect if the go command supports -workfile (e.g. by trying go list -workfile -notaflag and parsing the output).

Marking as a release blocker as I'd like to avoid breaking gopls users with the RC. This should be a straightforward change in gopls, that I will make as soon as the go command change lands.

@findleyr findleyr added this to the Go1.18 milestone Feb 15, 2022
@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 Feb 15, 2022
@findleyr
Copy link
Contributor Author

I'm going to leave this issue open until the requisite gopls fixes land in the next gopls prerelease, which we expect to be tomorrow or (more likely) Thursday.

@findleyr findleyr self-assigned this Feb 15, 2022
@findleyr
Copy link
Contributor Author

findleyr commented Feb 16, 2022

Well, it turns out that I missed a step threading -workfile through go/packages, so the current gopls prerelease will not error due to the -workfile flag. This didn't affect gopls' functionality because we simultaneously updated gopls to run the go command from the workspace root, so it finds the correct go.work in any case. It would only have mattered if we were to run go/packages.Load on unsaved go.work overlays, which we currently don't do to avoid churn.

So this is not a release blocker, and uncovered a latent bug...

@findleyr findleyr modified the milestones: Go1.18, gopls/v0.8.1 Feb 17, 2022
@findleyr findleyr modified the milestones: gopls/v0.8.1, gopls/v0.8.2 Mar 14, 2022
@findleyr findleyr modified the milestones: gopls/v0.8.2, gopls/v0.8.3 Mar 31, 2022
@findleyr findleyr closed this as completed Apr 5, 2022
@golang golang locked and limited conversation to collaborators Jun 22, 2023
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

2 participants