Fork me on GitHub
#cider
<
2023-07-30
>
heyarne09:07:27

i have an issue with one project i'm working on; when evaluating a certain form, cider just crashes without raising an error. All it prints is *** Closed on Sun Jul 30 11:15:13 2023 *** . I can execute the namespace with clojure -m …; any idea how I could figure out what's wrong, or get cider to be a bit more talkative about it?

heyarne09:07:03

The *messages* buffer contains [nREPL] Connection closed unexpectedly (connection broken by remote peer)

vemv11:07:56

I'd recommend to start your JVM/cider-nrepl process in your terminal, and then cider-connect to it. That way, if it crashes, you should see a stacktrace or other debug info

heyarne11:07:09

Hm… it doesn't happen when I start it in a terminal

heyarne11:07:32

Maybe my emacs session is lacking some env vars

vemv11:07:04

JVM flags related to memory perhaps?

heyarne11:07:43

No, nothing like that… odd

practicalli-johnny12:07:05

Perhaps something in a .dir-locals.el file (if that file exists in the root of the Clojure project) Or on a custom user.clj file if added to the path (possibly by the .dir-locals.el)

heyarne13:07:06

No, nothing like that. I assumed it's some weird dynamic library issue related to nix / direnv, but I can't find anything in that direction

practicalli-johnny13:07:56

Its pretty hard to make the connection go bang, so it seems likely that the REPL process is trying to do something that Nix wont let it do... this would be my guess.

dpsutton17:07:44

do any of the codepaths have any System/exit 0 type forms? Code can make the jvm exit and you see the messages you are seeing

aisamu19:07:38

> Hm… it doesn’t happen when I start it in a terminal > No, nothing like that. I assumed it’s some weird dynamic library issue related to nix / direnv, but I can’t find anything in that direction You can check exactly what command jack-in used to start the REPL (either messages or at the start of the repl buffer, I can’t recall), and then manually run that in the terminal (I use nix and direnv, so I know it can work)

heyarne19:07:27

That's what I did, I copied the command that's printed at the beginning of the repl section

aisamu19:07:23

Oh! Sometimes I have to actively invoke envrc-allow/envrc-reload-all to make cider pick up the right environment (and apparently not from a magit buffer, for whatever reason)! I use (executable-find "clojure") (or anything else project-defined) to make sure it matches what I get from a regular terminal session

heyarne20:07:13

soooo when setting DISPLAY = ":0" I get a stacktrace at least 🙂 the issue arises when using quil (a wrapper for processing), so I think I'm headed in the right direction

heyarne20:07:39

The env vars weren't identical, I overlooked that for some reason

heyarne20:07:59

Thanks to everybody who came to help me out! Very appreciated. Hope you have / had a great weekend

🎉 4