-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
buildssa.Analyzer: panic: cannot convert *t0 (M) to PM #3711
Comments
@ldez FYI I opened |
Waiting x/tools v0.9.0 in golangci-lint to test this issue. |
Before: Run$ make lint
/Users/anthony/golangci-lint/golangci-lint run -v ./...
INFO [config_reader] Config search paths: [./ /Users/anthony/golangci-vs-ent-generics /Users/anthony /Users /]
INFO [config_reader] Used config file .golangci.yml
INFO [lintersdb] Active 103 linters: [asasalint asciicheck bidichk bodyclose containedctx contextcheck cyclop deadcode decorder depguard dogsled dupl dupword durationcheck errcheck errchkjson errname errorlint execinquery exhaustive exhaustivestruct exhaustruct exportloopref forbidigo forcetypeassert funlen gci ginkgolinter gocheckcompilerdirectives gochecknoglobals gochecknoinits gocognit goconst gocritic gocyclo godot godox goerr113 gofmt gofumpt goheader goimports golint gomnd gomoddirectives gomodguard goprintffuncname gosec gosimple govet grouper ifshort importas ineffassign interfacebloat interfacer ireturn lll loggercheck maintidx makezero maligned misspell musttag nakedret nestif nilerr nilnil nlreturn noctx nolintlint nonamedreturns nosnakecase nosprintfhostport paralleltest prealloc predeclared promlinter reassign revive rowserrcheck scopelint sqlclosecheck staticcheck structcheck stylecheck tagliatelle tenv testableexamples testpackage thelper tparallel typecheck unconvert unparam unused usestdlibvars varcheck varnamelen wastedassign whitespace wrapcheck wsl]
INFO [loader] Go packages loading at mode 575 (deps|exports_file|imports|types_sizes|compiled_files|files|name) took 284.859167ms
WARN [runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive.
WARN [runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref.
WARN [runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused.
WARN [runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner.
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'.
WARN [runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner.
WARN [runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused.
WARN [runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused.
WARN [runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct.
WARN [runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming).
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 6.028083ms
INFO [linters_context] importas settings found, but no aliases listed. List aliases under alias: key.
INFO [linters_context/goanalysis] analyzers took 11.717338897s with top 10 stages: buildssa: 3.889424998s, buildir: 2.87580084s, goimports: 1.710905669s, dupl: 249.659123ms, bidichk: 224.86975ms, the_only_name: 216.410004ms, gofumpt: 151.091873ms, gocritic: 131.935874ms, gosec: 124.192375ms, ginkgolinter: 106.957541ms
ERRO [runner] Panic: bodyclose: package "ent" (isInitialPkg: true, needAnalyzeSource: true): interface conversion: interface {} is nil, not *buildssa.SSA: goroutine 5436 [running]:
runtime/debug.Stack()
/usr/local/go/src/runtime/debug/stack.go:24 +0x64
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func1()
/Users/anthony/golangci-lint/pkg/golinters/goanalysis/runner_action.go:102 +0x108
panic({0x1058857a0, 0x14006fd04b0})
/usr/local/go/src/runtime/panic.go:884 +0x1f4
github.com/timakin/bodyclose/passes/bodyclose.runner.run({0x140067848f0, {0x0, 0x0}, 0x0, {0x0, 0x0}, 0x0, 0x0}, 0x140067848f0)
/Users/anthony/golang_workspace/pkg/mod/github.com/timakin/bodyclose@v0.0.0-20221125081123-e39cf3fc478e/passes/bodyclose/bodyclose.go:45 +0x5c0
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyze(0x14003e5b9e0)
/Users/anthony/golangci-lint/pkg/golinters/goanalysis/runner_action.go:188 +0x914
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe.func2()
/Users/anthony/golangci-lint/pkg/golinters/goanalysis/runner_action.go:106 +0x20
github.com/golangci/golangci-lint/pkg/timeutils.(*Stopwatch).TrackStage(0x140021bd450, {0x1054f0367, 0x9}, 0x1400164d730)
/Users/anthony/golangci-lint/pkg/timeutils/stopwatch.go:111 +0x44
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*action).analyzeSafe(0x104f2c110?)
/Users/anthony/golangci-lint/pkg/golinters/goanalysis/runner_action.go:105 +0x74
github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze.func2(0x14003e5b9e0)
/Users/anthony/golangci-lint/pkg/golinters/goanalysis/runner_loadingpackage.go:80 +0xb0
created by github.com/golangci/golangci-lint/pkg/golinters/goanalysis.(*loadingPackage).analyze
/Users/anthony/golangci-lint/pkg/golinters/goanalysis/runner_loadingpackage.go:75 +0x168
WARN [runner] Can't run linter goanalysis_metalinter: goanalysis_metalinter: bodyclose: package "ent" (isInitialPkg: true, needAnalyzeSource: true): interface conversion: interface {} is nil, not *buildssa.SSA
WARN [linters_context] rowserrcheck is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649.
WARN [linters_context] structcheck is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649.
WARN [linters_context] wastedassign is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649.
INFO [runner] processing took 3.252µs with stages: max_same_issues: 625ns, skip_dirs: 333ns, nolint: 333ns, cgo: 209ns, max_from_linter: 167ns, path_prettifier: 125ns, exclude-rules: 125ns, path_shortener: 125ns, diff: 125ns, path_prefixer: 125ns, sort_results: 125ns, skip_files: 125ns, source_code: 125ns, exclude: 125ns, identifier_marker: 84ns, max_per_file_from_linter: 84ns, severity-rules: 84ns, uniq_by_line: 83ns, filename_unadjuster: 83ns, autogenerated_exclude: 42ns
INFO [runner] linters took 3.633432625s with stages: goanalysis_metalinter: 3.632557208s, rowserrcheck: 10.708µs, structcheck: 7.083µs, wastedassign: 6.5µs
ERRO Running error: 1 error occurred:
* can't run linter goanalysis_metalinter: goanalysis_metalinter: bodyclose: package "ent" (isInitialPkg: true, needAnalyzeSource: true): interface conversion: interface {} is nil, not *buildssa.SSA
INFO Memory: 41 samples, avg is 262.4MB, max is 361.8MB
INFO Execution took 3.934461416s
make: *** [lint] Error 3 After: Run$ make cache-clean
/Users/anthony/golangci-lint/golangci-lint cache clean
$ make lint
/Users/anthony/golangci-lint/golangci-lint run -v ./...
INFO [config_reader] Config search paths: [./ /Users/anthony/golangci-vs-ent-generics /Users/anthony /Users /]
INFO [config_reader] Used config file .golangci.yml
INFO [lintersdb] Active 106 linters: [asasalint asciicheck bidichk bodyclose containedctx contextcheck cyclop deadcode decorder depguard dogsled dupl dupword durationcheck errcheck errchkjson errname errorlint execinquery exhaustive exhaustivestruct exhaustruct exportloopref forbidigo forcetypeassert funlen gci ginkgolinter gocheckcompilerdirectives gochecknoglobals gochecknoinits gocognit goconst gocritic gocyclo godot godox goerr113 gofmt gofumpt goheader goimports golint gomnd gomoddirectives gomodguard goprintffuncname gosec gosimple gosmopolitan govet grouper ifshort importas ineffassign interfacebloat interfacer ireturn lll loggercheck maintidx makezero maligned misspell musttag nakedret nestif nilerr nilnil nlreturn noctx nolintlint nonamedreturns nosnakecase nosprintfhostport paralleltest prealloc predeclared promlinter reassign revive rowserrcheck scopelint sqlclosecheck staticcheck structcheck stylecheck tagalign tagliatelle tenv testableexamples testpackage thelper tparallel typecheck unconvert unparam unused usestdlibvars varcheck varnamelen wastedassign whitespace wrapcheck wsl zerologlint]
INFO [loader] Go packages loading at mode 575 (exports_file|types_sizes|compiled_files|deps|files|imports|name) took 268.432791ms
WARN [runner] The linter 'nosnakecase' is deprecated (since v1.48.1) due to: The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming).
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'.
WARN [runner] The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive.
WARN [runner] The linter 'ifshort' is deprecated (since v1.48.0) due to: The repository of the linter has been deprecated by the owner.
WARN [runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused.
WARN [runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused.
WARN [runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused.
WARN [runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref.
WARN [runner] The linter 'interfacer' is deprecated (since v1.38.0) due to: The repository of the linter has been archived by the owner.
WARN [runner] The linter 'exhaustivestruct' is deprecated (since v1.46.0) due to: The owner seems to have abandoned the linter. Replaced by exhaustruct.
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 8.007167ms
INFO [linters_context] importas settings found, but no aliases listed. List aliases under alias: key.
INFO [linters_context/goanalysis] analyzers took 35.211341591s with top 10 stages: exhaustive: 8.022403962s, buildir: 6.612866171s, buildssa: 4.365410128s, goimports: 2.862531123s, musttag: 1.176594627s, wastedassign: 582.692915ms, the_only_name: 524.019462ms, ctrlflow: 481.191676ms, fact_deprecated: 464.56733ms, bidichk: 436.21ms
INFO [runner/skip_dirs] Skipped 2 issues from dir ent/runtime by pattern ent/*
INFO [runner/skip_dirs] Skipped 11 issues from dir ent/car by pattern ent/*
INFO [runner/skip_dirs] Skipped 34 issues from dir ent/hook by pattern ent/*
INFO [runner/skip_dirs] Skipped 2 issues from dir ent/predicate by pattern ent/*
INFO [runner/skip_dirs] Skipped 25 issues from dir ent/migrate by pattern ent/*
INFO [runner/skip_dirs] Skipped 23 issues from dir ent/enttest by pattern ent/*
INFO [runner/skip_dirs] Skipped 13 issues from dir ent/user by pattern ent/*
INFO [runner/skip_dirs] Skipped 1432 issues from dir ent by pattern ent/*
INFO [runner/skip_dirs] Skipped 8 issues from dir ent/schema by pattern ent/*
INFO [runner] Issues before processing: 1550, after processing: 0
INFO [runner] Processors filtering stat (out/in): skip_dirs: 0/1550, path_prettifier: 1550/1550, skip_files: 1550/1550, cgo: 1550/1550, filename_unadjuster: 1550/1550
INFO [runner] processing took 3.370078ms with stages: path_prettifier: 1.872584ms, cgo: 982.458µs, skip_dirs: 290.125µs, filename_unadjuster: 219.458µs, nolint: 1.084µs, max_same_issues: 791ns, severity-rules: 416ns, exclude-rules: 375ns, fixer: 334ns, skip_files: 332ns, uniq_by_line: 291ns, exclude: 291ns, identifier_marker: 251ns, autogenerated_exclude: 249ns, source_code: 208ns, diff: 167ns, max_per_file_from_linter: 166ns, path_shortener: 166ns, max_from_linter: 125ns, sort_results: 124ns, path_prefixer: 83ns
INFO [runner] linters took 7.153959625s with stages: goanalysis_metalinter: 7.150495084s
INFO File cache stats: 28 entries of total size 159.9KiB
INFO Memory: 76 samples, avg is 329.4MB, max is 493.8MB
INFO Execution took 7.440720709s Looks like new release :) |
@ldez Is it possible for you to do a public release with this fix? |
I am still getting this with 1.52.2 |
@karelbilek |
We are also experiencing this issue on 1.52.2. |
It works with master. So if you "just" release master to new version, it will work. |
The unparam linter is panicking due to golangci/golangci-lint#3711
The unparam linter is panicking due to golangci/golangci-lint#3711
- Remove ent from bingo version control to avoid version incompatiblity between ent and entc - Add `make/dep_ent.mk` file to update ent before running it - Generate new ent files - Disable golangci-list unparam linter to avoid panic due to golangci/golangci-lint#3711
- Remove ent from bingo version control to avoid version incompatiblity between ent and entc - Add `make/dep_ent.mk` file to update ent before running it - Generate new ent files - Disable golangci-list unparam linter to avoid panic due to golangci/golangci-lint#3711
Description of the problem
This issue is continuation of #3086.
We are waiting for golang/go#58633
Stack trace example
Version of golangci-lint
Code example or link to a public repository
https://github.com/Antonboom/golangci-vs-ent-generics/tree/golangci-lint-v1.52.0
The text was updated successfully, but these errors were encountered: