Fork me on GitHub
#clj-kondo
<
2022-05-04
>
Anders Eknert10:05:54

Hey! 🙂 When running clj-kondo via the lein plugin, it reports calls to abs as unresolved.. I guess it’s depending on an older version of Clojure than 1.11? Can I force it to use the Clojure version defined in my project, or should I open a ticket in the lein-clj-kondo repo?

borkdude10:05:56

@anders982 If you lint the clojure version that is used within your project, this should resolve itself

borkdude10:05:14

I don't see any such warning with the latest clj-kondo:

$ clj-kondo --lint - <<< 'abs'
linting took 140ms, errors: 0, warnings: 0

Anders Eknert10:05:05

Right - this only pertains to the lein plugin - not when running clj-kondo as standalone

Anders Eknert10:05:10

But the lein plugin should work as well, no? 🙂

borkdude10:05:50

I don't see why the lein plugin should have a different clj-kondo version.

borkdude10:05:05

well, you can bump the version yourself in your project.clj?

Anders Eknert10:05:03

How would I do that? Just adding the dependency to the project does not seem to affect what’s being used by the :plugins . Sorry for the noob questions.. this is all kinda new to me 😬😅

borkdude10:05:54

I'm not sure either :) maybe @UKFSJSM38 knows

🙂 1
👍 1
ericdallo11:05:27

Hum, maybe lein-clj-kondo is using a old clojure from it's deps ?

ericdallo11:05:00

We should bump it to latest kondo and release a new plugin version

Anders Eknert11:05:10

sounds good! 😃

borkdude12:05:06

well, you have full permission on that repo @UKFSJSM38, go ahead :)

👍 1
Anders Eknert12:05:33

Thanks @UKFSJSM38 :thumbsup: And @U04V15CAJ 🙂

ericdallo12:05:57

sure, will do! Meanwhile @anders982 I suggest you take a look at https://github.com/clojure-lsp/lein-clojure-lsp, which has clj-kondo diagnostics and more features like clean-ns and format

Anders Eknert12:05:08

interesting! will do, thanks :thumbsup:

Anders Eknert12:05:00

just tried that plugin, but seeing:

$ lein clojure-lsp clean-ns --dry
clojure.lang.Compiler$CompilerException: Syntax error compiling deftype* at (rewrite_clj/node/stringz.cljc:16:1).
#:clojure.error{:phase :compile-syntax-check, :line 16, :column 1, :source "rewrite_clj/node/stringz.cljc", :symbol deftype*}
followed by a very long trace.. some known issue?

ericdallo12:05:46

no, probably a conflict with rewrite-clj, any other plugin that uses rewrite-clj? like that old clj-kondo?

borkdude12:05:13

Going back to the original problem though, I think users should have a way to bump clj-kondo without changing that plugin

👍 1
borkdude12:05:29

I would be surprised if lein didn't support that in profiles.clj or so

ericdallo12:05:53

I'm not aware of that feature @U04V15CAJ if we find it, I'd like to use on lein-clojure-lsp as well 😂

😄 1
borkdude12:05:33

Maybe try #leiningen?

Anders Eknert12:05:53

@UKFSJSM38 you were right - removing the lein-kibit plugin “fixes” the issue

👍 1
borkdude12:05:25

clj-kondo does not use rewrite-clj directly, it has a forked version inside of it

borkdude12:05:48

the problem such as above usually comes from libraries that are AOT-ed right? I hope clojure-lsp doesn't do that

ericdallo12:05:19

yeah, AFAIK we don't do that, we just uber it on build.clj but not uber-aot https://github.com/clojure-lsp/clojure-lsp/blob/master/cli/build.clj#L114

ericdallo12:05:46

Unless I'm doing something wrong there

borkdude12:05:06

when deploying to clojars you should not make an uberjar

ericdallo12:05:45

oh, good point, I think this was because of a old refactor, we should not uber indeed!

ericdallo12:05:56

I'll fix it soon and release a version without that, thanks!

Anders Eknert13:05:03

would that be related to my problem, or just a good fix regardless? 🙂

borkdude13:05:26

could be related

Anders Eknert13:05:45

:thumbsup: I’ll keep a watch for updates then, thanks!

ericdallo13:05:26

I can take a look on both things later today

Anders Eknert13:05:37

Thanks Eric :thumbsup:

Anders Eknert09:05:59

@UKFSJSM38 I saw the new update and tag (0.1.4) to lein-clj-kondo, but looks like the publishing step failed

ericdallo10:05:21

Yeah, I had some issues with the clojars token, I'll fix it soon

👍 1
ericdallo13:05:23

Fixed, released lein-clj-kondo 0.1.4 @anders982

Anders Eknert13:05:38

Awesome, thanks! 😃

Anders Eknert20:05:18

Finally got some time to bump the dependency. The good news is that the new version solves the “unresolved” problem from earlier version. The bad news is that it seems to have brought in the same problem I previously reported with lein-clojure-lsp — it doesn’t work as long as lein-kibit is also a in the :plugins vector 😞 The stack trace looks different:

clojure.lang.Compiler$CompilerException: Syntax error compiling var at (edamame/impl/parser.cljc:100:1).
#:clojure.error{:phase :compile-syntax-check, :line 100, :column 1, :source "edamame/impl/parser.cljc", :symbol var}
...
Caused by: java.lang.RuntimeException: Unable to resolve var: edn/read-symbolic-value in this context
But except for that the problem (and the workaround) looks identical

ericdallo15:05:16

We release lein-clj-kondo with lein deploy clojars , that should not create a uber, but a jar only, right @U04V15CAJ?

Anders Eknert16:05:54

hmm… could something else have changed between releases that would cause this? it’s literally the only change I make:

❯ lein clj-kondo --lint src
linting took 299ms, errors: 0, warnings: 0

# bumping :plugins lein-clj-kondo "0.1.3" -> lein-clj-kondo "0.1.4" 

❯ lein clj-kondo --lint src
clojure.lang.Compiler$CompilerException: Syntax error compiling var at (edamame/impl/parser.cljc:100:1).
#:clojure.error{:phase :compile-syntax-check, :line 100, :column 1, :source "edamame/impl/parser.cljc", :symbol var}
If I comment out the lein-kibit plugin dependency, things work as before, but I’d rather not have to

ericdallo16:05:02

Any clues @U04V15CAJ ?I don't know too why that happens

borkdude17:05:58

I don't know anything about lein plugins, sorry

borkdude17:05:09

Perhaps switch to deps.edn to invoke clj-kondo