Fork me on GitHub
#cider
<
2021-05-25
>
quoll20:05:46

Recently, I’ve been using Emacs and Cider a bit more, so I’ve been wondering about clearing a warning that I get when I try cider-jack-in for a leiningen project, and allow cider to start leiningen: > WARNING: CIDER requires cider-nrepl to be fully functional. Some features will not be available without it! (https://docs.cider.mx/cider/1.1/troubleshooting.html#cider-complains-of-the-cider-nrepl-version) Note, I don’t know much about either emacs, or Cider. Emacs has Cider 1.1.1 installed. The “More information” link is for the troubleshooting subsection: CIDER complains of the `cider-nrepl` version. This is a similar, though different, warning. But assuming that it’s about right, then I’m thinking that the subsection I’m interested in is: > https://docs.cider.mx/cider/1.1/troubleshooting.html#you-see-not-installed-or-nil-and-youre-starting-the-repl-with-cider-jack-in You see `not installed` or `nil`, and you’re starting the REPL with `cider-jack-in` • cider-inject-dependencies-at-jack-in is set to t • My project uses Clojure 1.10.3 • Leiningen is 2.9.6 There is also the suggestion of configuring cider-nrepl myself (my understanding was that this should be brought in automatically though, is that right?). Anyway, I added into my :plugins section:

:plugins [[cider/cider-nrepl "0.26.0"]]
However, I continue to get the warning. Does anyone have a suggestion of where I can learn enough to address this please?

dpsutton21:05:07

@quoll at the start of the repl should be a startup form. can you paste that here (love your work by the way)

quoll21:05:43

;;  Startup: /usr/local/bin/lein update-in :dependencies conj \[nrepl/nrepl\ \"0.8.3\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.26.0\"\] -- repl :headless :host localhost
… and thank you 🙂

dpsutton21:05:17

can you see what (apropos "cider") returns?

dpsutton21:05:50

identifying the source of the error: either it's correctly not seeing cider-nrepl or it's incorrectly saying cider-nrepl is not available when it is available

dpsutton21:05:33

(any chance you have a locally installed version of cider-nrepl? ie, lein install from a local copy of it?)

quoll21:05:19

I doubt it, but if I did it would have been from years ago

quoll21:05:52

what would I be looking for?

quoll21:05:03

BTW, the result of the apropos was: ()

dpsutton21:05:29

ok so it seems like cider-nrepl is not around. if you copy that startup script, run it from a terminal, can you try to cider-connect to it and see if you get the same warning?

quoll21:05:40

It took a while because after updating to Cider 1.1.1 (I was on an older one until 30 minutes ago), my cider repl no longer includes clojure.core nor clojure.repl. Very annoying, but I can work around it

dpsutton21:05:01

here i used that same startup command (without the headless and host part) and checked if cider was around

dpsutton21:05:45

what do you mean it no longer includes clojure.core nor clojure.repl?

dpsutton21:05:04

like evaluating (defn foo []) reports an error that defn is undefined?

quoll21:05:15

OK… after connecting I get the same warning

dpsutton21:05:41

ok. that part sounds like you did (in-ns 'some-namespace-not-required-yet) but not positive

quoll21:05:16

After the cider-connect I have access to clojure.core

dpsutton21:05:17

any chance you have a profiles.clj file in your lein directory in your home dir?

quoll21:05:33

yes, I do

dpsutton21:05:50

does it have some old junk laying around, maybe a conflicting version of cider-nrepl?

quoll21:05:20

no… but I just realized that I have :implicit-middleware false

dpsutton21:05:08

that sounds ... like a likely culprit but i've never heard of it before lol

quoll21:05:19

I removed it and it worked! Yay!

dpsutton21:05:35

if you restore it and add the plugin directly into your project.clj i suspect it will work?

quoll21:05:48

I put it in blindly a long time ago when some other package wanted it for some reason

dpsutton21:05:52

not sure where you security preferences are now if you want that enabled, but if so, i bet you can get around it

dpsutton21:05:02

awesome. well sounds like that feature works 🙂

dpsutton21:05:16

congrats on your strange loop talk!

quoll21:05:26

When it was in I was explicitly include cider-nrepl and that wasn’t helping

dpsutton21:05:37

yeah that's a bit strange to me

quoll21:05:49

Thank you. I’m only panicking a bit so far

dpsutton21:05:01

i wonder if there's a bug when you "implicitly" include a plugin if it denies that plugin from being used, even if you directly depend on it as well

dpsutton21:05:27

your last talk on graph databases went really well so i'm sure you'll do really well again 🙂

quoll21:05:37

I don’t know. I can’t tell you which package suggested that I configure this too

quoll21:05:49

Oh, the :clojureD talk?

dpsutton21:05:08

yeah. i built a repl history that would collect all forms and throw them into asami with your help

dpsutton21:05:22

so you could query for all history that used a particular form, etc

quoll21:05:25

oh, cool 🙂

dpsutton21:05:34

you did all the heavy lifting 🙂

quoll21:05:46

I’m finding Asami is helping me with lots of things now 🙂

quoll21:05:06

Someone wanted to load a pcap file (packet capture) in JSON format, but his edn was failing due to some attributes having spaces in them. I’ve removed data checking now, so you can just load raw JSON if you want. So then I could do queries to find all the attributes, and filter them (in the query) by regex to give me the ones with spaces.

quoll21:05:43

Maybe it’s because I’m used to graph thinking now, but I found it much easier to query the data than to process seq of maps that were embedded to arbitrary depth!

quoll21:05:20

It feels icky to have string attributes, but… hey, it works! 🙂

dpsutton21:05:40

yeah. at some point you need a proper query. sounds really cool

quoll21:05:47

(require '[asami.core :as d])
(require '[cheshire.core :as json])
(def conn (d/connect "asami:"))
(def tx @(s/transact conn {:tx-data (json/parse-string (slurp "/path/to/file.json"))}))

(d/q '[:find (count ?a) . :where [?e ?a ?v]] conn)
(d/q '[:find [?a ...] :where [?e ?a ?v] [(re-find #" " ?a)]] conn)

quoll21:05:11

Those last 2 queries told me how many attributes were in his json, and which ones had strings with spaces in them

dpsutton21:05:02

i had need of a triple store in cljs recently. a really simple no-logic-engine, just assert triples and missed having something like this around

quoll21:05:25

my colleagues were constantly creating convenience functions that accepted connections and called d/db on it before sending it to the query. So now queries accept connections and do that step implicitly

quoll21:05:39

Well, it’s free. 🙂

quoll21:05:55

And if anything goes wrong, I know a woman who can help

🎉 1
quoll21:05:59

I think I discovered why I couldn’t access clojure.core a few minutes ago

quoll21:05:54

I think I used C-c M-n M-n to set the namespace in my repl, but I had not used C-c C-k to load it

dpsutton21:05:03

which does an in-ns before require

dpsutton21:05:11

my muscle memory got used that one quit

quoll21:05:35

Thank you for all the help. I’d just have been as stuck as ever

dpsutton21:05:06

absolutely my pleasure

quoll21:05:36

Thank you so much for the help!