-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
v1.21 nondeterministic linting due to ctrlflow: failed prerequisites
#840
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
Comments
Opened golangci/golangci-lint#840 to investigate why linter is nondeterministic now
Opened golangci/golangci-lint#840 to investigate why linter is nondeterministic now
See issue golangci/golangci-lint#840 A low cost fix here is to run `fmt` as part of the gen, which will then be checked by gencheck. Also tidy up the tidy-go target usage a bit.
See issue golangci/golangci-lint#840 A low cost fix here is to run `fmt` as part of the gen, which will then be checked by gencheck. Also tidy up the tidy-go target usage a bit.
I am not certain but I think the root cause is #866 |
I am pretty sure #866 is not exactly the same, although they may be related. We are still seeing this even though our build passes. Another example, two CI runs of the same code: https://prow.istio.io/view/gcs/istio-prow/pr-logs/pull/istio_istio/19217/lint_istio/4405 |
istio#19174 somehow got a linter error merged due to golangci/golangci-lint#840. This resolves the error
#19174 somehow got a linter error merged due to golangci/golangci-lint#840. This resolves the error
Originally I could only reproduce in our CI as well, now I can do so locally.
All the noise with the docker run command was just to more closely simulate what is going on in CI |
Can be reproduced on master branch of https://github.com/istio/istio. Specifically I ran at 5803182856ec3a831529586e8ac265c17f417bf4 but probably similar regardless of cmmit |
I added some additional logging to a local build to output the errors:
The diff to get this: diff --git a/pkg/golinters/goanalysis/runner.go b/pkg/golinters/goanalysis/runner.go
index 5d8470d..00031a1 100644
--- a/pkg/golinters/goanalysis/runner.go
+++ b/pkg/golinters/goanalysis/runner.go
@@ -571,6 +571,9 @@ func (act *action) analyze() {
debugf("%s: run analyzer in %s", act, analyzedIn)
}
}
+ if err != nil {
+ act.r.log.Warnf("Logging err: %s", err)
+ }
act.err = err
// disallow calls after Run Basically it looks like there are a ton of errors, but the are all bogus - our project builds fine. I am thinking since there are some changes to run things in more parallel, now it is somehow not loading all the dependencies in the right order? |
Opened golangci/golangci-lint#840 to investigate why linter is nondeterministic now
See issue golangci/golangci-lint#840 A low cost fix here is to run `fmt` as part of the gen, which will then be checked by gencheck. Also tidy up the tidy-go target usage a bit.
istio#19174 somehow got a linter error merged due to golangci/golangci-lint#840. This resolves the error
+1 same problem
|
Anyone have a workaround for this issue? Build pipeline is not stable with this release. |
We ended up reverting back to an old version |
Same here. We're at |
Thank you @edaniels and @howardjohn for your replies. Does that work with golang 1.13.x? I moved to the latest version when i faced issues with 1.18.0 and golang 1.13.x |
Yep it's working fine on |
As for the workaround - simple retry loop appears to be doing the trick - I just did this in my project and it stabilized the CI pipeline: BTW. It's quite easy to reproduce this issue with latest It appears to be reproducing more frequently when the compiler has more work to do. By changing any comment in |
Please check the #885, should be the same issue. |
I believe we are affected by this bug: golangci/golangci-lint#840. 1.19.1 is reportedly not affected.
I believe we are affected by this bug: golangci/golangci-lint#840. 1.19.1 is reportedly not affected.
is there any updates on this? we can't use the new versions because of this but we can't use the old versions because they use 30gb+ memory and get OOM killed |
See golangci/golangci-lint#840 This issue seen intermittentily when building this repo using v1.23.1 or v1.21.0 of linter Here is an example on macOS which shows intermittent problem with v1.21.0 ... 18:21 $ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/v1.23.1/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.21.0 golangci/golangci-lint info checking GitHub for tag 'v1.21.0' golangci/golangci-lint info found version: 1.21.0 for v1.21.0/darwin/amd64 golangci/golangci-lint info installed /Users/kmcpeake/go/bin/golangci-lint 18:22 $ golangci-lint cache clean 18:22 $ golangci-lint run --timeout 30m 18:22 $ golangci-lint cache clean 18:22 $ golangci-lint run --timeout 30m WARN [runner] Can't run linter goanalysis_metalinter: fact_deprecated: failed prerequisites: [email protected]/onosproject/onos-test/pkg/onit/env 18:22 $ golangci-lint cache clean 18:23 $ golangci-lint run --timeout 30m 18:23 $ golangci-lint --version golangci-lint has version 1.21.0 built from 645e794 on 2019-10-15T18:15:04Z golangci-lint says v1.19.1 does not have this problem but reverting to it highlights other go warnings than detected currently (plus it has worse performance)
See golangci/golangci-lint#840 This issue seen intermittentily when building this repo using v1.23.1 or v1.21.0 of linter Here is an example on macOS which shows intermittent problem with v1.21.0 ... 18:21 $ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/v1.23.1/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.21.0 golangci/golangci-lint info checking GitHub for tag 'v1.21.0' golangci/golangci-lint info found version: 1.21.0 for v1.21.0/darwin/amd64 golangci/golangci-lint info installed /Users/kmcpeake/go/bin/golangci-lint 18:22 $ golangci-lint cache clean 18:22 $ golangci-lint run --timeout 30m 18:22 $ golangci-lint cache clean 18:22 $ golangci-lint run --timeout 30m WARN [runner] Can't run linter goanalysis_metalinter: fact_deprecated: failed prerequisites: [email protected]/onosproject/onos-test/pkg/onit/env 18:22 $ golangci-lint cache clean 18:23 $ golangci-lint run --timeout 30m 18:23 $ golangci-lint --version golangci-lint has version 1.21.0 built from 645e794 on 2019-10-15T18:15:04Z golangci-lint says v1.19.1 does not have this problem but reverting to it highlights other go warnings than detected currently (plus it has worse performance)
This is apparently fixed in the latest version, will update later after testing |
Hi, |
Thank you for creating the issue!
Please include the following information:
Version of golangci-lint
Config file
Go environment
$ go version && go env 1.13
In our CI, we ran the same commit multiple times, and got different results
Since it merged, some others have passed:
https://prow.istio.io/view/gcs/istio-prow/logs/lint_istio_postsubmit/422
https://prow.istio.io/view/gcs/istio-prow/logs/lint_istio_postsubmit/423
and some have failed
https://prow.istio.io/view/gcs/istio-prow/pr-logs/pull/istio_istio/18571/lint_istio/3452
https://prow.istio.io/view/gcs/istio-prow/pr-logs/pull/istio_istio/18512/lint_istio/3453
All of the ones that pass warn that they are skipping some linter:
And all the ones that fail do not have these messages
The text was updated successfully, but these errors were encountered: