-
Notifications
You must be signed in to change notification settings - Fork 0
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
golangci-lint
unusable within Go 1.20 pre-release images
#789
Comments
When generics support was first added to linters for the Go 1.18 release a necessary step was to build/install the golangci-lint tool via |
Testing: index e71edbe..80f74a4 100644
--- a/unstable/Dockerfile
+++ b/unstable/Dockerfile
@@ -23,8 +23,7 @@ RUN echo "Installing staticcheck@${STATICCHECK_VERSION}" \
&& echo "Installing govulncheck@${GOVULNCHECK_VERSION}" \
&& go install golang.org/x/vuln/cmd/govulncheck@${GOVULNCHECK_VERSION} \
&& echo "Installing golangci-lint ${GOLANGCI_LINT_VERSION}" \
- && curl -sSfLO https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
- && sh install.sh -b "$(go env GOPATH)/bin" ${GOLANGCI_LINT_VERSION} \
+ && go install github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION} \
&& golangci-lint --version \
&& echo "Installing httperroryzer@${HTTPERRORYZER_VERSION}" \
&& go install github.com/orijtech/httperroryzer/cmd/httperroryzer@${HTTPERRORYZER_VERSION} \ |
That didn't go well. # golangci-lint run
WARN [runner] The linter 'maligned' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'.
ERRO [runner] Panic: buildir: package "netip" (isInitialPkg: false, needAnalyzeSource: true): in net/netip.AddrFromSlice: cannot convert Load <[]byte> t0 ([]byte) to [4]byte: goroutine 1439 [running]:
runtime/debug.Stack()
/usr/local/go/src/runtime/debug/stack.go:24 +0x65
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func1()
/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.1/pkg/golinters/goanalysis/runner_action.go:102 +0x155
panic({0x14fd300, 0xc003b09560})
/usr/local/go/src/runtime/panic.go:884 +0x213
honnef.co/go/tools/go/ir.emitConv(0xc0014bb400, {0x19386c8, 0xc001c10ea0}, {0x192bbb0?, 0xc003c02498}, {0x192b2a0, 0xc00281e780})
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/emit.go:293 +0xd29
honnef.co/go/tools/go/ir.(*builder).expr0(0xc002911a28, 0xc0014bb400, {0x192ef70?, 0xc00281e780?}, {0x7, {0x192bbb0, 0xc003c02498}, {0x0, 0x0}})
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:610 +0x5d7
honnef.co/go/tools/go/ir.(*builder).expr(0x192bd40?, 0xc0014bb400, {0x192ef70, 0xc00281e780})
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:566 +0x1fa
honnef.co/go/tools/go/ir.(*builder).emitCallArgs(0x192bd40?, 0xc0014bb400, 0xc003b69f40, 0xc00281e7c0, {0x0?, 0x0, 0x8b80a7?})
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:975 +0x135
honnef.co/go/tools/go/ir.(*builder).setCall(0x1566e20?, 0xc0014bb400, 0xc00281e7c0, 0xc00393b448)
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:1037 +0x8e
honnef.co/go/tools/go/ir.(*builder).expr0(0xc002911a28, 0xc0014bb400, {0x192ef70?, 0xc00281e7c0?}, {0x7, {0x192bca0, 0xc0001cd730}, {0x0, 0x0}})
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:623 +0x218e
honnef.co/go/tools/go/ir.(*builder).expr(0xc002910e78?, 0xc0014bb400, {0x192ef70, 0xc00281e7c0})
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:566 +0x1fa
honnef.co/go/tools/go/ir.(*builder).stmt(0xc0014bb400?, 0xc0014bb400, {0x192f4b0?, 0xc0016f6ca0?})
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2291 +0x194c
honnef.co/go/tools/go/ir.(*builder).stmtList(...)
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:855
honnef.co/go/tools/go/ir.(*builder).switchStmt(0xc002911308?, 0xc0014bb400, 0xc00bb9cc60, 0x0)
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:1366 +0x19a5
honnef.co/go/tools/go/ir.(*builder).stmt(0x20?, 0xc0014bb400, {0x192f600?, 0xc00bb9cc60?})
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2365 +0x121c
honnef.co/go/tools/go/ir.(*builder).stmtList(0x8bea25?, 0xc0029114f8?, {0xc0016f6e60?, 0x2, 0x8c0630?})
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:855 +0x45
honnef.co/go/tools/go/ir.(*builder).stmt(0xc0014bb400?, 0xc0014bb400, {0x192ef10?, 0xc00bb9cc90?})
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2338 +0x9b9
honnef.co/go/tools/go/ir.(*builder).buildFunction(0xc002911a28, 0xc0014bb400)
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2450 +0x3d7
honnef.co/go/tools/go/ir.(*builder).buildFuncDecl(0x0?, 0xc000309050, 0xc00bb9ccc0)
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2488 +0x19b
honnef.co/go/tools/go/ir.(*Package).build(0xc000309050)
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2594 +0xc16
sync.(*Once).doSlow(0xc001dd81c0?, 0xc00cb31720?)
/usr/local/go/src/sync/once.go:74 +0xc2
sync.(*Once).Do(...)
/usr/local/go/src/sync/once.go:65
honnef.co/go/tools/go/ir.(*Package).Build(...)
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2512
honnef.co/go/tools/internal/passes/buildir.run(0xc0017d5ba0)
/go/pkg/mod/honnef.co/go/tools@v0.3.3/internal/passes/buildir/buildir.go:86 +0x368
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyze(0xc002793730)
/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.1/pkg/golinters/goanalysis/runner_action.go:188 +0x9d6
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func2()
/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.1/pkg/golinters/goanalysis/runner_action.go:106 +0x1d
github.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0xc00255e820, {0x16c8b40, 0x7}, 0xc00215cf48)
/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.1/pkg/timeutils/stopwatch.go:111 +0x4a
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe(0xc00219bb00?)
/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.1/pkg/golinters/goanalysis/runner_action.go:105 +0x85
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze.func2(0xc002793730)
/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.1/pkg/golinters/goanalysis/runner_loadingpackage.go:80 +0xb4
created by github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze
/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.1/pkg/golinters/goanalysis/runner_loadingpackage.go:75 +0x1eb
WARN [runner] Can't run linter goanalysis_metalinter: goanalysis_metalinter: buildir: package "netip" (isInitialPkg: false, needAnalyzeSource: true): in net/netip.AddrFromSlice: cannot convert Load <[]byte> t0 ([]byte) to [4]byte
ERRO Running error: 1 error occurred:
* can't run linter goanalysis_metalinter: goanalysis_metalinter: buildir: package "netip" (isInitialPkg: false, needAnalyzeSource: true): in net/netip.AddrFromSlice: cannot convert Load <[]byte> t0 ([]byte) to [4]byte |
Going to try installing golangci-lint from |
Still issues running the tool from the I also nuked the # golangci-lint run
ERRO [runner] Panic: buildir: package "netip" (isInitialPkg: false, needAnalyzeSource: true): in net/netip.AddrFromSlice: cannot convert Load <[]byte> t0 ([]byte) to [4]byte: goroutine 1083 [running]:
runtime/debug.Stack()
/usr/local/go/src/runtime/debug/stack.go:24 +0x65
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func1()
/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.2-0.20221211114606-b2462ed75201/pkg/golinters/goanalysis/runner_action.go:102 +0x155
panic({0x1509960, 0xc0003dce10})
/usr/local/go/src/runtime/panic.go:884 +0x213
honnef.co/go/tools/go/ir.emitConv(0xc0000a5400, {0x19475a8, 0xc000e6de00}, {0x193aa78?, 0xc0019f5230}, {0x193a168, 0xc0018ce280})
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/emit.go:293 +0xd29
honnef.co/go/tools/go/ir.(*builder).expr0(0xc00032ba28, 0xc0000a5400, {0x193de30?, 0xc0018ce280?}, {0x7, {0x193aa78, 0xc0019f5230}, {0x0, 0x0}})
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:610 +0x5d7
honnef.co/go/tools/go/ir.(*builder).expr(0x193ac08?, 0xc0000a5400, {0x193de30, 0xc0018ce280})
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:566 +0x1fa
honnef.co/go/tools/go/ir.(*builder).emitCallArgs(0x193ac08?, 0xc0000a5400, 0xc0019bf680, 0xc0018ce2c0, {0x0?, 0x0, 0x8bb0a7?})
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:975 +0x135
honnef.co/go/tools/go/ir.(*builder).setCall(0x1573640?, 0xc0000a5400, 0xc0018ce2c0, 0xc0005b9628)
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:1037 +0x8e
honnef.co/go/tools/go/ir.(*builder).expr0(0xc00032ba28, 0xc0000a5400, {0x193de30?, 0xc0018ce2c0?}, {0x7, {0x193ab68, 0xc00189e620}, {0x0, 0x0}})
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:623 +0x218e
honnef.co/go/tools/go/ir.(*builder).expr(0xc00032ae78?, 0xc0000a5400, {0x193de30, 0xc0018ce2c0})
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:566 +0x1fa
honnef.co/go/tools/go/ir.(*builder).stmt(0xc0000a5400?, 0xc0000a5400, {0x193e370?, 0xc0018cd580?})
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2291 +0x194c
honnef.co/go/tools/go/ir.(*builder).stmtList(...)
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:855
honnef.co/go/tools/go/ir.(*builder).switchStmt(0xc00032b308?, 0xc0000a5400, 0xc0018c7ce0, 0x0)
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:1366 +0x19a5
honnef.co/go/tools/go/ir.(*builder).stmt(0x20?, 0xc0000a5400, {0x193e4c0?, 0xc0018c7ce0?})
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2365 +0x121c
honnef.co/go/tools/go/ir.(*builder).stmtList(0x8c1a25?, 0xc00032b4f8?, {0xc0018cd740?, 0x2, 0x8c3630?})
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:855 +0x45
honnef.co/go/tools/go/ir.(*builder).stmt(0xc0000a5400?, 0xc0000a5400, {0x193ddd0?, 0xc0018c7d10?})
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2338 +0x9b9
honnef.co/go/tools/go/ir.(*builder).buildFunction(0xc00032ba28, 0xc0000a5400)
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2450 +0x3d7
honnef.co/go/tools/go/ir.(*builder).buildFuncDecl(0x0?, 0xc0003025a0, 0xc0018c7d40)
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2488 +0x19b
honnef.co/go/tools/go/ir.(*Package).build(0xc0003025a0)
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2594 +0xc16
sync.(*Once).doSlow(0xc0016fe0e0?, 0xc0019b9b30?)
/usr/local/go/src/sync/once.go:74 +0xc2
sync.(*Once).Do(...)
/usr/local/go/src/sync/once.go:65
honnef.co/go/tools/go/ir.(*Package).Build(...)
/go/pkg/mod/honnef.co/go/tools@v0.3.3/go/ir/builder.go:2512
honnef.co/go/tools/internal/passes/buildir.run(0xc00049e3c0)
/go/pkg/mod/honnef.co/go/tools@v0.3.3/internal/passes/buildir/buildir.go:86 +0x368
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyze(0xc00103e150)
/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.2-0.20221211114606-b2462ed75201/pkg/golinters/goanalysis/runner_action.go:188 +0x9df
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func2()
/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.2-0.20221211114606-b2462ed75201/pkg/golinters/goanalysis/runner_action.go:106 +0x1d
github.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0xc000f76ff0, {0x16d616e, 0x7}, 0xc0011c6748)
/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.2-0.20221211114606-b2462ed75201/pkg/timeutils/stopwatch.go:111 +0x4a
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe(0xc00075d440?)
/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.2-0.20221211114606-b2462ed75201/pkg/golinters/goanalysis/runner_action.go:105 +0x85
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze.func2(0xc00103e150)
/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.2-0.20221211114606-b2462ed75201/pkg/golinters/goanalysis/runner_loadingpackage.go:80 +0xb4
created by github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze
/go/pkg/mod/github.com/golangci/golangci-lint@v1.50.2-0.20221211114606-b2462ed75201/pkg/golinters/goanalysis/runner_loadingpackage.go:75 +0x1eb
WARN [runner] Can't run linter goanalysis_metalinter: goanalysis_metalinter: buildir: package "netip" (isInitialPkg: false, needAnalyzeSource: true): in net/netip.AddrFromSlice: cannot convert Load <[]byte> t0 ([]byte) to [4]byte
ERRO Running error: 1 error occurred:
* can't run linter goanalysis_metalinter: goanalysis_metalinter: buildir: package "netip" (isInitialPkg: false, needAnalyzeSource: true): in net/netip.AddrFromSlice: cannot convert Load <[]byte> t0 ([]byte) to [4]byte |
Opened an upstream discussion: |
As of ldez/golangci-lint@1af8a00 (and likely earlier commits), golangci-lint builds/runs within a Go 1.20rc2 Docker image. I'm going to update the |
golangci-lint
v1.50.1 unusable within Go 1.20rc1 imagegolangci-lint
v1.50.1 unusable within Go 1.20 pre-release images
Use dev feat/go1.20 branch from golangci-lint fork until official support lands in official repo. refs GH-789
golangci-lint
v1.50.1 unusable within Go 1.20 pre-release imagesgolangci-lint
unusable within Go 1.20 pre-release images
- v1.50.1 for stable, oldstable images - feat/go1.20 dev branch for unstable image refs GH-789
I updated the unstable image on Friday to use the latest Go 1.20rc1 base image. Since then, CI checks using that image have all failed due to golangci-lint flagging standard library source as failing the
typecheck
linter.Example:
refs: https://github.com/atc0005/send2teams/actions/runs/3675230792/jobs/6214398690
The text was updated successfully, but these errors were encountered: