Fork me on GitHub
#cider
<
2019-01-13
>
dottedmag09:01:28

I have trouble running a remote REPL session via Tramp.

dottedmag09:01:00

Recent CIDER gives the following error, and it is caused by some weird escaping:

[nREPL] Starting server via clojure -A:cider -Sdeps '{:deps {nrepl {:mvn/version "0.5.3"} org.clojure/tools.nrepl {:mvn/version "0.2.13"} refactor-nrepl {:mvn/version "2.4.0"} cider/cider-nrepl {:mvn/version "0.20.0-SNAPSHOT"}}}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"])'...
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Exception in thread "main" clojure.lang.ArityException: Wrong number of args (2) passed to: cider-nrepl.main/init
	at clojure.lang.AFn.throwArity(AFn.java:429)
	at clojure.lang.AFn.invoke(AFn.java:36)
	at user$eval1154.invokeStatic(NO_SOURCE_FILE:1)
	at user$eval1154.invoke(NO_SOURCE_FILE:1)
	at clojure.lang.Compiler.eval(Compiler.java:7176)
	at clojure.lang.Compiler.eval(Compiler.java:7131)
	at clojure.core$eval.invokeStatic(core.clj:3214)
	at clojure.main$eval_opt.invokeStatic(main.clj:465)
	at clojure.main$eval_opt.invoke(main.clj:459)
	at clojure.main$initialize.invokeStatic(main.clj:485)
	at clojure.main$null_opt.invokeStatic(main.clj:519)
	at clojure.main$null_opt.invoke(main.clj:516)
	at clojure.main$main.invokeStatic(main.clj:598)
	at clojure.main$main.doInvoke(main.clj:561)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.lang.Var.applyTo(Var.java:705)
	at clojure.main.main(main.java:37)

dottedmag09:01:38

The command line at the remote host is the following: bash /home/dottedmag/bin/clojure -A:cider -Sdeps {:deps {nrepl {:mvn/version "0.5.3"} org.clojure/tools.nrepl {:mvn/version "0.2.13"} refactor-nrepl {:mvn/version "2.4.0"} cider/cider-nrepl {:mvn/version "0.20.0-SNAPSHOT"}}} -e (require (quote cider-nrepl.main)) (cider-nrepl.main/init \ ["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"]) — note the \ in cider-nrepl.main/init

dottedmag09:01:12

Before I upgraded there was another \ added, before second middleware in the list of middleware passed to init, and it produced different error message.

bozhidar11:01:09

@dottedmag Recent CIDER versions don’t use cider-nrepl.main/init at all. They directly delegate the init to nREPL.

dominicm18:01:06

Should I be doing this in vim?

dottedmag11:01:01

@bozhidar Thanks, apparently I had old CIDER loaded even after el-get-upgrade, restart of Emacs fixed it.

dottedmag11:01:15

@bozhidar Is there a non-hackish way to set an environment variable for a remote clojure instance?

dottedmag12:01:23

Nevermind. I only need to set it for a .so I'm loading, so I can as well do (jna/invoke Void c/setenv "WHATEVER" "i need"), as I'm going to use JNA for invoking native code anyway.