-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: panic in Analyze with patch version in go.mod file #66636
Comments
This is exactly like #66195, but in Analyze rather than TypeCheck. Transferring to the Go issue tracker, and fixing in gopls@v0.15.3. |
For now, a viable workaround is to install gopls with go1.21+. However, since this version of gopls nominally supports being built with 1.20, we should fix the crash. |
Change https://go.dev/cl/576135 mentions this issue: |
Change https://go.dev/cl/577301 mentions this issue: |
…ot.Analyze with patch versions Fix the same crash as golang/go#66195, this time in Analyze: don't set invalid Go versions on the types.Config. The largest part of this change was writing a realistic test, since the lack of a test for golang/go#66195 caused us to miss this additional location. It was possible to create a test that worked, by using a flag to select a go1.21 binary location. For this test, it was required to move a couple additional integration test preconditions into integration.Main (otherwise, the test would be skipped due to the modified environment). Updates golang/go#66636 Updates golang/go#66730 Change-Id: I24385474d4a6ebf6b7e9ae8f20948564bad3f55e Reviewed-on: https://go-review.googlesource.com/c/tools/+/576135 Auto-Submit: Robert Findley <rfindley@google.com> Reviewed-by: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> (cherry picked from commit c623a28) Reviewed-on: https://go-review.googlesource.com/c/tools/+/577301
Thanks for the tip, it rarely crash though, looking forward to the fix |
gopls version: v0.15.2/go1.20.4
gopls flags:
update flags: proxy
extension version: 0.41.2
environment: Visual Studio Code darwin
initialization error: undefined
issue timestamp: Sat, 30 Mar 2024 00:43:17 GMT
restart history:
Fri, 29 Mar 2024 22:57:47 GMT: activation (enabled: true)
ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.
Describe what you observed.
gopls stats -anon
{ "DirStats": { "Files": 29, "TestdataFiles": 0, "GoFiles": 1, "ModFiles": 1, "Dirs": 20 }, "GOARCH": "arm64", "GOOS": "darwin", "GOPACKAGESDRIVER": "", "GOPLSCACHE": "", "GoVersion": "go1.20.4", "GoplsVersion": "v0.15.2", "InitialWorkspaceLoadDuration": "55.90625ms", "MemStats": { "HeapAlloc": 2758320, "HeapInUse": 5218304, "TotalAlloc": 12841176 }, "WorkspaceStats": { "Files": { "Total": 2, "Largest": 57, "Errs": 0 }, "Views": [ { "GoCommandVersion": "go1.22.1", "AllPackages": { "Packages": 1, "LargestPackage": 1, "CompiledGoFiles": 1, "Modules": 1 }, "WorkspacePackages": { "Packages": 1, "LargestPackage": 1, "CompiledGoFiles": 1, "Modules": 1 }, "Diagnostics": 1 } ] } }OPTIONAL: If you would like to share more information, you can attach your complete gopls logs.
NOTE: THESE MAY CONTAIN SENSITIVE INFORMATION ABOUT YOUR CODEBASE.
DO NOT SHARE LOGS IF YOU ARE WORKING IN A PRIVATE REPOSITORY.
<OPTIONAL: ATTACH LOGS HERE>
The text was updated successfully, but these errors were encountered: