Fork me on GitHub
#cider
<
2019-01-08
>
fenton01:01:59

is there a way to cider-jack-in, have the repl show up visibly, but not transfer control to it?

iwannaseethelight05:01:02

Hey folks, I’m on the latest cider and am having an issue that’s really got me stuck, I filed a bug here: https://github.com/clojure-emacs/cider/issues/2562

iwannaseethelight05:01:26

This may not be a bug, I’m not sure, but it’s got me totally dead in the water at work, any help would be greatly appreciated!

iwannaseethelight05:01:00

The high level issue is that when importing LWJGL libraries, company-mode hangs for nearly 15 seconds with every key press. Thanks in advance!

dpsutton05:01:57

I'm trying to reproduce but is this not sufficient?

(defproject stuff/compliment-bug "0.1.1"
  :dependencies [[org.lwjgl/lwjgl "3.2.1"]])

dpsutton05:01:13

user> (import '(org.lwjgl.glfw.GLFW))
nil
[LWJGL] Failed to load a library. Possible solutions:
	a) Add the directory that contains the shared library to -Djava.library.path or -Dorg.lwjgl.librarypath.
	b) Add the JAR that contains the shared library to the classpath.
[LWJGL] Enable debug mode with -Dorg.lwjgl.util.Debug=true for better diagnostics.
[LWJGL] Enable the SharedLibraryLoader debug mode with -Dorg.lwjgl.util.DebugLoader=true for better diagnostics.
ERROR:ERROR:  Unhandled REPL handler exception processing message Unhandled REPL handler exception processing message {{:op :op infoeldoc, , :ns user, :ns user, :symbol org.lwjgl.PointerBuffer, :session 0a8a510f-85da-40ce-b140-41ada4dca843, :id 33}

dpsutton05:01:40

is it possible its silently in a broken state?

iwannaseethelight06:01:31

You may need to load the native library with it - my project.clj looks like this:

iwannaseethelight06:01:06

The company-mode popup eventually populates, but it literally is taking 15-20 seconds on my brand new MBP

iwannaseethelight06:01:11

after each character press

bozhidar06:01:39

The timeout you get likely masks some internal error, which is the real cause of the delay.

bozhidar07:01:03

At any rate - it’s probably best to have @alexyakushev take a look in this.

manuel07:01:09

hi guys, with latest CIDER evaluating a form in the REPL results in this:

Debugger entered--Lisp error: (wrong-type-argument symbolp "right-margin")
  symbol-name("right-margin")
  cider--pprint-option("right-margin" pprint)
  cider--nrepl-pprint-request-plist(80 nil)
  cider--repl-request-plist(80)
  cider-repl--send-input(t)
  cider-repl-return(nil)
  funcall-interactively(cider-repl-return nil)
  call-interactively(cider-repl-return nil nil)
  command-execute(cider-repl-return)

bozhidar07:01:53

I’ll fix it now.

bozhidar07:01:41

@manuel Fix away!

manuel07:01:53

fantastic, thanks

iwannaseethelight08:01:58

Hey @bozhidar, should I pass the issue on to @alexyakushev then? It’s worth mentioning that this only seems to happen with the LWJGL library, the regular Java system libraries pop up immediately. I’ve also attached the log you requested to the issue on Github.

bozhidar08:01:02

I’ve noticed in the log you sent that there are some errors about a dynlib failing to load, etc. It also seems that the errors happen in the eldoc logic, not in compliment.

manuel09:01:12

@bozhidar noticed you also added support for zprint. Great stuff! 🙂

bozhidar09:01:16

I’ve been working on nothing but pretty-printing recently. I thought that it was going to be simple to revamp the pprint implementation, but it was so much more complex than I thought. I guess this never happens in programming. 😄

bozhidar09:01:31

Anyways - seems I’m almost done with the first pass and maybe I’ll cut CIDER 0.20 in a couple of days with only the pprint changes.

manuel09:01:29

yay! Count me in for early-bird installation and complaints! 😉

bozhidar09:01:28

:man-bowing:

manuel10:01:47

@bozhidar just FYI: latest update fixed the error for me, and it seems to work fine with zprint too.

bozhidar10:01:42

Excellent! Thanks for the update.

macroz11:01:36

uh for a long while I tried to upgrade to latest cider 0.16-snapshot -> 0.19 but I'm really baffled now. Emacs cider from melpa seems to use 0.20.0-snapshot and with that I get an error in cider-jack-in-clojurescript error in process filter: user-error: ‘exit-minibuffer’ requires the nREPL op "classpath" (provided by cider-nrepl) error in process filter: ‘exit-minibuffer’ requires the nREPL op "classpath" (provided by cider-nrepl)

macroz11:01:50

same time I also tried to move from emacs 24 to emacs 26

macroz11:01:04

also tried clearing some customizations I had

macroz11:01:32

since the installation instructions don't have anything special and I don't think I have anything special anymore I'm really baffled at what the problem could be

macroz11:01:59

I guess my last ditch effort will be to start with a completely new ubuntu and .emacs

macroz11:01:29

repl also says after starting that WARNING: CIDER requires nREPL 0.4.4 (or newer) to work properly More information. WARNING: CIDER requires cider-nrepl to be fully functional. Many things will not work without it! More information.

macroz11:01:00

here's what it runs [nREPL] Starting server via .../bin/lein update-in :dependencies conj \[nrepl\ \"0.5.3\"\] -- update-in :dependencies conj \[cider/piggieback\ \"0.3.10\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.20.0-SNAPSHOT\"\] -- repl :headless :host localhost...

macroz11:01:31

;; Connected to nREPL server - <nrepl://localhost:34432> ;; CIDER 0.20.0snapshot (package: 20190108.925), nREPL 0.2.12

macroz11:01:09

0.5.3 yes but 0.2.12 ???

macroz11:01:38

and where does that 0.20.0-SNAPSHOT come when my .lein/profiles.clj says 0.19.0

bozhidar12:01:40

You need also Lein 2.8.3.

bozhidar12:01:50

That’s going to fix the nREPL version issue.

bozhidar12:01:16

But overall you’re pretty close to setting up everything properly.

macroz12:01:21

thanks, I'm running 2.8.1 apparently

macroz12:01:46

is it normal for cider to override .lein/profiles.clj stuff?

bozhidar12:01:09

It does it to ensure that the right versions of libraries are used.

macroz12:01:26

thanks that lein upgrade helped and now I got forward

macroz12:01:32

I'll try re-enabling clj-refactor

bozhidar12:01:36

It would never touch anything except nREPL and nREPL middleware, though.

macroz12:01:43

@bozhidar I get some of these error in process filter: nrepl-send-sync-request: Sync nREPL request timed out (op classpath) error in process filter: Sync nREPL request timed out (op classpath)

macroz12:01:30

(after cider-jack-in-clojurescript)

macroz12:01:29

sometimes I get two repls, sometimes only one

macroz13:01:37

used to get two where in one I would connect to cljs-repl

bozhidar13:01:41

For the first problem - you’ll have to inspect the error closer http://www.cider.mx/en/latest/troubleshooting/#missing-nrepl-messages-buffer

bozhidar13:01:08

For the second - keep in mind that the jack-in commands were completely re-written and cider-jack-in-cljs starts just one REPL now.

bozhidar13:01:21

There’s a dedicated commands for starting two REPLs.

macroz13:01:39

cider-jack-in-clj&cljs seems to hang

bozhidar13:01:39

Please, refer to the docs for more details, as I’m just about the leave my computers.

bozhidar13:01:14

If you’ve got further issue - feel free to file them as tickets. If something hangs it’s likely outdated deps or something like this.

macroz13:01:32

I'm trying to reinstall all my packages so I get the latest

macroz13:01:08

there's a bunch of documentation that seems to be outdated and it's a bit confusing as there are also a million packages to check

macroz13:01:15

seems clojurescript-jack-in hangs emacs, clojure-jack-in works in a simple project

macroz13:01:44

completely new figwheel main project seems to jack-in but not my old figwheel

macroz13:01:42

seems like figwheel-main-template is borked too

macroz13:01:50

looks like the rabbit hole goes deeeeeeep

bozhidar14:01:35

Due to the big changes with nREPL you generally need a very recent version of fighwheel and piggieback.

bozhidar14:01:48

But yeah - it’s a very complex ecosystem with many moving parts.

macroz14:01:30

completely new vm with ubuntu 18.04, emacs 26, latest leiningen, jvm 8, lein new figwheel ..., cider from melpa and jack-in to both works

macroz15:01:24

this is where my machine hangs Debugger entered--Lisp error: (quit) accept-process-output(nil 0.01) nrepl-send-sync-request(("op" "version" "prefix-rewriting" "false" "debug" "false") #<buffer cider-repl dev/rems:localhost:36200(clj)> nil) cider-nrepl-send-sync-request(("op" "version" "prefix-rewriting" "false" "debug" "false")) cljr--call-middleware-sync(("op" "version" "prefix-rewriting" "false" "debug" "false") "version") cljr--middleware-version() cljr--check-middleware-version() cljr--init-middleware() run-hooks(cider-connected-hook) cider--connected-handler() run-hooks(nrepl-connected-hook) nrepl-start-client-process("localhost" 36200 #<process nrepl-server> #f(compiled-function (_) #<bytecode 0x1307f89>)) cider-nrepl-connect((:project-dir "/dev/rems/" :jack-in-cmd "/home/markku/bin/lein update-in :dependencies conj \\[nrepl\\ \\\"0.5.3\\\"\\] -- update-in :dependencies conj \\[cider/piggieback\\ \\\"0.3.10\\\"\\] -- update-in :plugins conj \\[refactor-nrepl\\ \\\"2.4.0\\\"\\] -- update-in :plugins conj \\[cider/cider-nrepl\\ \\\"0.20.0-SNAPSHOT\\\"\\] -- repl :headless :host localhost" :cljs-repl-type figwheel :do-prompt nil :host "localhost" :port 36200 :project-dir "/dev/rems/" :server #<process nrepl-server> :server-command "/home/markku/bin/lein update-in :dependencies conj \\[nrepl\\ \\\"0.5.3\\\"\\] -- update-in :dependencies conj \\[cider/piggieback\\ \\\"0.3.10\\\"\\] -- update-in :plugins conj \\[refactor-nrepl\\ \\\"2.4.0\\\"\\] -- update-in :plugins conj \\[cider/cider-nrepl\\ \\\"0.20.0-SNAPSHOT\\\"\\] -- repl :headless :host localhost" :repl-init-function nil :repl-type clj :session-name nil)) cider-connect-sibling-clj((:project-dir "~/dev/rems/" :jack-in-cmd "/home/markku/bin/lein update-in :dependencies conj \\[nrepl\\ \\\"0.5.3\\\"\\] -- update-in :dependencies conj \\[cider/piggieback\\ \\\"0.3.10\\\"\\] -- update-in :plugins conj \\[refactor-nrepl\\ \\\"2.4.0\\\"\\] -- update-in :plugins conj \\[cider/cider-nrepl\\ \\\"0.20.0-SNAPSHOT\\\"\\] -- repl :headless :host localhost" :cljs-repl-type figwheel :do-prompt nil) #<buffer nrepl-server dev/rems:localhost>) #f(compiled-function (server-buffer) #<bytecode 0x10b1365>)(#<buffer nrepl-server dev/rems:localhost>) nrepl-server-filter(#<process nrepl-server> "nREPL server started on port 36200 on host localhost - <nrepl://localhost:36200\n%22|nrepl://localhost:36200\n">)

macroz15:01:18

hangs with "lein new figwheel my-test -- --reagent"

macroz15:01:52

ok removing .emacs.d I get it to work

macroz15:01:21

some line in my 768 lines of .emacs does it

macroz15:01:13

ERROR: Unhandled REPL handler exception processing message {:op version, :prefix-rewriting false, :debug false, :session ff0128b7-c4be-43e4-bc91-28cc6744dec0, :id 10} java.lang.IllegalArgumentException: No implementation of method: :send of protocol: #'clojure.tools.nrepl.transport/Transport found for class: nrepl.transport.FnTransport at clojure.core$cacheprotocol_fn.invokeStatic(core_deftype.clj:583) at clojure.core$cacheprotocol_fn.invoke(core_deftype.clj:575)

macroz15:01:41

;; Connected to nREPL server - <nrepl://localhost:41629> ;; CIDER 0.20.0snapshot (package: 20190108.925), nREPL 0.5.3 ;; Clojure 1.9.0, Java 1.8.0_191

macroz16:01:43

ok so the culprit is clj-refactor

macroz16:01:44

apparently this really means 0.17 or 0.18 but not 0.19 or 0.20-SNAPSHOT

macroz16:01:20

maybe this is a known issue but now I documented it somewhere

bozhidar16:01:47

Hmm, I can’t imagine why. There have been no changes in 0.19 and 0.20 that would affect refactor-nrepl. At least nothing that comes to mind.

bozhidar16:01:57

Btw, I wrote this compatibility note myself. 🙂

bozhidar17:01:08

Unfortunately work on clj-refactor has really stagnated lately and I certainly don’t have time for it, so someone else will have to figure out what went wrong there.

macroz17:01:22

I can have a look sometime later

macroz17:01:07

do you use clj-refactor yourself?

macroz17:01:55

just wondering if it's know to work somewhere with the new cider

bozhidar21:01:03

No, I don’t use it. I help its team from time to time, but that’s all.

d.ian.b12:01:01

there is a way to put cider-repl errors in repl?

d.ian.b12:01:08

not popping into another buffer?

d.ian.b12:01:17

popping and focusing?

d.ian.b12:01:32

it breaks my dev flow x_x

bozhidar12:01:15

They are focused by default, so pressing q is all you need to do to discard them.

bozhidar12:01:47

That being said you’re not the first to ask for just dumping everything to the REPL - that’d be easy to do, provided I had time, but it’s not supported now.

weavejester21:01:38

Has anyone had issues with Lein 2.8.3 and nREPL piggieback? I haven't been able to get them to work.

bozhidar21:01:58

@weavejester What kind of issues?

weavejester21:01:38

ERROR: Unhandled REPL handler exception processing message {:id 0419f2f7-bd7e-4a06-81d2-07df38fa1dae, :op clone}
java.lang.NullPointerException
	at clojure.core$deref_future.invokeStatic(core.clj:2300)
	at clojure.core$deref.invokeStatic(core.clj:2320)
	at clojure.core$deref.invoke(core.clj:2306)
	at cemerick.piggieback$wrap_cljs_repl$fn__2218.invoke(piggieback.clj:289)
	at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__1814.invoke(middleware.clj:22)
	at nrepl.server$handle_STAR_.invokeStatic(server.clj:18)
	at nrepl.server$handle_STAR_.invoke(server.clj:15)
	at nrepl.server$handle$fn__1079.invoke(server.clj:27)
	at clojure.core$binding_conveyor_fn$fn__5739.invoke(core.clj:2030)
	at clojure.lang.AFn.call(AFn.java:18)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:844)

weavejester21:01:08

It's triggered when I add the :nrepl-middleware [cemerick.piggieback/wrap-cljs-repl] option to :repl-options.

bozhidar21:01:51

Ah, that’s simple. 🙂

weavejester21:01:12

Really? I'm glad to hear it!

bozhidar21:01:35

The artifact changed its name a while ago. It’s now cider/piggieback. Use version 0.3.10 and everything will work fine.

weavejester21:01:51

Yes, I just noticed. Thank you for pointing it out! 🙂

bozhidar21:01:57

No worries!

bozhidar21:01:30

Generally with the new nREPL it’s important that you’re not using any outdated middleware, as old versions probably support tools.nrepl intead of nrepl/nrepl.

weavejester21:01:06

Yep, it works now. Thanks for your help!

bozhidar21:01:29

You’re welcome!