Fork me on GitHub
#cider
<
2017-01-27
>
gtrak01:01:04

anyone experienced cider hanging on bigdecimal values in test expected/actual reports?

gtrak01:01:51

Uncaught exception in thread nREPL-worker-3:
                                          java.lang.Thread.run              Thread.java:  745
            java.util.concurrent.ThreadPoolExecutor$Worker.run  ThreadPoolExecutor.java:  617
             java.util.concurrent.ThreadPoolExecutor.runWorker  ThreadPoolExecutor.java: 1142
                                                           ...                               
 clojure.tools.nrepl.middleware.interruptible-eval/run-next/fn   interruptible_eval.clj:  190
                    cider.nrepl.middleware.test/handle-test/fn                 test.clj:  215
                                                           ...                               
                                   clojure.core/with-bindings*                 core.clj: 1963 (repeats 2)
                                            clojure.core/apply                 core.clj:  657
                                                           ...                               
                 cider.nrepl.middleware.test/handle-test/fn/fn                 test.clj:  220
                clojure.tools.nrepl.transport.FnTransport/send            transport.clj:   28
                      clojure.tools.nrepl.transport/bencode/fn            transport.clj:  103
                                                           ...                               
                      clojure.tools.nrepl.bencode/eval21149/fn              bencode.clj:  398
                                                           ...                               
                      clojure.tools.nrepl.bencode/eval21149/fn              bencode.clj:  398
                                                           ...                               
                      clojure.tools.nrepl.bencode/eval21149/fn              bencode.clj:  398
                                                           ...                               
                      clojure.tools.nrepl.bencode/eval21139/fn              bencode.clj:  382
                                                           ...                               
                      clojure.tools.nrepl.bencode/eval21149/fn              bencode.clj:  398
                                                           ...                               
                      clojure.tools.nrepl.bencode/eval21139/fn              bencode.clj:  382
                                                           ...                               
                      clojure.tools.nrepl.bencode/eval21139/fn              bencode.clj:  382
                                                           ...                               
                      clojure.tools.nrepl.bencode/eval21139/fn              bencode.clj:  382
                                                           ...                               
                      clojure.tools.nrepl.bencode/eval21139/fn              bencode.clj:  382
                                                           ...                               
                      clojure.tools.nrepl.bencode/eval21149/fn              bencode.clj:  398
                                                           ...                               
                      clojure.tools.nrepl.bencode/eval21139/fn              bencode.clj:  382
                                                           ...                               
                      clojure.tools.nrepl.bencode/eval21149/fn              bencode.clj:  398
                                                           ...                               
                      clojure.tools.nrepl.bencode/eval21114/fn              bencode.clj:  326
 java.lang.IllegalArgumentException: Cannot write value of type class java.math.BigDecimal

vinai08:01:01

Hi, newbie here, please excuse my ignorant questions... Today I'm attempting to use the cider debugger for the first time. Is this the right place to ask, or is there a different channel that I should go to?

vinai09:01:52

Here is my question. When I place point on a top level form in my .clj file, hit C-u C-M-x and expect to be dropped into a debug session. Instead I get the message <C-s-268632088> is undefined. Any pointers?

vinai09:01:12

Hm. Also cider-auto-test-mode is not defined.

vinai09:01:40

Still really missing some basics here.

vinai09:01:52

If someone can point me how to start debugging this that would be cool. I'll be here for another 6 hours or so at least 🙂

vinai10:01:22

Well... some progress? Now C-u C-M-x evaluates the top level form and inserts the value at the point. Not a debugger, but something different at least.

agile_geek10:01:50

@vinal I haven't used the cider debugger much but you need to run your app from the cider nrepl session or use cider-connect to connect the cider nrepl session to the running app and then when your fn gets executed it will stop on the instrumented fn like a breakpoint was set and you get a number of options to inspect locals, step through code etc.

agile_geek10:01:43

I've just upgraded to cider 0.14.0 from 0.12.x and I'm getting the classic CIDER's version (0.14.0) does not match cider-nrepl's version (nil). Things will break! warning. I've checked and the project.clj doesn't have cider-nrepl specified, neither does ~/.lein/profiles.clj, cider-inject-dependencies-at-jack-in is set to t and I can see the message with the update-in adding the 0.14.0 version of cider-nrepl when I cider-jack-in. I've also tried manually adding the 0.14.0 version of cider-nrepl into the project.clj and still get the warning. Basically, I've exhausted everything in the troubleshooting page, any ideas?

benedek11:01:07

i’ve seen a msg lately on gitter saying the same but stating that everything still works as expected

benedek11:01:26

so you might want to test if M-. actually works @agile_geek

agile_geek11:01:31

Must admit I haven't noticed anything breaking yet

benedek11:01:49

yup, might be just a glitch in the version checking logic...

agile_geek11:01:23

Must be... but bit distracting

agile_geek11:01:39

Have to catch up sometime simple_smile

vinai11:01:30

@agile_geek Thanks for the heads up. Just noticed I'm on cider 0.8.1 - I'll upgrade and try to debug again.

agile_geek11:01:48

@vinal not even sure cider debug was a feature of 0.8.1 I think it came in around 0.10.x?

agile_geek11:01:24

but that's from memory

vinai11:01:16

I think I just installed the default with package-install at the time...

vinai11:01:45

Hmm, I only see the versions 20141120.1746 (installed), 0.8.2 (marmalade) in list-packages.

vinai11:01:10

And I just did a package-refresh-contents.

vinai11:01:27

Strange, on http://stable.melpa.org/#/ the version is 0.14...

vinai11:01:10

And on melpa (non-stable) there is a snapshot. So I guess I'm missing the stable repo.

agile_geek11:01:33

Check your init.el

agile_geek11:01:05

see what repo's you're referencing

vinai11:01:32

emacs now always pulling the latest 20170126.717 version, not the version from melpa-stable. How can I set melpa-stable to have a higher priority then melpa in the repo list? Maybe I have to remove melpa.

vinai11:01:56

Thats seemed to have worked.

vinai11:01:30

Yessss... I've got a debugger ^^

vinai11:01:35

🎉

agile_geek13:01:08

You could pin melpa stable for cider in your init.el as well. that way you can have melpa in the list at the same time as melpa-stable (add-to-list 'package-pinned-packages '(cider . "melpa-stable") t)

vinai13:01:19

Ohh, nice! Thanks @agile_geek

agile_geek16:01:23

@benedek hmm, I have got problems around cider-jack-in-clojurescript as I can't start cider repls in a cljs/clj project. I get no error messages other than that warning in the nrepl messages but the CIDER repls just don't start

agile_geek16:01:56

I haven't time to debug this. What's a safe way of regressing to an earlier version of CIDER?

benedek16:01:40

you are on latest snapshot?

benedek16:01:18

if so just nuke your cider installation in your .emacs.d change your config to melpa-stable and reinstall

benedek16:01:44

if you use use-package just add :pin melpa-stable to your package config

benedek16:01:06

not easy to go back to a previous snapshot i am afraid...

agile_geek16:01:48

No I'm on latest stabel but it's not working

dpsutton16:01:53

@agile_geek are you running melpa or melpa stable

agile_geek16:01:59

I need to go back to 0.12.x

dpsutton16:01:05

Can you visit the messages buffer

dpsutton16:01:11

Maybe there's some info in there

agile_geek16:01:18

Checked that

dpsutton16:01:21

Also turn on nrepl logging

dpsutton16:01:28

And check out what's happening in the

dpsutton16:01:41

And that's 0.14?

agile_geek16:01:50

nrepl starts

agile_geek16:01:58

cider buffers don't

dpsutton16:01:08

What do you mean nrepl starts

agile_geek16:01:13

nrepl buffer is up with normal messages for figwheel etc and I can connect to the app but there are no cider buffers and I can't see a message that mentions the repl port so I can't cider-connect

agile_geek16:01:29

I haven't got time to debug I've lost hours to this already

richiardiandrea16:01:55

@agile_geek last question, none of your buffer shows cljs-user or is writing to you to connect browser to it?

agile_geek16:01:19

don't understand the question

agile_geek16:01:00

There's no cider repl buffers

richiardiandrea16:01:05

Sorry yeah, not very well asked 😀

agile_geek16:01:10

the only buffer is nrepl

dpsutton16:01:44

is your only option to blow away cider and reinstall an old version?

agile_geek16:01:46

Back to me question above - how do I regress to early version of cider

dpsutton16:01:13

since you are committed to completely eradicating cider, do you mind trying melpa's version, 0.15 snapshot?

dpsutton16:01:30

and trying to jack in once and if it doesn't work you've lost hopefully 4 minutes

dpsutton16:01:36

but with the upside that maybe it works?

dpsutton16:01:47

and to ask a few questions, have you upgraded emacs recently?

dpsutton16:01:59

could this be a discrepancy in byte compiled files versus the el files?

dpsutton16:01:18

perhaps you could find ./ -name \*.elc | xargs rm and then restart emacs

dpsutton16:01:27

^ obviously from within the cider directory

dpsutton16:01:45

i upgraded 24.x to 25 recently on my windows machine and there were some changes to the byte compiler i guess

dpsutton16:01:30

also, I've found that tracking github to be the easiest way to revert/upgrade/downgrade

dpsutton16:01:52

;; load local version of cider
(add-to-list 'load-path "~/projects/cider")
(load "cider")

dpsutton16:01:03

and this way you can just checkout which tag you care for

dpsutton16:01:43

but it looks like melpa stable doesn't keep old versions around: https://github.com/melpa/melpa/issues/3948

agile_geek16:01:00

@dpsutton to answer your question about upgrading emacs - no I haven't as it's too scary for this exact reason

dpsutton16:01:08

haha i understand

agile_geek16:01:27

you reminded me I've got all this in github so trying to restore from there

dpsutton16:01:44

i was just looking for least painful

dpsutton16:01:39

although i still think you should try the latest from melpa stable

dpsutton16:01:49

especially since you could run a git checkout to restore it

agile_geek16:01:17

I did try latest from melpa stable...that's what broke everything

dpsutton16:01:26

oh sorry i mean from melpa

dpsutton16:01:41

i refactored some things with connections that should improve cljs and cljc actions

agile_geek16:01:51

snapshot - will do but I'm back running and I've work to do

dpsutton16:01:00

ah glad you're urnning then

dpsutton16:01:22

if you want to ping me later when you do want to experiement i'm happy to help. and totally understand if you just want to get work done and ignore all this

agile_geek16:01:07

May experiment at weekend but I'm really busy atm

borkdude16:01:22

How do I associate a buffer with a running cider repl?

jfntn16:01:50

@borkdude almost literally cider-assoc-buffer-with-connection

borkdude16:01:45

I tried that, but from a .cljc file it probably doesn’t work right?

borkdude17:01:23

What I’m trying to do is test a change from a library I’m using against my session

dpsutton19:01:11

@borkdude I'm working on that. That feature (which requires some cleanup) is coming soon

dpsutton19:01:15

but you can do it easily now

dpsutton19:01:31

(cider-find-connection-buffer-for-project-directory
                                      nil :all-connections)
will list all connections and then
(setq-local cider-connections (list other-conn))
will set the connection

dpsutton19:01:56

this will work most easily if you are on the most recent version of cider as there was a cleanup of session/connection

dpsutton19:01:01

so that the two wouldn't get out of sync

dpsutton19:01:06

but this should work for you

dpsutton19:01:50

the former function will list all connections. Set it to some var and then setq a buffer local as (list connection-you-want). Connections are in simple terms just repl buffers

dpsutton19:01:32

simple function that should get you there while i finish it. it'll take a while to get it polished and done

dpsutton19:01:56

and just choose the repl as the connection you want

dpsutton21:01:16

Let me know if it works and if it needs a little tweaking

borkdude21:01:42

@dpsutton When I do C-x C-e it complains it needs a Clojure REPL

borkdude21:01:56

After I chose set-local-connection to the REPL buffer

dpsutton21:01:17

Are you on most recent cider?

borkdude21:01:33

0.14.0-SNAPSHOT

dpsutton21:01:03

And you ran it from the buffer you want to change the connection?

dpsutton21:01:11

It is sensitive to the buffer it is run from

borkdude21:01:53

Yes, I ran it from core.cljc within the cljs-ajax library

dpsutton21:01:57

can you eval (cider-current-connection) from the buffer?

dpsutton21:01:43

not M-x but M-: eval

borkdude21:01:22

It seems to return nil

dpsutton21:01:32

let me think and test on my machine

dpsutton21:01:10

but my guess is if you upgrade cider it will work. current melpa is 15-snapshot

dpsutton21:01:36

the reason it will work if you upgrade is that the code used to reach out willy nilly and ask for current connection

dpsutton21:01:47

I have tried to make that only take a connection at the beginning

dpsutton21:01:59

so now it starts with a connection and never asks for one again

borkdude21:01:44

It doesn’t have a high priority for me right now, so don’t worry too much about it

borkdude21:01:56

But I’ll upgrade when I’m less tired, soonish

dpsutton21:01:58

but this is being worked on 🙂

dpsutton21:01:08

i want connections to be first class citizens

dpsutton21:01:20

so you start the eval chain with one and it honors that all the way through

dpsutton21:01:26

this will make cljs and cljc buffers nicer as well

dpsutton21:01:37

but removing the "one connection" assumption is tricky

dpsutton21:01:40

it got baked in a lot

sif22:01:22

Hello everyone, my emacs frame gets wider when I only select buffer with cojure mode and that is only after cider-jack-in, this doesn't happen elsewhere. Any help?

practicalli-johnny23:01:10

@agile_geek: Emacs 25.1 or greater is required for latest stable cider versions

dpsutton23:01:12

i don't know why my setq-local didn't work

dpsutton23:01:24

i don't believe that's true, @jr0cket

dpsutton23:01:30

support goes back to 24.4 i think

practicalli-johnny23:01:05

Depends which version of Cider you used

dpsutton23:01:53

cider-compat.el is still in the project

dpsutton23:01:04

and defines when-let and if-let

dpsutton23:01:00

;; Pretty much everything here's copied from subr-x for compatibility with
;; Emacs 24.4.

practicalli-johnny23:01:57

In November Cider stopped working on Emacs 24.4 due to removal of cider-compat.el. A fix was applied but I was still seeing people with problems after that. It may be due to the version of cider, could be just snapshots, I havent had chance to test it myself. So I have recently recommended Emacs 25.1. Happy to be wrong though