Fork me on GitHub
#clj-kondo
<
2020-02-28
>
borkdude15:02:20

New clj-kondo release from Berlin with fellow contributor @rahul080327! https://github.com/borkdude/clj-kondo/releases/tag/v2020.02.28

clj-kondo 40
🎉 32
💙 16
imre16:02:04

Our jenkins seems to be having an issue with the new docker image, as there is no cat command available on it. Apparently the docker workflow jenkins plugin uses cat for some reason: https://github.com/jenkinsci/docker-workflow-plugin/blob/1089131014350e11adfa364d34e7717954350261/src/main/java/org/jenkinsci/plugins/docker/workflow/WithContainerStep.java#L198

imre16:02:21

.IOException: Failed to run image 'borkdude/clj-kondo:latest'. Error: docker: Error response from daemon: OCI runtime create failed: container_linux.go:346: starting container process caused "exec: \"cat\": executable file not found in $PATH": unknown.
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.run(DockerClient.java:138)
	at org.jenkinsci.plugins.docker.workflow.WithContainerStep$Execution.start(WithContainerStep.java:199)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:286)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:179)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122)

borkdude16:02:44

The image is now from SCRATCH. Why do you need cat in it?

imre16:02:46

We don't but the jenkins docker workflow plugin seems to do

borkdude16:02:08

I think the solution to fix this for jenkins would be to create your own image based and download the clj-kondo binary from the releases page in your own images.

tanzoniteblack16:02:06

there's also a workaround mentioned in that stack overflow link

tanzoniteblack16:02:38

and a mention that it might be fixed in the latest release of that plugin if you'd like to update and pray that updating something in Jenkins doesn't break everything you care about

imre16:02:14

We'll have a look, thanks for the suggestions

zarkone16:02:39

same issue but for github actions: but with tail instead of cat

zarkone16:02:37

my action setup:

name: Lint project with clj-kondo

on: [push]

jobs:
  lint:
    runs-on: ubuntu-latest
    container: borkdude/clj-kondo:latest
    steps:
    - uses: actions/[email protected]
    - name: Run clj-kondo
      run: clj-kondo --lint src plugins --config .clj-kondo/config.edn

borkdude16:02:56

Would it be better if we based it on busybox ?

zarkone16:02:59

probably could solve this annoying one 🙂 also, on clj-kondo repo i see different error (with @U04V4KLKC action) : COPY failed: stat /var/lib/docker/overlay2/16a7f7d20fb458c8fb4b3a87cec35c19dad2b97c14c5016c5658543373d5c549/merged/usr/local/bin/clj-kondo: no such file or directory

zarkone16:02:46

but i dont see that any of paths had been changed..

tanzoniteblack16:02:28

that's the problem I was seeing before using the static binary. The file existed, but when I attempted to run it I got a no such file or directory error

zarkone16:02:25

but honestly runners should take care about such cases, wierd that jenkins and github don't have this thing taking in account -- if i understand the issue correct.

borkdude16:02:35

We are going to try busybox:musl + fix the path

zarkone16:02:48

thanks for fast feedback! and also, i've removed one really hidden mistake in my code last week with help of clj-kondo -- thakns for this as well 🙂

borkdude17:02:18

Making a new release now.

zarkone17:02:41

works 🎉

borkdude17:02:25

docker is now building, should be released in a few minutes. we have to go to a conference dinner now. please notify us of success 🙂

borkdude21:02:45

So I think all issues are fixed now?

zarkone22:02:56

Sorry, I also was on conference dinner :) will check, but I tried pre release snapshot docker image -- it worked!

tanzoniteblack16:02:51

@borkdude, I was literally just having an issue yesterday with setting our automated builds to use clj-kondo related to alpine linux (or something we were doing, not sure what entirely, hoping this static version fixes that). What's your recommended way to automatically install the linux static version, since I don't see an obvious way to do it via the normally recommended install-clj-kondo script?

borkdude16:02:27

@tanzoniteblack I would use the link from the releases page and update it every so often

👍 4
tanzoniteblack16:02:14

that's what I was writing in to our docker build right now, so works for me 🙂

tanzoniteblack16:02:39

(also, thanks for this awesome piece of software and for fixing a problem you didn't even know I was having the very next day)

plins19:02:09

hey @borkdude, I having a false positive with #(do []) with redundant do but its not redundant, if I remove the do the call will fail

imre20:02:12

I think in your case using #(vector) could be more idiomatic https://clojuredocs.org/clojure.core/vector

imre20:02:51

And it would circumvent the problem

plins11:03:42

oh thanks for the reply and sorry for that!

tanzoniteblack19:02:44

is there a short and sweet list of names of linters and what they do? I see https://github.com/borkdude/clj-kondo/blob/master/src/clj_kondo/impl/config.clj which lists out the various linters that are available, and I can guess based off the names, but I wasn't sure if I'm just missing a doc somewhere

8
borkdude21:02:12

@plins Actually I think the error might be coming from some other linter you're using, in clj-kondo this works fine:

$ clj-kondo --lint - <<< '#(do [])'
linting took 16ms, errors: 0, warnings: 0

borkdude21:02:02

@tanzoniteblack That's the place I link to from the config.md docs