Fork me on GitHub
#cider
<
2022-02-16
>
Sampo Toiva20:02:44

Hi, I have a weird problem. I've been testing clojure-cli and I'm trying various different tooling. Currently, I'm testing portal and I've set up a simple test project for that. My personal deps.edn contains an alias: :portal {:extra-deps {djblue/portal {:mvn/version "0.21.0"}}} I've added to the projects .dir-locals.edn the following config:

((clojure-mode . ((cider-preferred-build-tool . clojure-cli)
                  (cider-clojure-cli-aliases . "portal"))))
When I run cider-jack-in-clj the command that is executed is the following;
/opt/homebrew/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.9.0"} refactor-nrepl/refactor-nrepl {:mvn/version "3.1.0"} cider/cider-nrepl {:mvn/version "0.27.4"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}}}' -M:portal:cider/nrepl
That will open a REPL buffer, but the classpath won't contain the portal dependencies and things like (require 'portal.api) will fail with FileNotFoundException. However, if I start the nREPL server from command line with the exact same command as above and just connect to it with cider-connect, everything works just fine. Can someone shed some light on what is happening and how to debug this further?

1
vemv20:02:32

What exact CIDER version are you using? Could it have to do with https://github.com/clojure-emacs/cider/pull/3127/files ? cc @U05254DQM

Sampo Toiva20:02:06

Might be. Cider version is 1.2.0 . The default that comes from doom-emacs.

Sampo Toiva20:02:18

Maybe, I should look into upgrading...

Sampo Toiva20:02:17

@U45T93RA6 unpinning and upgrading cider to newest version fixed things.

cider 1
vemv20:02:06

Cheers! your refactor-nrepl is also somewhat outdated

vemv20:02:36

Wondering if I should start creating PRs against doom or spacemacs whenever we cut releases, not sure of how those distros work

Sampo Toiva21:02:38

Humm, actually, now cider stopped injecting refactor-nrepl altogether.

Sampo Toiva21:02:19

Let's see what else I need to upgrade 😄

Sampo Toiva21:02:41

Yeah, now everything works. Upgrading helped there also. @U45T93RA6 yeah, doom-emacs pins to specific versions of packages to achieve some stableness in the package ecosystem and reproducibility to the configs. I think that's a good thing in general, but in some cases a bit more speed in the upgrades might be needed. Luckily, one can just opt out of the pinning case-by-case and speed things up. But in general, I guess doom welcomes PR's for upgrading packages - especially for critical upgrades and bugfixes. The clojure relevant package management is here: https://github.com/hlissner/doom-emacs/blob/master/modules/lang/clojure/packages.el

vemv21:02:59

thanks! Is refactor-nrepl being injected now? Without upgrading clj-refactor.el I don't expect it to work, see https://github.com/clojure-emacs/clj-refactor.el/blob/master/CHANGELOG.md#333

Sampo Toiva21:02:30

Yeah, thanks for help! Everything is working now. I decided to unpin everything in the clojure module to keep everything in sync since basically most of the stuff there is a dependency to cider.

cider 1
practicalli-johnny05:02:24

FYI @U45T93RA6 - Spacemacs uses packages from https://melpa.org/ by default, so no need for a PR on the Spacemacs repository to update Cider. It only requires the user to run a package update, which checks for new versions. So the user can upgrade when required

👍 1
🙏 1
practicalli-johnny05:02:00

@UFG0HRDC7 all aliases are keywords, so :portal should be used in the .dir-locals.el file, rather than portal. I believe Cider will still work if only using the name and not the keywords, but technically (and for clarity) the keyword should be used.

Sampo Toiva06:02:55

@U05254DQM thanks, I actually changed it to that after upgrading and checking the newest documentation. With older cider it didn't work.