-
-
Notifications
You must be signed in to change notification settings - Fork 151
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
"File exists" errors when un-taring golangci-lint #244
Comments
Looking at https://pipelines.actions.githubusercontent.com/D1tYAQGUpNaqlpNKaplcT4IVn3rJSlK5kNFys0tSrNSiqbBdeP/_apis/pipelines/1/runs/3119/signedlogcontent/4?urlExpires=2021-05-24T11%3A43%3A31.7174061Z&urlSigningMethod=HMACV1&urlSignature=fl95dXdfFb1YndQYp1OdBV8sg4IEP%2Fdu9Jw4VQz1%2B8c%3D I'm a bit confused what is really going on here:
It seems that the install actually went fine but there's a follow-on step that breaks? |
I see similar errors why I try to use this action. Here's a sample of the first two complaints:
|
maintainers: any chance to get this fixed? Has a number of past and current related issues. updated sorry for the bad @ |
I see previous discussion about not running certain Go toolchain commands ahead of golangci-lint in the same GitHub Actions job. In my case, the only thing I run before this action is go list -find -json ./... in order to ensure that there are actually some Go files available on the current branch. If I try to run golangci-lint when there are no Go files available, it fails, instead of succeeding trivially. When go list either produces no output or its "GoFiles" object field has no entries, I skip running golangci-lint. |
Oh, I just noticed that this action runs actions/setup-go itself. I was taking care of that myself before running this action, because I need to run go list first as explained earlier. Is it possible to influence which version of Go this action installs? I don't see mention of such a parameter in the action.yaml file. |
As a "very hot" solution I have just disabled package caching:
|
1509: Update golangci, trying to fix lint r=Kay-Zee a=Kay-Zee This updates the golangci action to just use the latest v2 action, which is recommended for the action. Also, skipping the PKG cache because of all the File Exists error. Will have to follow: golangci/golangci-lint-action#244 to see when this is resolved. (though lint is one of the faster jobs, so it's fine even if we skip the cache) Lastly, I'm suggesting we skip the `unused` lint for TEST FILES ONLY, as there are many cases where we want to use `t.Skip()` to quarantine, but then it causes "unused" errors. This will resolve those cases and better allow us to use `t.Skip()` Co-authored-by: Kay-Zee <kan@axiomzen.co>
1509: Update golangci, trying to fix lint r=Kay-Zee a=Kay-Zee This updates the golangci action to just use the latest v2 action, which is recommended for the action. Also, skipping the PKG cache because of all the File Exists error. Will have to follow: golangci/golangci-lint-action#244 to see when this is resolved. (though lint is one of the faster jobs, so it's fine even if we skip the cache) Lastly, I'm suggesting we skip the `unused` lint for TEST FILES ONLY, as there are many cases where we want to use `t.Skip()` to quarantine, but then it causes "unused" errors. This will resolve those cases and better allow us to use `t.Skip()` Co-authored-by: Kay-Zee <kan@axiomzen.co>
1509: Update golangci, trying to fix lint r=Kay-Zee a=Kay-Zee This updates the golangci action to just use the latest v2 action, which is recommended for the action. Also, skipping the PKG cache because of all the File Exists error. Will have to follow: golangci/golangci-lint-action#244 to see when this is resolved. (though lint is one of the faster jobs, so it's fine even if we skip the cache) Lastly, I'm suggesting we skip the `unused` lint for TEST FILES ONLY, as there are many cases where we want to use `t.Skip()` to quarantine, but then it causes "unused" errors. This will resolve those cases and better allow us to use `t.Skip()` Co-authored-by: Kay-Zee <kan@axiomzen.co>
This appears to still be present in v1.42 My build depends on generated files. As several linters seem to examine the full call tree, they will always fail without the generated content. Creating something of a chicken and egg problem. |
Looks like this issue has not really caught attention with the maintainers ;) |
there is a special - uses: actions/checkout@v2
- uses: actions/setup-go@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: latest
skip-go-installation: true |
you are right, there are several linters that require whole project, like |
In evcc-io/evcc@1557bb0 I've added In fact, the errors are not caused by the Go installation:
|
I checked the logs, so the linter works fine, no issues at all. The errors are related to usage of cache and I found that you are caching the go folder in another step, so I would recommend you to remove that step, it is not needed: https://github.com/evcc-io/evcc/blob/master/.github/workflows/build.yml#L18-L26 so, your step restores the cache, then you call lint action that tries to restore the cache as well and of course it fails due to the files already exist. |
Thank you for the comment. I still feel this is bad behaviour. Use case: My code contained generated files and I'd also like to lint those (might have gotten the templates wrong). I can only generate them when the cache is already populated. Why does the linter think that it needs to restore the cache? Imho that's not its task and if it's optional behaviour then it would help have control over it? |
have you tried to disable cache?: skip-pkg-cache: true
skip-build-cache: true the action is designed to be run alone first, since you have more advanced usage you need to tweak the action's and linter's configs accordingly |
That leads to:
with the manual caching step before looking like this:
This cache will of course be cold when the I've finally moved the linter to a later position after the first build step and then it succeeds. |
Why can we not add |
Because it is not our code, we use GitHub cache package |
Looks like someone tried to fix this upstream for this very package here: actions/toolkit#717 but that PR was superseded by actions/toolkit#807 which was merged on May 21, 2021. However, the last release of As a result, this will not be fixed until a new upstream release is cut and this updates to use it, but no other code needs to be changed. |
@maintainers could we please reopen? IMHO we have the bad choices of slow CI due to excessive logging or slow CI due do omitting the caches, both are not good options. |
Currently we have ~50k lines of tar extraction errors with "File exists" when the golangi-lint-action runs. There doesn't seem to be a clean way around this, other than disabling its cache. See also: golangci/golangci-lint-action#244 (comment) Example of the offending run: https://github.com/neondatabase/autoscaling/actions/runs/4740610494/jobs/8416629913
Currently we have ~50k lines of tar extraction errors with "File exists" when the golangi-lint-action runs. There doesn't seem to be a clean way around this, other than disabling its cache. See also: golangci/golangci-lint-action#244 (comment) Example of the offending run: https://github.com/neondatabase/autoscaling/actions/runs/4740610494/jobs/8416629913
duplicate of #135 |
Disabling the cache during the `setup-go` step was probably done to avoid errors from the `golangci-lint` step golangci/golangci-lint-action#807, golangci/golangci-lint-action#244), but the `setup-go` step isn't actually needed before running `golangci-lint`.
Follow-up to #135, #156 and #221.
Using v2, I'm still seeing these errors:
Example is in https://github.com/andig/evcc/pull/1075/checks?check_run_id=2655591730
Apart from fixing using
tar
- why not just usego install
instead?The text was updated successfully, but these errors were encountered: