Fork me on GitHub
#cider
<
2021-12-13
>
eggsyntax17:12:42

Has anyone else run into a problem where adding a `.dir-locals.el` with tools.deps aliases results in cider-jack-in failing to create a REPL window, and instead dropping the prompt into the `*nrepl-server <project>*` namespace that typically just holds the repl startup logging? Here's the `.dir-locals.el` that's causing the problem (created with `M-x add-dir-local-variable`, so presumably syntactically valid):

((clojure-mode . ((cider-clojure-cli-global-options . "-M:logging:repl"))))

dpsutton17:12:41

can you see what the full startup command looks like? My guess is that no nrepl server is getting started so its just a regular repl and CIDER has no idea what to do with it

eggsyntax17:12:56

For sure! It's

/usr/local/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"} refactor-nrepl {:mvn/version "2.5.1"} cider/cider-nrepl {:mvn/version "0.25.5"}}}' -M:logging:repl -m nrepl.cmdline --middleware '["refactor-nrepl.middleware/wrap-refactor","cider.nrepl/cider-middleware"]'

eggsyntax17:12:18

The odd thing is that if I just move the deps in those aliases to the main dependencies and remove .dir-locals.el, cider-jack-in starts up as expected. The project has recently been switched from mount to integrant, and my guess is something about that is what's throwing it off.

dpsutton17:12:37

that looks really weird. you’re on an older CIDER?

dpsutton17:12:13

do either of the deps logging or repl have main args in your deps.edn?

eggsyntax17:12:14

1.0.0, so not too old.

eggsyntax17:12:50

It does, repl is

:repl
  {:extra-paths ["dev"]
   :extra-deps {com.bhauman/rebel-readline  {:mvn/version "0.1.4"}
                integrant/repl              {:mvn/version "0.3.2"}}
   :main-opts  ["-m" "user"]}

dpsutton17:12:03

my guess is one of those has main args and the -m nrepl.cmdline ---middleware ... is actually being passed as main args to another main args

dpsutton17:12:22

yup. :repl gives main args. So you are starting up as -m user -m nrepl.cmdline ...

dpsutton17:12:35

newer cider works around this

eggsyntax17:12:40

Ohhhh, that would make sense.

eggsyntax18:12:08

Cool, thanks lots, I'll update cider. 🙏

dpsutton18:12:16

if you want to not upgrade, you can put your main args for CIDER into an alias and ensure that alias comes last

dpsutton18:12:26

which is what the change in CIDER that you need does

eggsyntax18:12:56

No, no reason not to update -- I'm just a slow updater for everything emacs related since I'm on spacemacs and updates result in breakage a bit more often than I'd like 😜

👍 1
eggsyntax18:12:30

> if you want to not upgrade, you can put your main args for CIDER into an alias and ensure that alias comes last Just in case, though -- that would be about creating an alias containing :main-opts ["-m" "nrepl.cmdline"]?

eggsyntax18:12:28

Never mind, just confirmed that for myself 🙂

eggsyntax18:12:34

Thanks again!

👍 1