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

Bump golang.org/x/tools to v0.7.0 (as minimum) and make new tag #13

Open
2 tasks
Antonboom opened this issue Mar 12, 2023 · 3 comments
Open
2 tasks

Bump golang.org/x/tools to v0.7.0 (as minimum) and make new tag #13

Antonboom opened this issue Mar 12, 2023 · 3 comments

Comments

@Antonboom
Copy link

Antonboom commented Mar 12, 2023

Hi 🙂

Please, bump golang.org/x/tools to v0.7.0 (as minimum) and make new tag in your repo.

It's important to be consistent with new Go 1.20 golangci-lint.
Related to golangci/golangci-lint#3086

Thanks!

P.S. Optionally I recommend

  • to move linter to 1.20 totally (go.mod, CI, etc.)
  • add support of dependabot
@Antonboom
Copy link
Author

UPD:

Sorry, false-positive, don't see usage of buildssa.Analyzer.
But pay attention anyway :)

@sanket-qwiet
Copy link

sanket-qwiet commented Nov 28, 2024

Seeing panic with current makezero. Tool works fine after updating Go tools dependency.

makezero -set_exit_status . <list of many files>
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1024bd684]

goroutine 258 [running]:
go/types.(*Checker).handleBailout(0x140014eac40, 0x14002b7fc58)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/check.go:404 +0x9c
panic({0x1025c1700?, 0x10275e670?})
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/runtime/panic.go:785 +0x124
go/types.(*StdSizes).Sizeof(0x0, {0x1026022d0, 0x1027619c0})
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/sizes.go:229 +0x314
go/types.(*Config).sizeof(...)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/sizes.go:334
go/types.representableConst.func1({0x1026022d0?, 0x1027619c0?})
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/const.go:77 +0x90
go/types.representableConst({0x102603560, 0x102757080}, 0x140014eac40, 0x1027619c0, 0x14002b7f528)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/const.go:93 +0x134
go/types.(*Checker).representation(0x140014eac40, 0x140018dc7c0, 0x1027619c0)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/const.go:257 +0x68
go/types.(*Checker).implicitTypeAndValue(0x140014eac40, 0x140018dc7c0, {0x102602320, 0x14001810230})
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/expr.go:377 +0x304
go/types.(*Checker).assignment(0x140014eac40, 0x140018dc7c0, {0x102602320, 0x14001810230}, {0x10253fbc8, 0x14})
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/assignments.go:70 +0x3ac
go/types.(*Checker).initConst(0x140014eac40, 0x140014efc20, 0x140018dc7c0)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/assignments.go:144 +0x1f8
go/types.(*Checker).constDecl(0x140014eac40, 0x140014efc20, {0x1026026b0, 0x14001834300}, {0x1026026b0, 0x14001834320}, 0x0)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/decl.go:482 +0x23c
go/types.(*Checker).objDecl(0x140014eac40, {0x1026056f8, 0x140014efc20}, 0x0)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/decl.go:185 +0x840
go/types.(*Checker).packageObjects(0x140014eac40)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/resolver.go:714 +0x3f0
go/types.(*Checker).checkFiles(0x140014eac40, {0x14002174000, 0x1, 0x1})
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/check.go:459 +0x190
go/types.(*Checker).Files(0x14000148000?, {0x14002174000?, 0x140026fc4e0?, 0xd?})
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/go/types/check.go:422 +0x80
golang.org/x/tools/go/packages.(*loader).loadPackage(0x14000148000, 0x140016fc180)
	/Users/sanket/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:966 +0x618
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
	/Users/sanket/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:803 +0x178
sync.(*Once).doSlow(0x0?, 0x0?)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/sync/once.go:76 +0xf8
sync.(*Once).Do(...)
	/opt/homebrew/Cellar/go/1.23.3/libexec/src/sync/once.go:67
golang.org/x/tools/go/packages.(*loader).loadRecursive(0x0?, 0x0?)
	/Users/sanket/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:791 +0x48
golang.org/x/tools/go/packages.(*loader).refine.func2(0x0?)
	/Users/sanket/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:732 +0x30
created by golang.org/x/tools/go/packages.(*loader).refine in goroutine 1
	/Users/sanket/go/pkg/mod/golang.org/x/[email protected]/go/packages/packages.go:731 +0x9d0

I have update go tools as below in my local changes

diff --git a/go.mod b/go.mod
index 9aa5bcc..d08101c 100644
--- a/go.mod
+++ b/go.mod
@@ -1,5 +1,10 @@
 module github.com/ashanbrown/makezero

-go 1.12
+go 1.23.1

-require golang.org/x/tools v0.1.9
+require golang.org/x/tools v0.27.0
+
+require (
+       golang.org/x/mod v0.22.0 // indirect
+       golang.org/x/sync v0.9.0 // indirect
+)

@ashanbrown Can you please consider merging open PR ?

#14

@sanket-qwiet
Copy link

Still facing panic after the merge of PR #14.
We need further upgrade of go tools.

In my local build go tools v0.13.0 solves the issue.
Probably, we will need merge of #17

@ashanbrown Please consider PR #17 if looks good to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants