Skip to content

Can't run linter goanalysis_metalinter: failed prerequisites #827

Closed
@nono

Description

@nono

Sometimes, when running golangci-lint on https://github.com/cozy/cozy-stack, I have a warning about failed_prerequisites:

WARN [runner] Can't run linter goanalysis_metalinter: fact_purity: failed prerequisites: buildssa@github.com/cozy/cozy-stack/model/instance/lifecycle [github.com/cozy/cozy-stack/model/app.test]
  • Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
    Yes, I've searched similar issues on GitHub and didn't find any.
    Yes, I've included all information below (version, config, etc).

Please include the following information:

Version of golangci-lint
$ golangci-lint --version
golangci-lint has version 1.21.0 built from 645e794 on 2019-10-15T18:16:56Z
Config file
$ cat .golangci.yml
cat: .golangci.yml: No such file or directory
Go environment
$ go version && go env
go version go1.13.1 linux/amd64
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/nono/.cache/go-build"
GOENV="/home/nono/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/nono/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/nix/store/2kzdq7gyxz9jqfqcrp97z2y03vbw4glc-go-1.13.1/share/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/nix/store/2kzdq7gyxz9jqfqcrp97z2y03vbw4glc-go-1.13.1/share/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="/nix/store/7hzmz83nv8khpwsk858yaac7y3idh0a7-gcc-wrapper-8.3.0/bin/cc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/nono/cc/stack/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build302705204=/tmp/go-build -gno-record-gcc-switches"
Verbose output of running
$ golangci-lint run -v
INFO [config_reader] Config search paths: [./ /home/nono/cc/stack /home/nono/cc /home/nono /home /] 
INFO [lintersdb] Active 10 linters: [deadcode errcheck gosimple govet ineffassign staticcheck structcheck typecheck unused varcheck] 
INFO [loader] Go packages loading at mode 575 (exports_file|types_sizes|compiled_files|deps|files|imports|name) took 2.691690133s 
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 70.353413ms 
INFO [runner/unused/goanalysis] analyzers took 5.857582585s with top 10 stages: buildssa: 4.867487779s, U1000: 990.094806ms 
INFO [runner/goanalysis_metalinter/goanalysis] analyzers took 9.763996494s with top 10 stages: buildssa: 4.693446351s, ineffassign: 503.987592ms, vrp: 405.948511ms, inspect: 367.360506ms, varcheck: 167.809469ms, SA4018: 166.777714ms, isgenerated: 163.478578ms, deadcode: 160.6481ms, errcheck: 147.053834ms, structcheck: 142.659624ms 
WARN [runner] Can't run linter goanalysis_metalinter: ctrlflow: failed prerequisites: inspect@github.com/cozy/cozy-stack/web/accounts [github.com/cozy/cozy-stack/web/middlewares.test] 
INFO [runner] processing took 4.732µs with stages: max_same_issues: 1.074µs, skip_dirs: 500ns, cgo: 493ns, nolint: 373ns, filename_unadjuster: 361ns, max_from_linter: 303ns, exclude: 226ns, skip_files: 201ns, path_prettifier: 200ns, uniq_by_line: 170ns, identifier_marker: 154ns, max_per_file_from_linter: 140ns, diff: 138ns, path_shortener: 134ns, autogenerated_exclude: 89ns, source_code: 89ns, exclude-rules: 87ns 
INFO [runner] linters took 3.157498783s with stages: unused: 1.664301241s, goanalysis_metalinter: 1.493144531s 
INFO File cache stats: 0 entries of total size 0B 
INFO Memory: 60 samples, avg is 407.5MB, max is 1076.4MB 
INFO Execution took 5.924849209s

Activity

dixonwille

dixonwille commented on Oct 22, 2019

@dixonwille

I feel like this is related #824

amber-zhang

amber-zhang commented on Nov 7, 2019

@amber-zhang

Hi I met same problem.

$ golangci-lint run -v main.go
INFO [config_reader] Config search paths: [./ /home/ibmadmin/github.ibm.com/spectrum-virtualize-exporter /home/ibmadmin/github.ibm.com /home/ibmadmin /home /] 
INFO [config_reader] Used config file .golangci.yml 
INFO [lintersdb] Active 30 linters: [deadcode depguard dogsled dupl errcheck funlen gochecknoinits goconst gocritic gocyclo gofmt goimports golint gosec gosimple govet ineffassign interfacer lll misspell nakedret scopelint staticcheck structcheck stylecheck typecheck unconvert unparam varcheck whitespace] 
INFO [loader] Go packages loading at mode 575 (name|types_sizes|deps|exports_file|files|imports|compiled_files) took 322.014245ms 
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 671.191µs 
INFO [runner/goanalysis_metalinter/goanalysis] analyzers took 2.392766ms with top 10 stages: fact_deprecated: 458.401µs, buildssa: 114.037µs, inspect: 112.347µs, printf: 54.367µs, ctrlflow: 49.075µs, fact_purity: 43.913µs, depguard: 25.28µs, unparam: 23.584µs, S1034: 22.43µs, SA1001: 20.957µs 
WARN [runner] Can't run linter goanalysis_metalinter: S1008: failed prerequisites: inspect@command-line-arguments, isgenerated@command-line-arguments 
INFO [runner] processing took 6.1µs with stages: max_same_issues: 1.653µs, skip_dirs: 680ns, cgo: 596ns, nolint: 586ns, skip_files: 320ns, max_from_linter: 304ns, exclude: 278ns, filename_unadjuster: 265ns, identifier_marker: 248ns, path_prettifier: 179ns, path_shortener: 172ns, diff: 167ns, uniq_by_line: 165ns, source_code: 163ns, max_per_file_from_linter: 159ns, autogenerated_exclude: 93ns, exclude-rules: 72ns 
INFO [runner] linters took 521.726734ms with stages: goanalysis_metalinter: 521.624518ms 
INFO File cache stats: 0 entries of total size 0B 
INFO Memory: 10 samples, avg is 88.4MB, max is 134.8MB 
INFO Execution took 880.10069ms                   
$ go version
go version go1.12.9 linux/amd64
$ golangci-lint version
golangci-lint has version 1.21.0 built from 645e794 on 2019-10-15T18:16:56Z
avnindersingh

avnindersingh commented on Nov 8, 2019

@avnindersingh

i am also seeing the same issue ... any workaround will be helpful...

opskumu

opskumu commented on Nov 12, 2019

@opskumu

+1 same problem

WARN [runner] Can't run linter goanalysis_metalinter: SA2003: failed prerequisites: buildssa@command-line-arguments
➜  ~ golangci-lint version
golangci-lint has version v1.21.1-0.20191111000716-14ebae29060f built from (unknown, mod sum: "h1:J9Xwp1uY0EooAwj8OONV3bbgfAChsFdOMfFzH5eWcnQ=") on (unknown)
➜  ~ go version
go version go1.13.4 darwin/amd64
➜  ~
t57root

t57root commented on Nov 17, 2019

@t57root

same error. Rerun the command then the problem go away.

Am6er

Am6er commented on Nov 19, 2019

@Am6er

confirm

amber@AmberMac Test % cat test.go              
package main

func main() {
amber@AmberMac Test % golangci-lint run test.go
WARN [runner] Can't run linter goanalysis_metalinter: vrp: failed prerequisites: buildssa@command-line-arguments 
WARN [runner] Can't run linter unused: buildssa: analysis skipped: errors in package: [/Users/amber/Test/test.go:4:2: expected '}', found 'EOF' /Users/amber/Test/test.go:4:2: expected '}', found 'EOF'] 
amber@AmberMac Test % golangci-lint version
golangci-lint has version 1.21.0 built from 645e794 on 2019-10-15T18:15:04Z
durban89

durban89 commented on Nov 20, 2019

@durban89

+1 same error

$ golangci-lint run --fast --out-format tab main.go
WARN [runner] Can't run linter goanalysis_metalinter: S1011: failed prerequisites: inspect@command-line-arguments, isgenerated@command-line-arguments
$ golangci-lint --version
golangci-lint has version 1.21.0 built from 645e794 on 2019-10-15T18:15:04Z
$ go version
go version go1.13.1 darwin/amd64
alvarolm

alvarolm commented on Nov 20, 2019

@alvarolm

same here:

golangci-lint has version 1.21.0 built from 645e794 on 2019-10-15T18:16:56
go version go1.13.4 linux/amd64
$ golangci-lint run .                                                                                                                                                                                   
WARN [runner] Can't run linter goanalysis_metalinter: assign: failed prerequisites: inspect@pactado/securer 
WARN [runner] Can't run linter unused: buildssa: analysis skipped: errors in package: [/home/alvarolm/dev/assets/go/src/pr/main.go:39:25: ReadFile not declared by package ioutil] 
$ golangci-lint run .
WARN [runner] Can't run linter goanalysis_metalinter: SA4001: failed prerequisites: inspect@pactado/securer 
WARN [runner] Can't run linter unused: buildssa: analysis skipped: errors in package: [/home/alvarolm/dev/assets/go/src/pr/main.go:39:25: ReadFile not declared by package ioutil] 
yangwenmai

yangwenmai commented on Dec 5, 2019

@yangwenmai

+1 same problem

[WARN] golangci-lint ctrlflow: failed prerequisites

➜  ~ golangci-lint version
golangci-lint has version 1.21.0 built from 645e794 on 2019-10-15T18:15:04Z
➜  ~ go version
go version go1.13.5 darwin/amd64
awoodbeck

awoodbeck commented on Dec 5, 2019

@awoodbeck

This issue appears to be introduce with commit 95ec0cf.

hiromaily

hiromaily commented on Dec 11, 2019

@hiromaily

115 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @nono@abscondment@guesslin@chmouel@coderanger

        Issue actions

          Can't run linter goanalysis_metalinter: failed prerequisites · Issue #827 · golangci/golangci-lint