Fork me on GitHub

hey folks I accidentally pushed to the clojure-emacs/cider-nrepl instead of my own fork... I undid it as soon as I realized (force pushed back to 4610439e68). It was there for maybe ~20 seconds. If you happened to pull/fetch during that time then I'm very sorry! If you see something weird on CI then... that was me. Apologies!


in related news we could use some help getting CI back on track. I've identified four separate issues that are keeping our builds from going green:

David Reno14:11:25

noob question: if I have cider running and need to add a library (`:require`), it’s not downloaded to the project and won’t work until something like lein gets the code. Does cider use lein or something like it when starting to get code specified in the project.clj file? If not, is there a “best way” to download the library? Should I drop to an eshell and use lein to download? Can I just restart cider and it will trigger the download?

David Reno14:11:26

looks like cider-quit followed by cider-jack-in gets it done. Guessing cider-restart does the same. Still not sure if cider uses lein or something else to download the library.


Cider constructs an invocation to lein, boot, or clj to start your app with the cider code inside of it. You should see a message and you jack in of the exact command that it is running


@U11BV7MTK beat me to it 🙂 you can find the exact invocation it uses in your *messages* buffer


there are some projects which will allow you to add dependencies without restarting (pomegrenate, alembic), but you then need to make sure they are added to the project first. They also have some issues with newer versions of Java unfortunately. If you don't mind rebooting Clojure that's the easiest option.

David Reno14:11:40

thanks for the reply. So generally, when changing the project file, I should do a cider-restart?


@UBMFBEWKY if you have clj-refactor enabled, you can use cljr-add-project-dependency which will help you find the available library and version, add it to the project and hotload it into the REPL.

David Reno14:11:45

@U05254DQM, I must not have it added, I can run it but get some error messages at the bottom of my console. I’ll keep it in mind for the future, for now, I need to keep going without getting too stuck on the myriad of cool things I can do. Thanks for the suggestion!


@UBMFBEWKY its optional package in the Clojure layer for Spacemacs. If you do decide to try it, add the following variable to the clojure layer in .spacemacs, rather than just the word clojure

(clojure :variables
          clojure-enable-clj-refactor t)

David Reno15:11:09

does that go in .emacs.d/layers/+lang/clojure/config.el or just the spacemacs dotfile? Anywhere in particular in the dotfile?

David Reno15:11:39

trying here…

David Reno15:11:57

that didn’t seem to work. Restarted spacemacs but still get the error messages.


the screenshot of the edit is in the right location, however you should remove the line with just the word clojure, otherwise I assume it ignores the line with clojure and the variable. I do recommend restarting Spacemacs after saving this change, although you can probably just do SPC f e R to reload the config.


Btw, we’ve killed the hotloading feature in the latest clj-refactor, as it wasn’t playing well with Java 9+.


ah, interesting. Good to know.


Now this can be done easily without clj-refactor, though -


You just need to be using a newer version of nREPL that supports this.


any word on a new lein version with the new nrepl? that's still a blocker yes? it would be nice if someone at the conj could be persuaded to cut a new release

David Reno18:11:08

I have java10 installed which apparently doesn’t have javax.xml.bind.DatatypeConverter, so I’m still getting the error message trying to use clj-add-project-dependency.


@UBMFBEWKY I suggest sticking with Java 8 for Clojure in general. Although Clojure and most libraries will work there are several little gotchas with newer versions of Java. Once Java 11 is more established, then I would consider moving over. I would also recommend openjdk from rather than the version from Oracle (which adds a few proprietary things on top of openjdk)

👍 4