practicalli

Marc Andreu Fernandez 2023-03-11T12:00:53.517149Z

Hello John, I hope you are doing well. First of all, many thanks for your online content; it really helps to study :-) Excuse me if this is not the right channel to ask about my issue. I'm just asking here because I have a problem with one of your github repositories. I did fork and clone your repository https://github.com/practicalli/four-clojure . I wanted to start experimenting with the 4clojure exercise within the REPL. That is a very useful idea to really practice and learn. I have just forked and opened one of the Clojure exercies and tried to connect the cider-jack-in-clj. I have got this error: "error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Execution error (FileNotFoundException) at http://java.io.FileInputStream/open0 (FileInputStream.java:-2). -Sdeps (No such file or directory)". I have read those Github issues https://github.com/clojure-emacs/cider/issues/2916, https://github.com/clojure-emacs/cider/issues/2922 and https://github.com/clojure-emacs/cider/issues/2941 . As I am new to Clojure and Spacemacs I did not find a solution to this problem. I see that have long passed since all those issues and things might have evolved. In one issue, you also commented, "I am no longer using cider-jack-in with Clojure CLI tools so will close this issue" and I am even more confused about how to run the exercises :-) What do you recommend me to do to be able to run the clojure code of your repo in a REPL. What would be the correct way to fix the repo, my configuration, java version, etc.? I have attached screenshots of the issue and my clojure environment. Many thanks in advance; any tip would be indeed appreciated. 🙂

practicalli-johnny 2023-03-11T13:21:22.860669Z

First though is that its the alias in the .dir-locals.el file. The cider-clojure-cli-global-options variable is depreated and it should be cider-clojure-cli-aliases Using the older variable may be breaking the cider-jack-in command. I will push an update to the repository to fix the .dir-locals.el

practicalli-johnny 2023-03-11T13:22:41.949659Z

For reference, there is more information about configuration Cider for a project here: https://practical.li/spacemacs/clojure-development/project-configuration/

practicalli-johnny 2023-03-11T13:24:19.542539Z

EDIT: not needed, I've reproduced the issue Can you share the command that the Cider is using when calling cider-jack-in. The command will be in the *messages* buffer (`SPC b m` in Spacemacs)

practicalli-johnny 2023-03-11T13:25:00.434739Z

Or use SPC u before the cider jack-in command to see the full command line before executing it (it can also be edited)

practicalli-johnny 2023-03-11T13:45:15.147859Z

I can confirm that its the old cider variable name in the .dir-locals.el file that is causing the issue. I have pushed a couple of commits that update the cider variable and the alias name. Or you could delete the .dir-locals.el file as it is not needed for this specific project The :env/testalias included in .dir-locals.el is from the https://practical.li/clojure/clojure-cli/practicalli-config/, so if that is not installed then there will be a warning about the alias not found, although this warning can be ignored as I didnt write any unit tests in the 4clojure project. Te :env/test alias adds test directory as an :extra-paths so cider test runner can find code under the test directory (but in this case no such code exists)

practicalli-johnny 2023-03-11T13:50:42.958129Z

For simple and very standard projects, then cider-jack-in is a convenient way to start a REPL process from Emacs I often use a https://practical.li/clojure/clojure-cli/repl-reloaded/ with commercial projects so start the REPL process from the command line and include a number of supporting tools. This also means the REPL keeps running if I shut down the editor (or I want to use a different editor) This approach is something that is not required when first learning with Clojure though

practicalli-johnny 2023-03-11T14:08:40.260889Z

I've added notes to the issue discussions included in the question to inform that cider-clojure-cli-aliases variable is the correct way to add aliases to cider-jack-in. If you have any more issues or questions about Practicalli content and examples, dont hesitate to ask (there are no silly questions)

Marc Andreu Fernandez 2023-03-14T01:43:08.197939Z

I, John, your fix worked perfectly. Many thanks 🙂

👍 1
Marc Andreu Fernandez 2023-03-13T03:35:33.698499Z

Wow, many thanks, John. It is a pleasure learning Clojure with your content and help. I will reply later when I have tried your fix. Many thanks 🙂

practicalli-johnny 2023-03-13T06:15:35.279229Z

I found a few other projects with the older variable, so your inquiry has helped me fix those too. Thank you.

🙌 1