Skip to content

x/tools/gopls: "package name is %q, want %q" bug in typeCheckBatch.importPackage #64235

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

Open
adonovan opened this issue Nov 17, 2023 · 33 comments
Labels
gopls/telemetry-wins 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

@adonovan
Copy link
Member

adonovan commented Nov 17, 2023

#!stacks
"bug.Errorf" &&
(/* item.Path == mp.PkgPath */
  "importPackage.func1:+14" ||
 "importPackage.func1:+15" ||
 "importPackage.func1:+18" ||
  /* item.Path != mp.PkgPath */
 "importPackage.func1:+40" ||
  /* pkg.Name() == "" */
 "importPackage.func1:+49")

This stack 5MRL7A, _ZM1lw was reported by telemetry:

cache.(*typeCheckBatch).importPackage.func1:19 is

			// debugging issue #60904
			if pkg.Name() != item.Name {
				return bug.Errorf("internal error: package name is %q, want %q (id=%q, path=%q) (see issue #60904)",
					pkg.Name(), item.Name, id, item.Path)
			}

The related issue #63822 appears to have the same root cause: there are duplicate package paths in the export data manifest; see #63822 (comment).

This stack PXUK4g was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Errorf:+2
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage.func1:+14
golang.org/x/tools/internal/gcimporter.iimportCommon:+124
golang.org/x/tools/internal/gcimporter.IImportShallow:+3
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+57
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getImportPackage:+56
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).handleSyntaxPackage.func2:+1
golang.org/x/sync/errgroup.(*Group).Go.func1:+3
runtime.goexit:+0

golang.org/x/tools/[email protected] go1.23.0 darwin/arm64 neovim (1)
golang.org/x/tools/[email protected] go1.22.6 linux/amd64 other,vscode (2)
golang.org/x/tools/[email protected] go1.22.0 darwin/arm64 vscode (1)
golang.org/x/tools/[email protected] go1.22.3 darwin/arm64 vscode (1)
golang.org/x/tools/[email protected] go1.23.0 linux/amd64 vscode (1)
golang.org/x/tools/[email protected] go1.22.6 darwin/arm64 vscode (2)
golang.org/x/tools/[email protected] go1.23.0 linux/amd64 vscode (1)
golang.org/x/tools/[email protected] go1.22.5 darwin/arm64 neovim (1)
golang.org/x/tools/[email protected] go1.22.5 linux/amd64 vscode (2)
golang.org/x/tools/[email protected] go1.20.8 darwin/amd64 vscode (1)
golang.org/x/tools/[email protected] go1.22.4 darwin/arm64 other,vscode (1)
golang.org/x/tools/[email protected] go1.22.0 darwin/arm64 neovim,other (1)
golang.org/x/tools/[email protected] go1.22.6 darwin/arm64 other,vscode (1)
golang.org/x/tools/[email protected] go1.22.6 darwin/amd64 other (1)
golang.org/x/tools/[email protected] go1.23.0 darwin/arm64 vscode (1)
golang.org/x/tools/[email protected] go1.21.7 linux/amd64 vscode (1)
golang.org/x/tools/[email protected] go1.20.7 linux/amd64 vscode (2)
golang.org/x/tools/[email protected] go1.22.0 linux/amd64 vscode (1)
golang.org/x/tools/[email protected] go1.21.7 linux/amd64 vscode (1)
golang.org/x/tools/[email protected] go1.22.5 darwin/arm64 vscode (1)
golang.org/x/tools/[email protected] go1.23.0 darwin/arm64 vscode (6)

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

gopls/bug
golang.org/x/tools/gopls/internal/bug.report:35
golang.org/x/tools/gopls/internal/bug.Errorf:2
golang.org/x/tools/gopls/internal/lsp/cache.(*typeCheckBatch).importPackage.func1:19
golang.org/x/tools/internal/gcimporter.iimportCommon:116
golang.org/x/tools/internal/gcimporter.IImportShallow:3
golang.org/x/tools/gopls/internal/lsp/cache.(*typeCheckBatch).importPackage:41
golang.org/x/tools/gopls/internal/lsp/cache.(*typeCheckBatch).getImportPackage:55
golang.org/x/tools/gopls/internal/lsp/cache.(*typeCheckBatch).awaitPredecessors.func1:1
golang.org/x/sync/errgroup.(*Group).Go.func1:3
runtime.goexit:0
golang.org/x/tools/[email protected] go1.21.3 linux/amd64 (2)
golang.org/x/tools/[email protected] go1.19.1 darwin/amd64 (1)

Reported using golang.org/x/tools/gopls/internal/telemetry/cmd/stacks.

This stack aiQRfw was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:35
golang.org/x/tools/gopls/internal/util/bug.Errorf:2
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage.func1:14
golang.org/x/tools/internal/gcimporter.iimportCommon:123
golang.org/x/tools/internal/gcimporter.IImportShallow:3
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:57
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getImportPackage:55
golang.org/x/tools/gopls/internal/cache.(*Snapshot).forEachPackageInternal.func1:1
golang.org/x/sync/errgroup.(*Group).Go.func1:3
runtime.goexit:0
golang.org/x/tools/[email protected] go1.22rc2 linux/amd64 vscode (1)

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

Dups: ebxaEQ 2vh0nQ

This stack KVl6Kg was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Errorf:+2
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage.func1:+14
golang.org/x/tools/internal/gcimporter.iimportCommon:+123
golang.org/x/tools/internal/gcimporter.IImportShallow:+3
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+57
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getImportPackage:+55
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).handleSyntaxPackage.func2:+1
golang.org/x/sync/errgroup.(*Group).Go.func1:+3
runtime.goexit:+0
golang.org/x/tools/[email protected] go1.22.0 darwin/arm64 vscode (1)

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

Dups: Ar_rPw 33irXg PXUK4g ptgmiQ j64HJw FjuvhQ rlqkaQ

Dups without stacks (too numerous): T YioIw
Dups: 8lUnNg nHnxwA C0oOoQ orz9eg LWE90w b-ZEYg lz1QUA JtyMWA JITKgg MP8B4Q n5Nrkw vIomOQ HfwAjw URzRLA HvwCZQ KkBf4g

@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 Nov 17, 2023
@gopherbot gopherbot added this to the Unreleased milestone Nov 17, 2023
@adonovan adonovan changed the title x/tools/gopls: bug reported by telemetry [5MRL7A] x/tools/gopls: bug in typeCheckBatch.importPackage reported by telemetry [5MRL7A] Nov 17, 2023
@adonovan adonovan changed the title x/tools/gopls: bug in typeCheckBatch.importPackage reported by telemetry [5MRL7A] x/tools/gopls: bug in typeCheckBatch.importPackage reported by telemetry Nov 17, 2023
@findleyr findleyr modified the milestones: Unreleased, gopls/v0.15.0 Nov 17, 2023
@findleyr
Copy link
Member

Would love to see the error message for this one.

@findleyr
Copy link
Member

Since we added this bug report specifically because we couldn't figure it out, I don't think we're going to make easy progress without the content.

I'm not sure what to do about this, but it's not going to get resolved for v0.15.0.

@findleyr findleyr modified the milestones: gopls/v0.15.0, gopls/v0.16.0 Dec 15, 2023
@adonovan
Copy link
Member Author

The 15.0-pre2 stack I just appended to the original node implicates this statement:

				// debugging issues #60904, #64235
				if pkg.Name() != item.Name {
					// This would mean that mp.Name != item.Name, so the
					// manifest in the export data of mp.PkgPath is
					// inconsistent with mp.Name. Or perhaps there
					// are duplicate PkgPath items in the manifest?
					return bug.Errorf("internal error: package name is %q, want %q (id=%q, path=%q) (see issue #60904)",
						pkg.Name(), item.Name, id, item.Path)
				}

@adonovan
Copy link
Member Author

This stack 2vh0nQ was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Errorf:+2
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage.func1:+14
golang.org/x/tools/internal/gcimporter.iimportCommon:+123
golang.org/x/tools/internal/gcimporter.IImportShallow:+3
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+57
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getImportPackage:+55
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).typesConfig.func1:+20
golang.org/x/tools/gopls/internal/cache.importerFunc.Import:+0
go/types.(*Checker).importPackage:+28
go/types.(*Checker).collectObjects.func1:+13
go/types.(*Checker).walkDecl:+9
go/types.(*Checker).walkDecls:=399
go/types.(*Checker).collectObjects:+42
go/types.(*Checker).checkFiles:+29
go/types.(*Checker).Files:=372
golang.org/x/tools/[email protected] 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 ebxaEQ was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Errorf:+2
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage.func1:+14
golang.org/x/tools/internal/gcimporter.iimportCommon:+123
golang.org/x/tools/internal/gcimporter.IImportShallow:+3
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+57
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getImportPackage:+55
golang.org/x/tools/gopls/internal/cache.(*Snapshot).forEachPackageInternal.func1:+1
golang.org/x/sync/errgroup.(*Group).Go.func1:+3
runtime.goexit:+0
golang.org/x/tools/[email protected] 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 Ar_rPw was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Errorf:+2
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage.func1:+14
golang.org/x/tools/internal/gcimporter.iimportCommon:+123
golang.org/x/tools/internal/gcimporter.IImportShallow:+3
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+57
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getImportPackage:+55
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).typesConfig.func1:+20
golang.org/x/tools/gopls/internal/cache.importerFunc.Import:+0
go/types.(*Checker).importPackage:+28
go/types.(*Checker).collectObjects.func1:+13
go/types.(*Checker).walkDecl:+9
go/types.(*Checker).walkDecls:=391
go/types.(*Checker).collectObjects:+42
go/types.(*Checker).checkFiles:+32
go/types.(*Checker).Files:=341
golang.org/x/tools/[email protected] go1.21.0 windows/amd64 vscode (1)

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

@adonovan
Copy link
Member Author

This stack 33irXg was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Errorf:+2
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage.func1:+14
golang.org/x/tools/internal/gcimporter.iimportCommon:+123
golang.org/x/tools/internal/gcimporter.IImportShallow:+3
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+57
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getImportPackage:+55
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).typesConfig.func1:+20
golang.org/x/tools/gopls/internal/cache.importerFunc.Import:+0
go/types.(*Checker).importPackage:+28
go/types.(*Checker).collectObjects.func1:+13
go/types.(*Checker).walkDecl:+9
go/types.(*Checker).walkDecls:=391
go/types.(*Checker).collectObjects:+42
go/types.(*Checker).checkFiles:+18
go/types.(*Checker).Files:=304
golang.org/x/tools/[email protected] go1.20.3 linux/amd64 vscode (1)

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

@findleyr findleyr modified the milestones: gopls/v0.16.0, gopls/v0.17.0 May 23, 2024
@adonovan
Copy link
Member Author

This stack PXUK4g was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Errorf:+2
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage.func1:+14
golang.org/x/tools/internal/gcimporter.iimportCommon:+124
golang.org/x/tools/internal/gcimporter.IImportShallow:+3
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+57
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getImportPackage:+56
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).handleSyntaxPackage.func2:+1
golang.org/x/sync/errgroup.(*Group).Go.func1:+3
runtime.goexit:+0
golang.org/x/tools/[email protected] go1.22.4 darwin/arm64 vscode-insiders (1)

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

@adonovan
Copy link
Member Author

adonovan commented Jul 9, 2024

This stack ptgmiQ was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Errorf:+2
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage.func1:+14
golang.org/x/tools/internal/gcimporter.iimportCommon:+124
golang.org/x/tools/internal/gcimporter.IImportShallow:+3
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+57
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getImportPackage:+56
golang.org/x/tools/gopls/internal/cache.(*Snapshot).forEachPackageInternal.func1:+1
golang.org/x/sync/errgroup.(*Group).Go.func1:+3
runtime.goexit:+0
golang.org/x/tools/[email protected] go1.22.3 linux/amd64 vscode (2)
golang.org/x/tools/[email protected] go1.22.4 linux/amd64 vscode (1)
golang.org/x/tools/[email protected] go1.21.7 linux/amd64 vscode (1)
golang.org/x/tools/[email protected] go1.20.8 darwin/amd64 vscode (1)
golang.org/x/tools/[email protected] go1.21.3 darwin/arm64 vscode (1)
golang.org/x/tools/[email protected] go1.21.11 linux/amd64 vscode (1)
golang.org/x/tools/[email protected] go1.22.4 darwin/arm64 vscode (1)
golang.org/x/tools/[email protected] go1.22.3 linux/amd64 vscode (5)
golang.org/x/tools/[email protected] go1.22.4 darwin/arm64 vscode (1)
golang.org/x/tools/[email protected] go1.22.2 linux/amd64 other,vscode (1)

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

@adonovan
Copy link
Member Author

adonovan commented Jul 9, 2024

This stack j64HJw was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Errorf:+2
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage.func1:+14
golang.org/x/tools/internal/gcimporter.iimportCommon:+124
golang.org/x/tools/internal/gcimporter.IImportShallow:+3
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+57
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getImportPackage:+56
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).typesConfig.func1:+20
golang.org/x/tools/gopls/internal/cache.importerFunc.Import:+0
go/types.(*Checker).importPackage:+28
go/types.(*Checker).collectObjects.func1:+13
go/types.(*Checker).walkDecl:+9
go/types.(*Checker).walkDecls:=391
go/types.(*Checker).collectObjects:+42
go/types.(*Checker).checkFiles:+32
go/types.(*Checker).Files:=341
golang.org/x/tools/[email protected] go1.21.9 linux/amd64 vscode (1)

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

@adonovan
Copy link
Member Author

This stack FjuvhQ was reported by telemetry:

gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Errorf:+2
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage.func1:+14
golang.org/x/tools/internal/gcimporter.iimportCommon:+124
golang.org/x/tools/internal/gcimporter.IImportShallow:+3
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage:+57
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getImportPackage:+56
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).typesConfig.func1:+20
golang.org/x/tools/gopls/internal/cache.importerFunc.Import:+0
go/types.(*Checker).importPackage:+28
go/types.(*Checker).collectObjects.func1:+13
go/types.(*Checker).walkDecl:+9
go/types.(*Checker).walkDecls:=399
go/types.(*Checker).collectObjects:+42
go/types.(*Checker).checkFiles:+29
go/types.(*Checker).Files:=372
golang.org/x/tools/[email protected] go1.22.2 darwin/arm64 vscode (1)

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

@adonovan
Copy link
Member Author

This stack rlqkaQ 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.(*typeCheckBatch).getImportPackage:+44
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).typesConfig.func1:+20
golang.org/x/tools/gopls/internal/cache.importerFunc.Import:+0
go/types.(*Checker).importPackage:+28
go/types.(*Checker).collectObjects.func1:+13
go/types.(*Checker).walkDecl:+9
go/types.(*Checker).walkDecls:=391
go/types.(*Checker).collectObjects:+42
go/types.(*Checker).checkFiles:+32
go/types.(*Checker).Files:=341
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).checkPackageForImport:+50
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).getImportPackage:+51
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).importPackage.func1:+20
golang.org/x/tools/internal/gcimporter.iimportCommon:+124
golang.org/x/tools/[email protected] go1.21.3 darwin/arm64 other (1)

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

@adonovan
Copy link
Member Author

adonovan commented Aug 5, 2024

This stack TYioIw 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.(*typeCheckBatch).getImportPackage:+44
golang.org/x/tools/gopls/internal/cache.(*typeCheckBatch).handleSyntaxPackage.func2:+1
golang.org/x/sync/errgroup.(*Group).Go.func1:+3
runtime.goexit:+0
golang.org/x/tools/[email protected] go1.22.3 darwin/arm64 other,vscode (1)

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

@adonovan adonovan changed the title x/tools/gopls: bug in typeCheckBatch.importPackage reported by telemetry x/tools/gopls: "package named is %q, want %q" bug in typeCheckBatch.importPackage Sep 13, 2024
@adonovan
Copy link
Member Author

According to the tty output of the stacks command, we had nearly 200 reports of these stacks this week alone. A lot!

@adonovan
Copy link
Member Author

The stack above is not the GOPACKAGESDRIVER case, interestingly.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/643778 mentions this issue: gopls/internal/cache: add more debugging for golang/go#64235

gopherbot pushed a commit to golang/tools that referenced this issue Jan 22, 2025
After several hours of attempts, I am yet again unable to reproduce
golang/go#64235. Add additional filtering of bug reports to try to
narrow down potential root causes.

For golang/go#64235

Change-Id: I30abd08f01ebea221a2ff13bceb4823ae3ac470a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/643778
Reviewed-by: Alan Donovan <[email protected]>
Auto-Submit: Robert Findley <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
@findleyr findleyr modified the milestones: gopls/v0.18.0, gopls/v0.18.1 Jan 22, 2025
github-actions bot added a commit to satorunooshie/go-tools that referenced this issue Jan 22, 2025
fcc9d81f7 internal/telemetry/cmd/stacks: anchored literals
684910f57 internal/telemetry/cmd/stacks: fix distinctStacks
d5cd1f892 gopls: add WorkspaceFiles option
30bd6fdf3 internal/telemetry/cmd/stacks: move dry run checks down
e4adc385a internal/telemetry/cmd/stacks: remove Issue.predicateText
8bf2b65e4 gopls/internal/cache: add more debugging for golang/go#64235
7479e1b98 internal/telemetry/cmd/stacks: test predicates
726ba3201 internal/telemetry/cmd/stacks: minor tweaks
9f4a509fb gopls/internal/telemetry/cmd/stacks: add dry run flag
38d063139 gopls/internal/test: update hover test to be tolerant proxy changes

git-subtree-dir: golang.org/x/tools
git-subtree-split: fcc9d81f7cff5c606414ca0cf218b7d0f7db991f
@adonovan
Copy link
Member Author

This stack MP8B4Q was reported by telemetry:

golang.org/x/tools/[email protected] go1.23.6 windows/amd64 vscode (1)
golang.org/x/tools/[email protected] go1.23.6 linux/amd64 vscode (2)
golang.org/x/tools/[email protected] go1.23.4 linux/amd64 other,vscode (1)

This stack n5Nrkw was reported by telemetry:

golang.org/x/tools/[email protected] go1.23.4 darwin/arm64 vscode (1)

@adonovan
Copy link
Member Author

The recent stack MP8B4Q is from a refinement indicating that pkg.Name() == "".

@findleyr findleyr modified the milestones: gopls/v0.18.1, gopls/v0.18.2 Feb 21, 2025
@findleyr
Copy link
Member

This failure mode is possible if:

  1. go/packages reports no Name
  2. the package has files with a valid package clause.

Because then go/types will set the package name from the file.
https://cs.opensource.google/go/go/+/master:src/go/types/check.go;l=342;drc=676d427f77ea255fa6e4cdebf0fb348a27575855

Unfortunately, I can't reproduce this: I can get go/packages to list packages with CompiledGoFiles and no name, but only if all the files in the package have a missing or broken package clause, in which case go/types also won't find a name.

So, this looks like another case where the gopls logic clearly makes an assumption that it should not (the input package name is the same as the output package name), but we can't figure out how that invalid assumption is exercised.

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. 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