-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: Upgrade check on Go 1.22 projects fails #66055
Comments
cc @findleyr |
Thanks for the report. Indeed, this looks like a recent regression related to some refactoring I did in the gocommand package (we fall back to the default value for the Should be straightforward to reproduce and fix, thanks to your analysis. |
Hi @findleyr this is affecting me and I'm unsure what to do to get around it. There's countless OSS projects I maintain in Go that need minor updates to go.mod for CVEs etc, and this is blocking for the time being? Thanks Alex |
Hi @alexellis, I will try to prioritize this fix. It looks like we will have a [email protected] soon, and if feasible I'll cherry-pick this fix in as well. However, even if it misses that release you can always install gopls from master as soon as the fix lands. |
Change https://go.dev/cl/569877 mentions this issue: |
Change https://go.dev/cl/569878 mentions this issue: |
…when checking for upgrades When a vendor directory is present, we must explicitly use -mod=readonly to query upgrades with `go list`. This was broken by the fixes for workspace vendoring, which removed the `-mod` flag in most usage of the gocommand package. Fixes golang/go#66055 Change-Id: I29efb617a8fe56e9752dc088dc5ea884f1cefb86 Reviewed-on: https://go-review.googlesource.com/c/tools/+/569877 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Alan Donovan <[email protected]> (cherry picked from commit c178933) Reviewed-on: https://go-review.googlesource.com/c/tools/+/569878 Reviewed-by: Nooras Saba <[email protected]> Auto-Submit: Robert Findley <[email protected]>
This is fixed in the gopls prerelease:
We will likely release this early next week. |
When a vendor directory is present, we must explicitly use -mod=readonly to query upgrades with `go list`. This was broken by the fixes for workspace vendoring, which removed the `-mod` flag in most usage of the gocommand package. Fixes golang/go#66055 Change-Id: I29efb617a8fe56e9752dc088dc5ea884f1cefb86 Reviewed-on: https://go-review.googlesource.com/c/tools/+/569877 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Alan Donovan <[email protected]>
gopls version
v0.15.1
go env
What did you do?
I updated a project to use Go 1.22 and set
go 1.22.0
in thego.mod
file. After that I pressed theCheck for upgrades
button in VSCode.What did you see happen?
Error by VSCode saying:
My guess is that this is the root cause, as the
go list -m -u -json
command fails on my command prompt as well. When I add"buildFlags": ["-mod=mod"],
to the gopls config in vscode, it's starting to work again.What did you expect to see?
A running upgrade check that marks dependencies that can be updated.
Editor and settings
Logs
The text was updated successfully, but these errors were encountered: