-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Fix failed_prerequisites error #944
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
Fix failed_prerequisites error #944
Conversation
…ms found by the tool (#131) * [redhat] Fix a couple of typo in the JSON struct tags * [cmd2cve] Remove unused field member * [rpm] Make ToWFN actually propagate the error * [redhat] Remove unused field in struct * [rbs2nvd] Remove unusued const The UserAgent is setup as a string litteral a few lines below. * [ci]: Enable a few linter passes with golangci-lint * [ci] Remove the typecheck pass to work around a golangci-lint upstream bug golangci/golangci-lint#944 * ci: Allow the go: master build to fail
EDIT: Here is some stats from running github.com/golangci/golangci-lint@master:
github.com/ksoichiro/golangci-lint@fix-failed_prerequisites-error:
|
Can someone please run this version on kubernetes sources? I'm getting OOM-ed every time, but I'm not sure why. |
@ernado I've tried kubernetes source.
|
Thank you, @ksoichiro The 33GB is pretty big (but can be just because of unused linter), can you please also check current released version for any RAM consumption regressions? If the memory consumption is nearly the same, LGTM |
Thank you for your review @ernado.
It seems average memory increased so much with my fix. |
Thank you @ksoichiro! |
Sorry, I checked again and I found my comparison was not accurate. As I explained above, the execution order of linters is non-deterministic. Here is the result. I cleared cache before each execution.
*1: interrupted by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like no memory usage regression, so LGTM.
Ensure that `unused` is always the last in execution order. It can speed up packages loading a bit. Refactor enabled linters set to remove extra logging. Relates: #944
Ensure that `unused` is always the last in execution order. It can speed up packages loading a bit. Refactor enabled linters set to remove extra logging. Relates: #944
Ensure that `unused` is always the last in execution order. It can speed up packages loading a bit. Refactor enabled linters set to remove extra logging. Relates: #944
Ensure that `unused` is always the last in execution order. It can speed up packages loading a bit. Refactor enabled linters set to remove extra logging. Relates: #944
Hi,
I investigated some similar issues - #827, #840, #885, #824, #888, ... - and I found:
because unused linter's load mode is LoadModeWholeProgram,
so two linters are executed by default.
while "typecheck" linter in goanalysis_metalinter parses files by itself,
which results in error of type checking for dependent packages
by their inconsistency.
determined by
range
ofmap
, this is why we do not always encounter these issues.In this PR, I fixed this problem by cloning loaded packages in linter contextbefore the linter is executed to avoid sharing changed packages to another linter.
Cloning packages might not be the best solution from the perspective of
efficiency such as memory usage, but I think it's better than causing occasional failures.
UPDATE:
I found that the changed fields of the
Package
areTypes
,TypesInfo
andSyntax
, so I updated my changes to just clear those fields before the analysis.