Fork me on GitHub
#cider
<
2018-05-09
>
sashton00:05:30

I'll not talking about graal, just the default cider format command, which uses cljfmt code. I'm wondering if people use it. https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/format.clj

richiardiandrea01:05:44

yes I saw we were talking related but different things 😄

theeternalpulse02:05:08

anyone else getting issues trying to install cider

Error (use-package): Failed to install cider: Failed to verify signature: "spinner-1.7.3.el.sig"
Error (use-package): Cannot load cider

theeternalpulse02:05:38

I am using use-package as such

(use-package clojure-mode :ensure t)
(use-package cider :ensure t)

theeternalpulse02:05:06

this is with emacs25

bozhidar11:05:53

I saw others reporting this as well, but I don’t know how to handle it.

bozhidar11:05:20

Something seems to be wrong with this package in GNU Elpa (or with its signature).

theeternalpulse16:05:35

is there a way to require cider but have it point to a local spinner.el file for the dependency?

bozhidar11:05:30

(it’s a CIDER dep)

bozhidar13:05:08

No idea. I can’t imagine how this can be connected somehow to CIDER, but I guess it is. It’s just that the error is quite generic and gives me no clue as to what’s the real problem.

dpsutton13:05:40

That looks like the state handler

dpsutton13:05:17

I'm questioning the use of creating a sibling repl without the primary. I wonder if there are some important steps left out

thheller13:05:54

I'm totally clueless .. don't even know where to look. it doesn't make any sense to me 😛

thheller13:05:59

warnings.clj does not use read-string at all anywhere. yet it is on the stack.

bozhidar14:05:19

> I’m questioning the use of creating a sibling repl without the primary. I wonder if there are some important steps left out

bozhidar14:05:58

Well, the sibling repl is just a regular repl which you convert to cljs. There’s nothing special about it. I’m actually planning to make it possible to jack-in just to a cljs REPL.

dpsutton14:05:11

its after a cider connect i guess. still feels a bit weird. but i thought that was out track state message but its a shadow-cljs message. I'm trying to track down where that chan is read in shadow

bozhidar14:05:18

Not sure if many people need two repls at all.

thheller14:05:17

the message appears in the log and happens in another thread not the REPL thread. thats the part I don't understand.

thheller14:05:44

in shadow-cljs there is a "worker" thread when you start a watch for the build. that worker does the recompile. in this case the recompile fails and when trying to get more info for the warning it fails with this weird error

deep-symmetry15:05:09

Hmm… after installing CIDER 0.17, trying to jack in fails with: `Error loading refactor-nrepl.middleware: java.io.FileNotFoundException: Could not locate cider/nrepl/middleware/util/misc__init.class or cider/nrepl/middleware/util/misc.clj on classpath., compiling:(refactor_nrepl/middleware.clj:1:1) Exception in thread “main” java.lang.RuntimeException: Unable to resolve var: refactor-nrepl.middleware/wrap-refactor in this context, compiling:(/private/var/folders/fg/1tzg0xt88v5bp20059blypr00000gq/T/form-init7039836408815040552.clj:1:9942)`

andnils16:05:43

@deep-symmetry same for me. Will try to look into it later tonight, but maybe you’ll find a solution before I do :-)

deep-symmetry16:05:58

Alas, I need this to work, to do my work. 😕

dpsutton16:05:08

it's got a refactor nrepl message in there. try without that to see if you can get CIDER up and running without it?

dominicm16:05:46

I think refactor needs to be on the snapshot in order to work with cider 0.17

deep-symmetry16:05:20

CIDER injects the version of refactor-nrepl it needs, so if it is getting the wrong one, that’s a bug in CIDER itself.

deep-symmetry16:05:29

For now, I have checked out CIDER 0.16.0 from GitHub, and have tricked Emacs into installing the package from the git repo, and things seem to be working albeit without the snazzy new 0.17 features.

bhauman16:05:57

Hmmm I don't see cider-register-cljs-repl-type

dpsutton16:05:29

weird. i see it. cider-register-cljs-repl-type in cider.el line 700

bhauman17:05:39

I tried to call it with M-x and it wasn't completing

dpsutton17:05:17

i don't believe its interactive. you need to write it out in your init

bhauman17:05:30

ok sorry 🙂

dpsutton17:05:56

M-x only shows functions you can invoke easily by the modeline or with your curson in a buffer. more complex things are best left as code (non-interactive)

bhauman17:05:13

@dpsutton do you know if cider/piggieback is getting included and inserted into the middleware when starting cider-jack-in-clojurescript when using Clojure CLI tools

dpsutton17:05:51

no i don't know how the merging up the edn files works. i think @dominicm knows the most about it but i can root around for a second

bhauman17:05:27

@dpsutton no worries I think I see the problem on my end

dpsutton17:05:48

you can see how its done for jacking in with clj at cider-jack-in-params and then emulate that. but i don't think there's one for cljs

bhauman17:05:49

hmmm actually it doesn't look like it's loaded

dpsutton17:05:02

no i doubt it

bhauman17:05:14

but it is for leiningen

dpsutton17:05:23

(defun cider-jack-in-params (project-type)
  "Determine the commands params for `cider-jack-in' for the PROJECT-TYPE."
  (pcase project-type
    ("lein" cider-lein-parameters)
    ("boot" cider-boot-parameters)
    ("clojure-cli" (format cider-clojure-cli-parameters
                           (concat
                            "["
                            (mapconcat
                             (apply-partially #'format "\"%s\"")
                             (cider-jack-in-normalized-nrepl-middlewares)
                             ", ")
                            "]")))
    ("shadow-cljs" cider-shadow-cljs-parameters)
    ("gradle" cider-gradle-parameters)
    (_ (user-error "Unsupported project type `%s'" project-type))))

dpsutton17:05:30

clojure-cli command is built here

dpsutton17:05:04

i think you'll need to make a custom one at this point so that stuff is there at the beginning and then a custom cljs jack in type to then invoke it?

dpsutton17:05:36

and it looks like there's no utility function to do that so you'll need to do an add-to-list on that list

bhauman17:05:39

Cool I got figwheel.main working in CIDER

bhauman17:05:24

with cider-jack-in-cljs

bhauman17:05:49

I had to add the following line to my init.el

bhauman17:05:43

which I'm sure shouldn't be needed as jack-in-cljs for clojure-cli should ensure that piggiback is included

bhauman17:05:24

I tried to find where cider.el skipped a beat but I couldn't find the spot

bhauman17:05:59

I also added a figwheel.main repl type

deep-symmetry18:05:18

@andnils if you do find a way to get 0.17.0 working, I’d love to hear it.

benedek19:05:02

@deep-symmetry clj-refactor decides what to inject for itself it only uses cider machinery for the injection

benedek19:05:51

So do try to uograde your cljr package to latest snapshot if you are not on that

andnils20:05:48

@benedek @deep-symmetry that worked for me. I only use packages from “melpa-stable”. So, I uninstalled the stable version of clj-refactor, added the ‘ordinary’ melpa package url, and installed clj-refactor v20180420. Now cider works!

benedek20:05:40

Glad to hear that ;)

andnils20:05:31

Big thanks for the tips. I was digging around to find the problem, but I wasn’t even close to clj-refactor…

andnils20:05:02

Conclusion: cider v0.17.0 is not compatible with clj-refactor 2.3.1

deep-symmetry20:05:13

Yes, I also use melpa-stable and would prefer to stay that way. It sounds like the error was putting cider 0.17 on melpa-stable before its dependencies were?

benedek20:05:59

Cljr is not a dependency of cider

benedek20:05:10

It is a separate package

benedek20:05:27

A cljr release is long overdue but low prio as the latest snapshot works fine with newest cider

deep-symmetry20:05:55

But that breaks people relying on Melpa.

benedek20:05:22

Nothing stops you using both melpa and melpa-stable btw

deep-symmetry20:05:03

Not wanting unstable releases is what stops me.

benedek20:05:30

Use-package is specially a good way to manage packages incl stable /melpa

andnils20:05:46

Indeed. “pin” is your friend

benedek20:05:14

For cljr there is no stable release in that sense

deep-symmetry20:05:50

But this just reinforcing how painful packages are in emacs. I don’t want to have to learn all these details but I guess I’m going to have to.

andnils20:05:04

Atm the snapshot is the stable one. And the stable is unstable. 🙂

benedek20:05:36

@andnils ;) the stable is old...

benedek20:05:13

Use-package worths your time really but i feel your pain

andnils20:05:23

The nice thing with emacs is, when things breaks you can often poke around in the elisp source and solve it yourself

andnils20:05:49

…and, even if you don’t, you always learn a lot.

deep-symmetry21:05:20

Agreed, and I’ve done that and even contributed emacs packages in the past. But when I’m putting in multiple weeks of overtime working hard in a different language and environment isn’t when I want to do that! Anyway, thanks for identifying the problem, I now know what I need to do if I want to move back onto 0.17.