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

Enable ginkgolinter and enable checks #8050

Closed
oscr opened this issue Feb 2, 2023 · 9 comments · Fixed by #8058 or #8796
Closed

Enable ginkgolinter and enable checks #8050

oscr opened this issue Feb 2, 2023 · 9 comments · Fixed by #8058 or #8796
Assignees
Labels
triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@oscr
Copy link
Contributor

oscr commented Feb 2, 2023

In #8046 golangci-lint was updated to v1.51.0.

In that release a new linter is added called ginkgolinter. However we were unable to enable it without it crashing. Creating this ticket to track this issue.

My go version: go1.19.5 linux/amd64

Supported checks in ginkgolinter available here: https://golangci-lint.run/usage/linters/#ginkgolinter

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Feb 2, 2023
@sbueringer sbueringer changed the title 🌱 Investigate why ginkgolinter crashes Investigate why ginkgolinter crashes Feb 2, 2023
@sbueringer
Copy link
Member

sbueringer commented Feb 2, 2023

/triage accepted

Thx for opening the issue. Just dropped the icon as we only consistently apply it to the PRs and it's enforced there. This way we can also easily differentiate between issues and PRs in the notifications list as well :)

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 2, 2023
@oscr
Copy link
Contributor Author

oscr commented Feb 2, 2023

I've tried it with go 1.18.10, 1.19.5 and 1.20. Same result.

ERRO [runner] Panic: buildssa: package "v1beta1" (isInitialPkg: true, needAnalyzeSource: true): runtime error: invalid memory address or nil pointer dereference: goroutine 62115 [running]:
runtime/debug.Stack()
	runtime/debug/stack.go:24 +0x65
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func1()
	github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_action.go:102 +0x155
panic({0xf93a60, 0x1a47e90})
	runtime/panic.go:884 +0x213
golang.org/x/tools/go/ssa.(*Program).packageLevelMember(...)
	golang.org/x/tools@v0.5.0/go/ssa/source.go:184
golang.org/x/tools/go/ssa.(*builder).expr0(0xc004653a48, 0xc00d6c9200, {0x131f140?, 0xc01c728f60?}, {0x0, {0x0, 0x0}, {0x0, 0x0}})
	golang.org/x/tools@v0.5.0/go/ssa/builder.go:798 +0x129f
golang.org/x/tools/go/ssa.(*builder).expr(0xc004652b40?, 0xc00d6c9200, {0x131f140, 0xc01c728f60})
	golang.org/x/tools@v0.5.0/go/ssa/builder.go:625 +0x17b
golang.org/x/tools/go/ssa.(*builder).setCallFunc(0x7ff277828020?, 0x7ff29f0895b8?, 0x80?, 0xc02d6307c0)
	golang.org/x/tools@v0.5.0/go/ssa/builder.go:1041 +0x33f
golang.org/x/tools/go/ssa.(*builder).setCall(0xf808e0?, 0xc01a6721b0?, 0xc043899540, 0xc02d6307c0)
	golang.org/x/tools@v0.5.0/go/ssa/builder.go:1120 +0x34
golang.org/x/tools/go/ssa.(*builder).expr0(0xc004653a48, 0xc00d6c9200, {0x131ee40?, 0xc043899540?}, {0x7, {0x131c088, 0xc0075184d0}, {0x0, 0x0}})
	golang.org/x/tools@v0.5.0/go/ssa/builder.go:704 +0x23f1
golang.org/x/tools/go/ssa.(*builder).expr(0x4?, 0xc00d6c9200, {0x131ee40, 0xc043899540})
	golang.org/x/tools@v0.5.0/go/ssa/builder.go:625 +0x17b
golang.org/x/tools/go/ssa.(*builder).emitCallArgs(0x131c128?, 0xc00d6c9200, 0xc00d34f300, 0xc043899580, {0x0?, 0x0, 0xc004653078?})
	golang.org/x/tools@v0.5.0/go/ssa/builder.go:1065 +0x125
golang.org/x/tools/go/ssa.(*builder).setCall(0xf83f40?, 0xc01a6720f0?, 0xc043899580, 0xc02d6306c0)
	golang.org/x/tools@v0.5.0/go/ssa/builder.go:1127 +0x90
golang.org/x/tools/go/ssa.(*builder).expr0(0xc004653a48, 0xc00d6c9200, {0x131ee40?, 0xc043899580?}, {0x7, {0x131bfc0, 0x1a4c420}, {0x0, 0x0}})
	golang.org/x/tools@v0.5.0/go/ssa/builder.go:704 +0x23f1
golang.org/x/tools/go/ssa.(*builder).expr(0xc00db7d468?, 0xc00d6c9200, {0x131ee40, 0xc043899580})
	golang.org/x/tools@v0.5.0/go/ssa/builder.go:625 +0x17b
golang.org/x/tools/go/ssa.(*builder).stmt(0xc0046535d8?, 0xc00d6c9200, {0x131eff0?, 0xc05d3e3060?})
	golang.org/x/tools@v0.5.0/go/ssa/builder.go:2160 +0x168
golang.org/x/tools/go/ssa.(*builder).stmtList(0xc004653601?, 0xc0319bb830?, {0xc01c9d2180?, 0x5, 0xc01ee42200?})
	golang.org/x/tools@v0.5.0/go/ssa/builder.go:946 +0x45
golang.org/x/tools/go/ssa.(*builder).stmt(0xc00d6c9200?, 0xc00d6c9200, {0x131ede0?, 0xc04683c150?})
	golang.org/x/tools@v0.5.0/go/ssa/builder.go:2277 +0x859
golang.org/x/tools/go/ssa.(*builder).buildFunctionBody(0x93d5b1?, 0xc00d6c9200)
	golang.org/x/tools@v0.5.0/go/ssa/builder.go:2391 +0x437
golang.org/x/tools/go/ssa.(*builder).buildFunction(0x93d600?, 0xc00d6c9200)
	golang.org/x/tools@v0.5.0/go/ssa/builder.go:2326 +0x2e
golang.org/x/tools/go/ssa.(*builder).buildCreated(0xc004653a48)
	golang.org/x/tools@v0.5.0/go/ssa/builder.go:2413 +0x25
golang.org/x/tools/go/ssa.(*Package).build(0xc0368c8e00)
	golang.org/x/tools@v0.5.0/go/ssa/builder.go:2606 +0xc86
sync.(*Once).doSlow(0xc001831740?, 0xc016a2d630?)
	sync/once.go:74 +0xc2
sync.(*Once).Do(...)
	sync/once.go:65
golang.org/x/tools/go/ssa.(*Package).Build(...)
	golang.org/x/tools@v0.5.0/go/ssa/builder.go:2477
golang.org/x/tools/go/analysis/passes/buildssa.run(0xc05f2bd0e0)
	golang.org/x/tools@v0.5.0/go/analysis/passes/buildssa/buildssa.go:72 +0x1a8
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyze(0xc0062f1b30)
	github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_action.go:188 +0x9df
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func2()
	github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_action.go:106 +0x1d
github.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0xc0029b1c70, {0x10d982a, 0x8}, 0xc000140748)
	github.com/golangci/golangci-lint/pkg/timeutils/stopwatch.go:111 +0x4a
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe(0xc0650d0dc0?)
	github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_action.go:105 +0x85
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze.func2(0xc0062f1b30)
	github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_loadingpackage.go:80 +0xb4
created by github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze
	github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_loadingpackage.go:75 +0x1eb 

@oscr
Copy link
Contributor Author

oscr commented Feb 2, 2023

I have created an issue in golangci-lint repo. So lets wait and see if they have any advice for us.

@killianmuldoon
Copy link
Contributor

golangci/golangci-lint#3087

Looks like it could be relate to this issue?

@oscr
Copy link
Contributor Author

oscr commented Feb 3, 2023

@killianmuldoon It looks like a fix for ginkgolinter has been merged: golangci/golangci-lint#3553 So let's see when the next golangci-lint version is released.

@sbueringer
Copy link
Member

@oscr Do you want to reopen to track exploring the checks we didn't enable yet?

@oscr oscr changed the title Investigate why ginkgolinter crashes Enable ginkgolinter and it's checks Feb 8, 2023
@oscr
Copy link
Contributor Author

oscr commented Feb 8, 2023

/reopen

@k8s-ci-robot k8s-ci-robot reopened this Feb 8, 2023
@k8s-ci-robot
Copy link
Contributor

@oscr: Reopened this issue.

In response to this:

/reopen

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@oscr oscr changed the title Enable ginkgolinter and it's checks Enable ginkgolinter and enable checks Feb 8, 2023
@killianmuldoon
Copy link
Contributor

/assign

Including this in the ginkgo bump in #8796

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
4 participants