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

Latest stable version of staticcheck unusable within Go 1.23 pre-release images #1596

Closed
atc0005 opened this issue Jun 26, 2024 · 0 comments · Fixed by #1597
Closed

Latest stable version of staticcheck unusable within Go 1.23 pre-release images #1596

atc0005 opened this issue Jun 26, 2024 · 0 comments · Fixed by #1597
Assignees
Labels
Milestone

Comments

@atc0005
Copy link
Owner

atc0005 commented Jun 26, 2024

As with golangci-lint (GH-1590), the latest stable release is incompatible with the latest Go 1.23 pre-release image (Go 1.23rc1 as of this writing).

From a recent CI run:

staticcheck 2023.1.7 (v0.4.7)
panic: Cannot range over: func(yield func(E) bool)

goroutine 211 [running]:
honnef.co/go/tools/go/ir.(*builder).rangeStmt(0xc007aa6e08, 0xc007913b80, 0xc0069642a0, 0x0, {0xa4b110, 0xc0069642a0})
	/go/pkg/mod/honnef.co/go/tools@v0.4.7/go/ir/builder.go:2225 +0x894
honnef.co/go/tools/go/ir.(*builder).stmt(0xc007aa6e08, 0xc007913b80, {0xa4d500?, 0xc0069642a0?})
	/go/pkg/mod/honnef.co/go/tools@v0.4.7/go/ir/builder.go:2438 +0x20a
honnef.co/go/tools/go/ir.(*builder).stmtList(...)
	/go/pkg/mod/honnef.co/go/tools@v0.4.7/go/ir/builder.go:859
honnef.co/go/tools/go/ir.(*builder).stmt(0xc007aa6e08, 0xc007913b80, {0xa4d140?, 0xc0023faab0?})
	/go/pkg/mod/honnef.co/go/tools@v0.4.7/go/ir/builder.go:2396 +0x1415
honnef.co/go/tools/go/ir.(*builder).buildFunction(0xc007aa6e08, 0xc007913b80)
	/go/pkg/mod/honnef.co/go/tools@v0.4.7/go/ir/builder.go:2508 +0x417
honnef.co/go/tools/go/ir.(*builder).buildFuncDecl(0xc007aa6e08, 0xc00011d7a0, 0xc0023faae0)
	/go/pkg/mod/honnef.co/go/tools@v0.4.7/go/ir/builder.go:2545 +0x189
honnef.co/go/tools/go/ir.(*Package).build(0xc00011d7a0)
	/go/pkg/mod/honnef.co/go/tools@v0.4.7/go/ir/builder.go:2649 +0xb46
sync.(*Once).doSlow(0xc0031350a0?, 0xc006964060?)
	/usr/local/go/src/sync/once.go:76 +0xb4
sync.(*Once).Do(...)
	/usr/local/go/src/sync/once.go:67
honnef.co/go/tools/go/ir.(*Package).Build(...)
	/go/pkg/mod/honnef.co/go/tools@v0.4.7/go/ir/builder.go:2567
honnef.co/go/tools/internal/passes/buildir.run(0xc007835ad0)
	/go/pkg/mod/honnef.co/go/tools@v0.4.7/internal/passes/buildir/buildir.go:86 +0x18b
honnef.co/go/tools/lintcmd/runner.(*analyzerRunner).do(0xc00226d8f0, {0xa4fbd8?, 0xc007844640})
	/go/pkg/mod/honnef.co/go/tools@v0.4.7/lintcmd/runner/runner.go:992 +0x71b
honnef.co/go/tools/lintcmd/runner.genericHandle({0xa4fbd8, 0xc007844640}, {0xa4fbd8?, 0xc0078445a0?}, 0xc0068890a0, 0x0, 0xc007aa75e8)
	/go/pkg/mod/honnef.co/go/tools@v0.4.7/lintcmd/runner/runner.go:817 +0x11f
honnef.co/go/tools/lintcmd/runner.(*subrunner).runAnalyzers(0xc00008e960, 0xc0006d2ea0, 0xc0038439a0)
	/go/pkg/mod/honnef.co/go/tools@v0.4.7/lintcmd/runner/runner.go:1065 +0x6fe
honnef.co/go/tools/lintcmd/runner.(*subrunner).doUncached(0xc00008e960, 0xc0006d2ea0)
	/go/pkg/mod/honnef.co/go/tools@v0.4.7/lintcmd/runner/runner.go:720 +0x189
honnef.co/go/tools/lintcmd/runner.(*subrunner).do(0xc00008e960, {0xa4fc20?, 0xc0006d2ea0})
	/go/pkg/mod/honnef.co/go/tools@v0.4.7/lintcmd/runner/runner.go:577 +0x908
honnef.co/go/tools/lintcmd/runner.(*Runner).Run.func2({0xa4fc20?, 0xc0006d2ea0?})
	/go/pkg/mod/honnef.co/go/tools@v0.4.7/lintcmd/runner/runner.go:1268 +0x2a
honnef.co/go/tools/lintcmd/runner.genericHandle({0xa4fc20, 0xc0006d2ea0}, {0xa4fc20?, 0xc0001bf560?}, 0xc0006b6540, 0xc0002f55e0, 0xc002289a90)
	/go/pkg/mod/honnef.co/go/tools@v0.4.7/lintcmd/runner/runner.go:817 +0x11f
created by honnef.co/go/tools/lintcmd/runner.(*Runner).Run in goroutine 1
	/go/pkg/mod/honnef.co/go/tools@v0.4.7/lintcmd/runner/runner.go:1267 +0x4f4

We'll need to update the unstable image so that it (for now) uses a master branch build of staticcheck.

References

@atc0005 atc0005 added this to the v0.21.2 milestone Jun 26, 2024
@atc0005 atc0005 self-assigned this Jun 26, 2024
atc0005 added a commit that referenced this issue Jun 26, 2024
- use latest master branch commit for unstable image until Go 1.23
  and new staticcheck versions are released
  - currently commit dec278f2f0d94b07c04db075d807e9f499f5d7b5
- update README to list versions of staticheck per image variant

refs GH-1596
atc0005 added a commit that referenced this issue Jul 2, 2024
Switch from commit dec278f2f0d94b07c04db075d807e9f499f5d7b5 on
master branch to latest v0.5.0 pre-release version.

refs GH-1596
atc0005 added a commit that referenced this issue Jul 2, 2024
Switch from commit dec278f2f0d94b07c04db075d807e9f499f5d7b5 on
master branch to latest v0.5.0 pre-release version.

Update README to list updated version of staticheck in unstable
image.

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

Successfully merging a pull request may close this issue.

1 participant