Fork me on GitHub
#cider
<
2019-01-02
>
slipset10:01:25

Bah! Did the stupidest thing. Upgraded emacs, lein, and cider at the same time, and now my env is not working šŸ˜•

slipset10:01:40

I can jack in, but I get:

slipset10:01:43

[nREPL] Starting server via /usr/local/bin/lein update-in :dependencies conj \[acyclic/squiggly-clojure\ \"0.1.9-SNAPSHOT\"\ \:exclusions\ \[org.clojure/tools.reader\]\] -- update-in :dependencies conj \[nrepl\ \"0.5.3\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.4.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.19.0\"\] -- repl :headless :host localhost...
[nREPL] server started on 51819
[nREPL] Establishing direct connection to localhost:51819 ...
[nREPL] Direct connection to localhost:51819 established
error in process filter: nrepl-send-sync-request: Sync nREPL request timed out (op version prefix-rewriting false debug false)
error in process filter: Sync nREPL request timed out (op version prefix-rewriting false debug false)

slipset10:01:21

I get a cider buffer, but it hangs when trying to eval anything in it šŸ˜•

slipset10:01:46

Ah šŸ™‚

slipset10:01:36

my *nrepl-server ...* buffer says:

slipset11:01:34

Yup, I was starting to get to there. Our project included org.clojure/nrepl

bozhidar11:01:35

Seems some of your deps messed up the server version resolution.

bozhidar11:01:50

Ah, I figured as much.

bozhidar11:01:17

Iā€™ve started today to delete the support for tools.nrepl completely, so down the road people wonā€™t see such weird errors.

slipset11:01:19

So I might be on the good path now. Just need to get my setup back to where it was before I started debugging šŸ™‚

bozhidar11:01:34

Going forward if youā€™re not on the right nREPL it simply wonā€™t work at all.

bozhidar11:01:38

> So I might be on the good path now. Just need to get my setup back to where it was before I started debugging šŸ™‚

bozhidar11:01:57

That should fairly easy - once you eliminate the rogue deps everything will work just fine.

slipset11:01:15

Yup seems like I just need to change the coords for the nrepl deps in our project

slipset11:01:03

Thanks for helping, and a very happy new year to you!

bozhidar11:01:44

Thanks! :man-bowing:

andrea.crotti14:01:55

I'm still trying to make cider run something when the clojure repl has loaded, and something like this

(defun start-finops-admin ()
         (interactive)
         (cider-jack-in-clj&cljs)
         (cider-switch-to-repl-buffer)
         (insert "(go)")
         (newline))

andrea.crotti14:01:09

could work in theory , but of course it doesn't find the repl buffer at that point

andrea.crotti14:01:30

could maybe sleep for a bit but is there a way to wait for that buffer to be ready?

bozhidar15:01:29

@andrea.crotti Did you try using cider-connected-hook?

bozhidar15:01:05

Generally thatā€™s the way to go.

bozhidar15:01:26

Thereā€™s also the more low-level nrepl-connected-hook

genmeblog15:01:00

could this be caused by the fact that I work under Cygwin?

dpsutton15:01:31

CIDER development now (0.20-snapshot) requires lein 2.8.3 minimum for leiningen projects, correct? It cannot work with 2.7.1 or 2.8.1 correct?

bozhidar15:01:40

Just committed the changes dropping the support for nREPL 0.2.

andrea.crotti15:01:41

ah ok cool @bozhidar, but can I use set it locally on a project? This variable may be risky if used as a file-local variable. ?

bozhidar15:01:27

If you want to use an older lein thereā€™s always https://github.com/nrepl/lein-nrepl

dpsutton15:01:15

i'm stuck on lein 2.7.1 for work so i need to figure a way out

dpsutton15:01:09

we use a plugin called slothconfig that provides the project.clj map to the application at runtime. We've been wanting to get away from it but its just always at the bottom of the priority heap

dpsutton15:01:28

last commit 6 years ago šŸ™‚

bozhidar15:01:52

Got it. That shouldnā€™t be something hard to solve I guess.

bozhidar15:01:17

Iā€™m not sure whether lein-nrepl will work with 2.7.1, but I assume it does.

bozhidar15:01:38

Youā€™ll just have to tweak your jack-in config or switch to using cider-connect.

dpsutton15:01:00

cider connect will probably be the way to go. thanks

dpsutton15:01:02

@bozhidar I'm not seeing a release for lein-nrepl "0.3.2". any chance you could cut one when you have time? That's the version in the readme > Put [nrepl/lein-nrepl "0.3.2"] into the :plugins vector of your :user profile.

Could not find artifact nrepl:lein-nrepl:jar:0.3.2 in central ()
Could not find artifact nrepl:lein-nrepl:jar:0.3.2 in clojars ()

andrea.crotti16:01:44

anyway @bozhidar your suggestion seems to work, only problem is that it then runs on on both repls, while it should only run on the clojure one

bozhidar16:01:04

Just add some check in your function (if (eq cider-repl-type 'clj) ...

andrea.crotti17:01:08

nice it works thanks @bozhidar (I did (equal cider-repl-type "clj") instead but that's it

andrea.crotti17:01:27

btw is there a way to kill automatically both repls? cider-quit only kills the clojure one

bozhidar17:01:23

> nice it works thanks @bozhidar (I did (equal cider-repl-type "clj") instead but thatā€™s it

bozhidar17:01:41

I guess youā€™re on some older version - it the most recent one the type is supposed to be a symbol.

genmeblog19:01:27

I'll try third time šŸ™‚ What about Unix paths vs Windows paths under Cygwin? Previously cider-to-nrepl-filename-function was used in such occasions. But now sesman-friendly-session-p ignores that combination and expects that Emacs and nRepl operate on the same path styles.

bozhidar19:01:39

Havenā€™t had time to look into this.

bozhidar19:01:58

Unfortunately Iā€™m not very familiar with Cygwin and Windows.

bozhidar19:01:25

Iā€™d just suggest using Edebug and stepping though the problematic code to see where exactly the problem is coming from.

genmeblog19:01:33

I did it. And this is the case. Emacs and Cygwin are using unix-like paths ie. /home/user/file etc. JVM and nrepl are using Windows paths. So exactly this line fails https://github.com/clojure-emacs/cider/blob/master/cider-connection.el#L438 because of that

genmeblog19:01:25

file-name-directory expects unix-like-path but classpath is filled by Windows paths

genmeblog19:01:50

in previous versions of Cider cider-to-nrepl-filename-function was the solution. It wraps cygwin-convert-file-name-to-windows which is native Cygwin' Emacs function

genmeblog20:01:29

The same problem can be observed when repl is run on linux and emacs connects from Windows. I believe that making simple proxy which converts one style into another between nrepl and cider can solve the problem globally.

aaelony21:01:43

Iā€™m using emacs 26.1 and wanting to try out the new cider version. Even though Iā€™ve added melpa-stable, M-x package-install <ret> cider <ret> refuses to work. It wants me to choose cider-eval-sexp-fu or cider-hydraā€¦

dpsutton21:01:13

what do you mean wants you to choose between those?

aaelony21:01:54

I mean that <ret> does not start installing and it inserts a hypen indicating the command is unfinished

aaelony21:01:05

hitting <tab> after it has inserted the hyphen shows:

Click on a completion to select it.
In this buffer, type RET to select the completion near point.

Possible completions are:
cider-eval-sexp-fu
cider-hydra 

dpsutton21:01:29

ah. try m-x list-packages and search for CIDER

aaelony21:01:47

perhaps I need to remove my existing cider firstā€¦

aaelony21:01:58

The only CIDER I see is:

cider              20180717.553  installed             Clojure Interactive Development Environment that Rocks

dpsutton21:01:03

ah yes that would probably do it. it won't offer to install an already installed package

aaelony21:01:04

which looks too old

aaelony21:01:37

hmmm.. it needs the ā€œsesmanā€ package as well. Installed that separately but still problemsā€¦

Cannot open load file: No such file or directory, sesman-browser 

aaelony21:01:39

C-c M-j did not work to start the repl, but ā€œcider-jack-inā€ did

genmeblog21:01:48

why not use package-list-packages and press U then x

aaelony21:01:16

didnā€™t work