-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: "unexpected files in command-line-arguments package" bug (via telemetry) #64557
Comments
Apparently one can create a command-line-arguments package with zero CompiledGoFiles:
|
Change https://go.dev/cl/560465 mentions this issue: |
This stack
Issue created by golang.org/x/tools/gopls/internal/telemetry/cmd/stacks. |
This stack buildMetadata:14 is:
Issue created by golang.org/x/tools/gopls/internal/telemetry/cmd/stacks. |
Reopening due to new field reports at v0.15. |
This stack
Issue created by golang.org/x/tools/gopls/internal/telemetry/cmd/stacks. |
This stack
Issue created by golang.org/x/tools/gopls/internal/telemetry/cmd/stacks. |
This stack
Issue created by golang.org/x/tools/gopls/internal/telemetry/cmd/stacks. |
This stack
Issue created by golang.org/x/tools/gopls/internal/telemetry/cmd/stacks. |
This stack
Issue created by golang.org/x/tools/gopls/internal/telemetry/cmd/stacks. |
This stack
Issue created by golang.org/x/tools/gopls/internal/telemetry/cmd/stacks. |
This stack
Issue created by golang.org/x/tools/gopls/internal/telemetry/cmd/stacks. |
27 reported crashes this week... I really need to make some progress on this one. |
The bug indicates that there are multiple .go files in a Crazy thought: Is it possible for strings of the form "*.go" or "file=foo.go" to arise from the other kinds of scopes? If so, it would have to be a So I think the answer must lie in go list. Perhaps @matloob has some insight.
|
This stack
Issue created by golang.org/x/tools/gopls/internal/telemetry/cmd/stacks. |
@siddharthab brilliant, your example reproduces this bug: > cat main.go
//go:build ignore
package main
import (
"C"
"fmt"
)
func main() {
fmt.Println("hello")
}
> gopackages -json main.go
{
"ID": "command-line-arguments",
"Name": "main",
"PkgPath": "command-line-arguments",
"GoFiles": [
"/usr/local/google/home/rfindley/tmp/issue69564/main.go"
],
"CompiledGoFiles": [
"/usr/local/google/home/rfindley/.cache/go-build/4f/4f33c431ad5b11b8412d2953424eba9d58dbf1d77b3e1615678c780818d41a90-d",
"/usr/local/google/home/rfindley/.cache/go-build/1f/1fd9171548b0ac0469be2115b2cc31122dcc5b856ff816129e0ff63e07d514e6-d",
"/usr/local/google/home/rfindley/.cache/go-build/79/79bea79feab5807a48466230c80ae7822f4276a69f3abb41d051d784aa1552e9-d"
],
"Imports": {
"fmt": "fmt",
"runtime/cgo": "runtime/cgo",
"syscall": "syscall",
"unsafe": "unsafe"
}
} |
Change https://go.dev/cl/627776 mentions this issue: |
Previously, we were using the first CompiledGoFiles to disambiguate the ID of command-line-arguments packages, but in the presence of cgo preprocessing there can actually be multiple CompiledGoFiles, leading to the bug report of golang/go#64557. Fix this by using GoFiles instead. Fixes golang/go#64557 Change-Id: I3eff976d07da32db1f26ced69228af41a388d9a1 Reviewed-on: https://go-review.googlesource.com/c/tools/+/627776 Reviewed-by: Alan Donovan <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Robert Findley <[email protected]>
Reopening since this has been observed in gopls/v0.17.1. (We should automate that; #71045.) |
Thanks. Back to the drawing board, I suppose. |
Yay! Repro at #64557 (comment)
This stacks
EVz2Fg
,ELG5Yw
,ND0D7A
were reported by telemetry:Issue created by golang.org/x/tools/gopls/internal/telemetry/cmd/stacks.
Duplicates:
This stack
dDf6yw
was reported by telemetry:This stack
Es6nFQ
was reported by telemetry:Issue created by golang.org/x/tools/gopls/internal/telemetry/cmd/stacks.
This stack
OBhdqw
was reported by telemetry:Issue created by golang.org/x/tools/gopls/internal/telemetry/cmd/stacks.
Dups: gRw1-A ibW47g Dfhd-g _p1kkQ RcEuHA fJJ7HA e0uUFg 9M1npA WNZ--Q SmQ1mg v1Eb2g DdP2cQ 5Um4Rg yWpCHQ ziMhMQ 49eF6g rAKLNA bm9HIg EOWgnA ajbd5g 4Kmr1A ztITlA LmpcWQ daD0Wg NrjaNg ci33qA iVSJBQ bune9w xVlXmw IGBQ2g
The text was updated successfully, but these errors were encountered: