Fork me on GitHub
#cider
<
2018-07-10
>
chrisblom06:07:37

@bhauman setq cider-lein-command and cider-lein-parameters

chrisblom06:07:56

for example:

(setq cider-lein-command "lein")
(setq cider-lein-parameters "with-profile +power repl")

dominicm06:07:32

@chris.blom I think @bhauman is asking about the cli tools, clojure and clj.

dominicm06:07:16

@chrisblom even, duplicate usernames suck

chrisblom06:07:06

ah i misread, in that case use cider-clojure-cli-parameters

vinai13:07:12

Just updated to a clean prelude install on emacs 26.1.1. My main project seems fine, but when I open the following file I get an error.

(ns file-watcher.core)

(defonce fs (js/require "fs"))

(defonce watchers (atom []))

(def cwd js/process.cwd)

(js/procs.on "exit" #(run! (fn [w] (.close w)) @watchers))

(defn watch-dir [dir callback]
  (swap! watchers conj (.watch fs dir (or callback #(apply println %&)))))
The error:
undo-tree-load-history: Wrong type argument: undo-tree, [cl-struct-undo-tree [nil ([nil ([nil ([nil ([nil ... ... nil ... 0 nil]) ((#("
" 0 1 ...) . -279) (undo-tree-id1 . -1) (undo-tree-id2 . 1) (undo-tree-id3 . -1) (undo-tree-id4 . -1) (undo-tree-id5 . -1) (279 . 280) (t 23364 19015 0 0)) nil (23364 19462 848450 0) 0 nil]) ((nil rear-nonsticky nil 21 . 22) (nil help-echo cider--help-echo 5 . 22) (nil fontified nil 5 . 22) (5 . 22)) nil (23364 19015 116513 0) 0 nil]) ((#("file-watcher.core" 0 17 (face font-lock-type-face cider-block-dynamic-font-lock t cider-locals nil help-echo cider--help-echo fontified t)) . 5) (undo-tree-id0 . 17) (t 23362 61960 0 0)) nil (23364 19015 116542 0) 0 nil]) nil nil (23364 19015 116545 0) 0 nil] [nil nil ((#("b" 0 1 (cider-locals nil fontified t help-echo cider--help-echo)) . -279) (undo-tree-id6 . -1) (undo-tree-id7 . -1)) nil (23364 23080 795926 0) 0 nil] 179 5 nil]
I don't even have a repl open. Any idea what this means?

dpsutton13:07:03

@vinai can you tell me how and what you upgraded? I've seen these types of errors before when upgrading emacs versions. I think its a change in the structs. if you can blow away the elc files it normally resolves itself

vinai13:07:58

I removed ~/.emacs.d, ran brew upgrade emacs, then ran the prelude installer (piping it into sh)

vinai13:07:25

Where do I find the etc files?

dpsutton13:07:09

They are adjacent to the el files. I wonder if the installer brings elc files?

dpsutton13:07:41

El are emacs lisp source files. They can be byte compiled into elc files

vinai13:07:43

This is the command I ran curl -L | sh

vinai13:07:33

So, yeah, emacs -batch -f batch-byte-compile "$PRELUDE_INSTALL_DIR/core"/*.el

dpsutton13:07:02

are you on osx?

dpsutton13:07:32

oh right of course you are. i think osx ships with a really old emacs. i wonder if that emacs is being used to byte compile rather than the new one installed with brew

dpsutton13:07:05

run the script with $PRELUDE_SKIP_BC and see if you have different results

dpsutton13:07:20

and its totally possible that this is all on the wrong track. but this should tell us

vinai13:07:05

> are you on osx? yes

vinai13:07:25

Now, I'm making sure I'm not running the default 22.x emacs 🙂

dpsutton13:07:20

yes. i'm just wondering which emacs is running during that script.

cjsauer15:07:11

Does cider now require Emacs version >25?

vinai16:07:56

@dpsutton ohhh good call. Currently it's 26, but I'm not sure it was in that session. @cjsauer yes

bozhidar17:07:12

@cjsauer The master branch requires 25.1+.

bozhidar17:07:47

@vinai Definitely looks like some byte-compilation issue, but I haven’t encountered this myself.

bozhidar17:07:48

Guess you can just forgo the installer and simply clone Prelude. Likely the script is running the wrong Emacs version indeed.

dehli18:07:52

Hi all, I'm currently getting the following error when I run cider-jack-in-cljs:

error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Exception in thread "main" java.lang.IllegalArgumentException: No matching ctor found for class java.net.InetSocketAddress
I've tried on two computers and get the same error on both (it's a recent error b/c it was working fine yesterday). Has anyone else gotten this?

dehli18:07:50

I think it's related to a change to cider-nrepl b/c a new version of 0.18.0-SNAPSHOT was pushed today (https://clojars.org/cider/cider-nrepl/versions/0.18.0-SNAPSHOT)

kennethkalmer19:07:14

I’m also having some issues with the new snapshot, can’t get a fresh repl going

dpsutton19:07:02

@kennethkalmer can you say which version of java you are running?

kennethkalmer19:07:52

$ java -version
java version "9.0.4"
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)

kennethkalmer19:07:02

same version I’ve been running locally for months

kennethkalmer19:07:39

and searching around I only seem to find old issues for Java 9 compatibility, mostly with lein

dehli19:07:26

I'm on java 10 and it had previously been working fine with it

dpsutton19:07:28

https://github.com/technomancy/leiningen/issues/2149 this issue runs into the same problem. Are you able to run lein repl without a problem?

kennethkalmer19:07:25

I’m testing it another project, I tend to keep repls running for as long as possible 🙂

kennethkalmer19:07:31

blows up the same way, I’m gonna nuke the latest snapshot and run lein offline

petr19:07:47

Hey all, my emacs seems to instantly disconnect from the figwheel process. Resulting in errors such as

user-error: 'cider-repl-set-ns' needs a ClojureScript REPL.

kennethkalmer19:07:11

I’m just switching back to Java 8 for the moment, I have no idea how else to debug this

kennethkalmer19:07:13

If there is still any other information or feedback I can provide to help debug the issue, please let me know! I just don’t know where to from here on my own (and I have some work to get done in the meanwhile) 🙂

dpsutton19:07:35

@petr do you have multiple repls open at the moment?

mattly19:07:55

does anyone know what's up with this error? I'm assuming that Cider 0.18.0-SNAPSHOT changed something

petr19:07:22

@dpsutton I do, this application opens a clj repl and a cljs repl

dpsutton19:07:54

it's very important that the last repl you touched is the cljs repl and not the clj repl

dpsutton19:07:17

i know that sounds stupid but there are some tricky problems underneath it

petr19:07:18

What do you mean, touched? I need to use the clj repl to start my application

dpsutton19:07:58

so if you have two repls open (one clj, one cljs) put your cursor in the cljs buffer and then do whatever you need to do

dpsutton19:07:11

the "current repl" is based on the last repl you touched. make sure its a cljs repl

dpsutton19:07:23

I run the same setup at work. it is infuriating

dpsutton19:07:27

touched = point was in last

petr19:07:39

It appears to "break" when I open the web interface of the app. Before I have tried to evaluate anything

dpsutton19:07:30

do you have two repls open at this point?

petr19:07:51

I'm about to. Trying to downgrade to cidr 0.17.0

petr20:07:15

@dpsutton So I have two repls open now. Still using 0.18.0 though

dpsutton20:07:38

ok. one is cljs and one is clj?

dpsutton20:07:48

i'm assuming your app is running?

dpsutton20:07:00

you have the "web interface of the app" open?

petr20:07:03

No, when I start it, they will both be clj

dpsutton20:07:13

oh. how do you start it?

dpsutton20:07:23

is this shadow by any chance?

petr20:07:24

I have a fn in my user.clj namespace I use

dpsutton20:07:40

so you eval that function in your clj repl

dpsutton20:07:47

and you're saying that after that the cljs repl will be clj?

dpsutton20:07:53

it changes the cljs repl from afar

petr20:07:55

And it disconnects figwheel

dpsutton20:07:05

well that is interesting

dpsutton20:07:43

and you're using cider/piggieback?

dpsutton20:07:50

or cemerick?

petr20:07:41

cidr and piggieback

petr20:07:48

isn't cemieric piggieback?

hagmonk20:07:53

I'm on Java 8 and hitting the No matching ctor found for class java.net.InetSocketAddress too

cjsauer21:07:07

Thanks @hagmonk. Does anyone know of a way to pin melpa package versions? It's a bit insane to be forced to the bleeding edge...my editor has been broken by this for most of the day.

hagmonk21:07:09

This was caused by cider-nrepl's snapshot being updated in clojars, rather than cider's melpa packages

hagmonk21:07:45

Since I use clojure-cli, I just added a`deps.edn` to my fork of cider-nrepl and used that instead. with boot and lein it's kinda hard, you really need to wait a fixed artifact to be pushed somewhere

hagmonk21:07:59

the magic of using -SNAPSHOT :)

cjsauer21:07:00

Ah ok. Is there a reason that cider depends on snapshot versions? That seems precarious...

petr21:07:06

How can I stop cidr from updating inside of emacs?

petr21:07:14

These changes keep breaking my editor and it's incredibly frustrating

dpsutton21:07:40

@cjsauer you are using the CIDER from melpa is the bleeding edge version. There is the stable release on melpa-stable

dpsutton21:07:08

i think it was a bad choice to make melpa the dev version of melpa and melpa-stable the stable branch. I would prefer it was melpa-dev and melpa. But c'est la vie

cjsauer21:07:15

@dpsutton I'm actually using spacemacs, but looking at the clojure layer I'm not seeing any mention of specific versions anywhere https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Blang/clojure I've also tried setting package-archives and package-archive-priorities to put melpa stable at the top of the list, as described here: https://emacs.stackexchange.com/questions/2969/is-it-possible-to-use-both-melpa-and-melpa-stable-at-the-same-time No luck there. Overall, it seems like pinning versions anywhere in the emacs ecosystem is...difficult at best.

hagmonk21:07:20

You can also edit your cider invocation to pass a map for the time being

dpsutton22:07:01

https://github.com/jwiegley/use-package there are no linkable section headers but search for "pin" it's at the bottom

hagmonk22:07:17

for instance, I did C-u C-m M-j and replaced the default args with: -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init {:handlers ["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"] :port 0 :bind "::"})'

dpsutton22:07:19

you don't pin to a version as much as you pin to melpa-stable

cjsauer22:07:11

@hagmonk nice, that's a decent workaround for now

cjsauer22:07:31

@dpsutton hm interesting...so maybe the clojure layer of spacemacs should pin its use-package calls to melpa stable?

dpsutton22:07:19

that sounds reasonable. melpa is the dev version versus melpa stable is the stable releases. seems more likely that the vast majority of users would want the stable

cjsauer22:07:25

whew...hopefully can get it worked out soon; thanks for the help. Would be lovely to one day have an editor situated directly inside of the clojure ecosystem...I haven't yet bitten the bullet on really learning elisp and its surroundings

cjsauer22:07:01

Sometimes feel like I'm targeting 3 platforms: JVM, JavaScript, and Emacs haha

dpsutton22:07:24

spend 5 minutes to learn the debugger, how to jump to definition and a good grep style package and you'll be elisping in no time

dpsutton22:07:50

the elisp is way easier than figuring out gnarly problems in the cider-nrepl. the feedback loop is tough to debug the tools

hagmonk22:07:18

"jump to definition" is one of the things that consistently doesn't work for me :) It's always like rolling a dice in emacs .... in elisp or clojure

dpsutton22:07:39

oh. it works for me just fine in both. I would be very annoyed if it didn't

dpsutton22:07:18

if you can file a ticket with some repro i can try to track it down

hagmonk22:07:46

Cursive's is far more reliable for me - it doesn't require a REPL to be started, and it can jump into jars (which I'm always doing), and decompile the jars or download their source if required

hagmonk22:07:19

I just tried to test a repro case (org.httpkit.client/get was the last one that failed) but my hacky state with cider-nrepl means that nothing is working properly :/

dpsutton22:07:23

cider jumps into jars for me. i can't get into java source though

dpsutton22:07:41

well when things settle down let me know and i'll look at it with you

hagmonk22:07:04

that would be awesome!

hagmonk22:07:30

I have been meaning to check out the Cider support in some of the VSCode plugins. Unfortunately it doesn't appear that any of them have deps.edn support yet, and I've migrated almost everything over that way

cjsauer22:07:09

@hagmonk quick tweak to your workaround: had to change :handlers to :middlware, and then I also added a bit more middleware for what appears to be a new debugger dependency (bpiel/sayid):

-e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init {:middleware ["com.billpiel.sayid.nrepl-middleware/wrap-sayid", "refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"] :port 0 :bind "::"})'

hagmonk23:07:36

@dpsutton cider--jump-to-loc-from-info: Symbol’s value as variable is void: find-tag-marker-ring - that seems to be the current error whenever I try to jump

dpsutton23:07:39

Gonna get dinner started and I'll look into it tonight @hagmonk