Closed PratDesai closed 3 years ago
I pulled down the linked repo (the tool.deps project vs your leiningen), and added your code above. I ran Calva jack-in, eval'd the file containing your code, and ran test-issue
and I get the output you showed you got from lein repl.
I then used your project.clj and ran jack-in with Calva, choosing Leiningen, and got the error you get.
I ran it with lein repl and it succeeded, like you say.
I then wondered if anything being injected by our jack-in could be causing this somehow and I realized if you remove the clj-kondo dependency injection from the jack-in command, it works. This is the altered command for my machine (linux), that the code works with:
lein update-in :dependencies conj '[nrepl"0.6.0"]' -- update-in :plugins conj '[cider/cider-nrepl"0.23.0"]' -- update-in '[:repl-options :nrepl-middleware]' conj '["cider.nrepl/cider-middleware"]' -- repl
I'm unsure what's going on, but for now you can either run it with jack in using clojure cli (deps.edn) instead of leiningen (project.clj), or you can run jack-in for leiningen, copy the command it issues in the jack-in terminal, and remove the part that uses update-in
to inject clj-kondo. (The quote escaping is different for Windows.)
clj-kondo is currently used as a dependency to find var usages for adding decorations to show instrumented forms for the debugger, so this is the only thing you'd be lacking if you did that. This is separate from the extension that lints, so you would still have linting.
@PEZ Maybe we do need a different way of using clj-kondo, like @borkdude was saying. Though I have no idea what's going on here, as it works with tools.deps.
Tools.deps and leiningen have different strategies for resolving dependencies. Tools.deps basically chooses newer over older in case of conflict, and lein/maven basically chooses first over later. To debug this you could try to look at the output of lein deps :tree
and clojure -Stree
.
My guess would be that clj-kondo depends on transit-java (indirectly via transit-clj) and this has jackson.core version 2.8.7:
https://github.com/cognitect/transit-java/blob/cff7111c2081fc8415cd9bd6c6b2ba518680d660/pom.xml#L40
The class that's not being found was introduced in version 2.10.0: https://github.com/FasterXML/jackson-core/issues/571
So maybe a direct dependency on this newer version of jackson.core in your project.clj would help solve this issue, as a workaround.
Thank you both for a prompt response which such insightful comments.
@bpringe, I'll try out the command string that you posted. @borkdude, I'll try clj on Windows and see if that works with Calva jack-in as is.
@PratDesai If clj on Windows gives you trouble (e.g. because of Powershell, cmd.exe), you can also try deps.exe from here:
Closing this issue since it's not really Calva related, but rather a dependency resolution issue.
I am trying to get a basic crux-sql example running on a Windows 10 machine using Leiningen. Using @jonpither example code https://github.com/jonpither/crux-sql-demo.
Machine details: Windows 10 pro v1909 openjdk version "13.0.2" 2020-01-14
When I execute the test-issue function using lein repl in a Powershell window it works fine with the following output:
However, executing the same function via Calva repl in VS Code I get the following error: