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: "could not locate file for primary type checker error" bug reported by telemetry #66765

Open
adonovan opened this issue Apr 10, 2024 · 6 comments
Labels
gopls/telemetry-wins gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@adonovan
Copy link
Member

adonovan commented Apr 10, 2024

#!stacks
"bug.Reportf" && 
  ("typeErrorsToDiagnostics.func1:+40" || 
   "typeErrorsToDiagnostics.func1:+46" ||
    "typeErrorsToDiagnostics.func1:+53")

This stack aJzeGA was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Reportf:+1
golang.org/x/tools/gopls/internal/cache.typeErrorsToDiagnostics.func1:+40
golang.org/x/tools/gopls/internal/cache.typeErrorsToDiagnostics:+119
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).checkPackage:+127
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).handleSyntaxPackage:+70
golang.org/x/tools/gopls/internal/cache.(*Snapshot).forEachPackageInternal.func2:+1
golang.org/x/sync/errgroup.(*Group).Go.func1:+3
runtime.goexit:+0
golang.org/x/tools/gopls@v0.15.2 go1.22.1 linux/amd64 vscode (1)

Issue created by golang.org/x/tools/gopls/internal/telemetry/cmd/stacks.

Closely related to:

Dups: 2oh2Vg 2gV6qw EJlu6A gvV3Aw

@adonovan adonovan added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. gopls/telemetry-wins labels Apr 10, 2024
@gopherbot gopherbot added this to the Unreleased milestone Apr 10, 2024
@adonovan adonovan modified the milestones: Unreleased, gopls/v0.16.0 Apr 11, 2024
@adonovan
Copy link
Member Author

This stack 2oh2Vg was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Reportf:+1
golang.org/x/tools/gopls/internal/cache.typeErrorsToDiagnostics.func1:+40
golang.org/x/tools/gopls/internal/cache.typeErrorsToDiagnostics:+122
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).checkPackage:+127
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).handleSyntaxPackage:+70
golang.org/x/tools/gopls/internal/cache.(*Snapshot).forEachPackageInternal.func2:+1
golang.org/x/sync/errgroup.(*Group).Go.func1:+3
runtime.goexit:+0
golang.org/x/tools/gopls@v0.15.3 go1.22.0 darwin/arm64 vscode (1)

Issue created by golang.org/x/tools/gopls/internal/telemetry/cmd/stacks.

@adonovan
Copy link
Member Author

This stack 2gV6qw was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Reportf:+1
golang.org/x/tools/gopls/internal/cache.typeErrorsToDiagnostics.func1:+46
golang.org/x/tools/gopls/internal/cache.typeErrorsToDiagnostics:+153
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).checkPackage:+128
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).handleSyntaxPackage:+70
golang.org/x/tools/gopls/internal/cache.(*Snapshot).forEachPackageInternal.func2:+1
golang.org/x/sync/errgroup.(*Group).Go.func1:+3
runtime.goexit:+0
golang.org/x/tools/gopls@v0.16.1 go1.22.1 windows/amd64 vscode (1)

Issue created by golang.org/x/tools/gopls/internal/telemetry/cmd/stacks.

@findleyr findleyr modified the milestones: gopls/v0.17.0, gopls/v0.18.0 Oct 22, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/621876 mentions this issue: gopls/internal/cache: refine bug reports

gopherbot pushed a commit to golang/tools that referenced this issue Oct 22, 2024
Refine a few bug reports related to incorrectly positioned type checker
errors, by differentiating the 'fixed file' case from the case with no
fixed files.

Since we haven't made progress on these bugs, we need more information
to guide our debugging.

If the bugs only occur in the presence of AST fixes, we can probably
downgrade them to not be a bug: if we're fixing the AST, we won't
display type checker errors anyway. Nevertheless, leave the bug reports
for now, so that we can collect data.

For golang/go#65960
For golang/go#66765
For golang/go#66766

Change-Id: I2060c897d249cdd5cc3e7bb183d3f563987bec57
Reviewed-on: https://go-review.googlesource.com/c/tools/+/621876
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Robert Findley <rfindley@google.com>
@adonovan
Copy link
Member Author

The latest stack is a refinement indicating that pkg.hasFixedFiles() is false, so AST fixing is not to blame.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls/telemetry-wins gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants