Fork me on GitHub
#cider
<
2018-03-12
>
dpsutton00:03:05

i think @bronsa made some changes in that for cljs. and those changes are needed for cljs. but i'm not sure why the conflict happens

pauld00:03:05

I'm having trouble making a minimum reproducible example. It seems to be related to something cider-jack in does differently than lein run and it only happens with certain code (which I'm trying to determine now - maybe compojure middleware).

dpsutton00:03:50

and with cljs build otimizations on none? just hoping the offending stuff isn't being DCE

pauld01:03:54

Thanks @bozhidar. Now I'm having a hell of a time trying to make a minimum project to reproduce this. In a complex project it gets the error when it tries to compile (or read?) the ring.middleware.format dependency. But in a bare project I can read put this in my core namespace without issues.

pauld01:03:32

Somehow on one of my projects I can get cider to use tools.reader 1.3.0-alpha and make it not find the tools.reader.impl/reader-error var in the same dependency.

pauld01:03:47

It's like it has a split brain, reaching into on dependency of jar for one thing and into another for something else? Maybe deleting .m2 will help.

bozhidar01:03:12

Keep in mind the CIDER dep is inlined and it’s ns is changed to avoid clashes with user deps. That means users can’t really override what CIDER uses internally.

bozhidar01:03:45

Btw, @gonewest818, looking at https://github.com/clojure-emacs/clojure-mode/pull/472 I was reminded we could elint for clojure-mode as well.

gonewest81801:03:34

@bozhidar low hanging fruit for a new contributor? 🙂

gonewest81801:03:51

But yeah, I can look at that. I’m trying to get to the bottom of cider #1115

gonewest81801:03:31

It doesn’t make sense to me why the spinner sometimes runs indefinitely once there is a long line of output in the repl buffer.

gonewest81801:03:15

My hunch is no processing is actually happening (other than the spinner).

gonewest81801:03:49

I have edebug on cider-eval-spinner-handler and it isn’t getting called.

pauld01:03:17

Thanks @bozhidar Still, very interesting / strange that my error goes away when I put in an explicit tools.reader "1.2.2" dependency. This big complex project (yogthos/memory-hole) seems to be doing something unusual. Very mysterious!

bozhidar01:03:52

> But yeah, I can look at that. I’m trying to get to the bottom of cider #1115

bozhidar01:03:07

No rush for the elint, everything cider-related is way more important. 🙂

bozhidar01:03:39

> My hunch is no processing is actually happening (other than the spinner).

bozhidar01:03:08

Or some processing is happening elsewhere. But I guess the debugger will reveal this soon enough.

bozhidar04:03:49

@gonewest818 I seem to recall something was amiss when debugging those handlers and the debugging wasn’t reliable then. Might be just my flimsy memory, but some classic print-style debugging might be a good idea just to be on the safe side. 🙂

gonewest81804:03:51

@bozhidar that’s what I’m now doing.

benedek11:03:46

@dpsutton @bozhidar debugged the test-all not running anything on windows. the root cause seems to be that orchard.NAMESPACE/ptoject-namespaces returns empty coll

benedek11:03:12

reason behind that, wait for it... wait for it...

benedek11:03:28

that project root returns c:\\data while stuff on the classpath is like C:\\data

benedek11:03:55

notice lower/upper case diff

benedek11:03:21

would you guys be open for a PR lowercasing both sides of the comparison in project-namespacesfunction?

bozhidar11:03:45

@benedek We should be careful what we lowercase, because Unix filesystems are case-sensitive.

bozhidar12:03:00

I guess we should do the lowercasing only on Windows.

benedek12:03:57

you are right ofc

tianshu12:03:50

it's there any plan to support cider with tools.deps?

bhauman13:03:34

@bozhidar cemerick is offering me commit and deploy rights for piggieback, I'm happy to do it, but I was wondering if you guys were interested?

bhauman13:03:50

seems like a better long term home for it

bhauman13:03:17

I'm happy to do myself of course

bozhidar14:03:19

@bhauman I was about to ask him on this ticket to make at least me a co-maintainer. As CIDER is one of the biggest users of nREPL I really want us to be able to make improvements ourselves here and there.

bozhidar14:03:33

> it’s there any plan to support cider with tools.deps?

bozhidar14:03:47

@doglooksgood That’s already done in 0.17 (the current development version).

bhauman14:03:41

@bozhidar well the easy path for now is to get commit and deploy rights for us both, and I'm thinking long term bring it over to clojure-emacs org

bozhidar14:03:48

That’d be great! :thumbsup:

tianshu15:03:40

@bozhidar Thanks, it works great. but the warning (start not in a clojure project) seems to be unnecessary.

bozhidar15:03:07

Maybe. I’ve been thinking about this as well. The warning is configurable and was added back in the day before CIDER would inject its dependencies automatically. I didn’t remove it mostly because generally people want to be starting a REPL for some project and sometimes might start it in the wrong folder accidentally.

bozhidar15:03:17

I’m open to ideas about what makes the most sense.

tianshu15:03:33

and I tried cider-jack-in-clojurescript, it also launched the REPL with command clojure. what is the progress on this? is it a good idea to use cider + tools.deps + cljs at this moment?

bozhidar15:03:59

It’s a great idea, but no one has implemented the dependency injection for ClojureScript. 🙂

bozhidar15:03:51

Basically cider-jack-in-clojurescript should add a few more libs to the dependency vectors - clojurescript, piggieback and some REPL like figwheel.

bozhidar15:03:55

It’s not a lot of work, but someone has to do it. 🙂

tianshu15:03:33

very curious about the direction about clojure develop tooling. seems like there's a lot of build tools for Clojure, now there's a new clojure command line. I think the choices between the editors and build tools become a problem for the newbie like me.

bozhidar15:03:24

Imagine how frustrating is this for tool writers. 😄 People constantly ask for adding support for more and more tools and it’s hard for us to catch up.

bozhidar15:03:01

But I think clojure is here to stay and we’ll certainly invest more efforts into supporting it better.

adamfrey18:03:04

I just realized that when you run cider-load-buffer the repl values for *1, *2 are not set. Is that by design?

(+ 1 1)
(assert (= *1 2))
^ this works when run sequentially with cider-eval-last-sexp, but not when running cider-load-buffer

gonewest81819:03:13

Looks like those are different by design. cider-load-buffer invokes the load-file middleware in tools.nrepl which seems to do load the entire buffer in a single shot. It’s not the same as typing in the repl or evaluating individual forms in the buffer.

gonewest81819:03:54

So it’s not particularly surprising that the *1 doesn’t evaluate properly when you load the entire buffer.

bhauman19:03:01

@bozhidar so @cemerick is on board with transferring piggieback to you guys

gtrak19:03:46

is this like a maintainence or consolidation plan? Just seeing bits and pieces (orchard)

gtrak19:03:31

I'm just curious what's sort of the new thing, also with the recent cljs churn

bhauman19:03:35

cemerick doesn't want it anymore

bhauman19:03:41

simple as that

bhauman19:03:14

clojure-emacs has the most nrepl code of any org right now and a vested interest so ...

richiardiandrea19:03:34

it would be a good thing imho

bhauman19:03:25

and piggieback is still a very good solution to this problem

dpsutton19:03:42

time to learn then i guess 🙂

bhauman19:03:44

just needs a few updates

gtrak19:03:47

yea, makes sense

gtrak19:03:48

last time I looked cljs repl, piggieback et al was really painful to work on with all the dynamic vars and path-munging etc, hoping that's getting better :-)

gtrak19:03:59

s/cljs repl/at cljs repl source/

dpsutton19:03:41

i've only glanced at that stuff briefly. but i just remember all of the signatures for cljs stuff is arg arg map-of-every-bit-of-compiler-state

bhauman19:03:35

its really not too crazy, you kinda have to understand all the parts before you appreciate it. It's more sensible than it appears

richiardiandrea19:03:58

@bhauman according to the many times I have run into this, Cljs' take on REPL is that if you need something fully-fledged you should implement your own ReplEnv or namespace for socket so I would really welcome positively a project containing all these

richiardiandrea19:03:14

Now piggieback contains only the browser REPL env

richiardiandrea20:03:05

I would add - as you know very well 🙂

bhauman20:03:20

this isn't actually true

bhauman20:03:45

it works with any repl env

richiardiandrea20:03:47

well it is more of a tunnel you are right

richiardiandrea20:03:04

let's call it a wrapper REPL env 😄

bhauman20:03:30

it provides a cljs.repl/repl compatible call and can use any repl-env

bhauman20:03:48

it has a repl env but thats because rhino sucks

bhauman20:03:10

its really not needed at all for any of the other environments

bhauman20:03:00

its just there to intercept calls in certain cases

gtrak20:03:32

the whole thing is extremely brittle and has a lot of moving parts. I guess I'm wondering if pulling all that into one project with its own shared process might help.

richiardiandrea20:03:13

It solves the particular problem of tunnelling evals from nrepl....I guess we need that. Until things like socker REPL and prepl will be adopted/supported

gtrak20:03:03

I never heard anything about this https://github.com/bhauman/lein-figwheel/issues/593 but this was my last experience.

dottedmag20:03:01

I have run cider-jack-in in a project with deps.edn, but without Leinginen or Boot, and got the following warning:

clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.4.0-SNAPSHOT and n/a, respectively.

dottedmag20:03:13

Should I add refactor-nrepl middleware explicitly?

gganley20:03:23

To my memory it’s automatically injected by CIDER, before I look up more did you update your packages?

dottedmag20:03:58

Hmm, I did not. Let me upgrade first.

gganley20:03:44

huh that n/a is quite concerning

dottedmag20:03:20

Yep, that's why I suspect that middleware was not injected at all.

gganley20:03:20

I don’t know how to phrase this properly but what does the modeline say when you run jack-in

gganley20:03:30

it should be included in *Messages*

dottedmag20:03:55

Starting nREPL server via /usr/local/bin/clojure -Sdeps '{:deps {org.clojure/tools.nrepl {:mvn/version "0.2.13"} cider/orchard {:mvn/version "0.1.0-SNAPSHOT"} cider/cider-nrepl {:mvn/version "0.17.0-SNAPSHOT"}}}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["cider.nrepl/cider-middleware"])'...
You can run the command ‘cider-jack-in’ with M-x c-jac RET
nREPL server started on 50586
[nREPL] Establishing direct connection to localhost:50586 ...
[nREPL] Direct connection to localhost:50586 established
Connected.  Clojure isn’t a language, it’s a building material.
?

dottedmag20:03:21

This is with up-to-date cider and clj-refactor

dottedmag20:03:23

refactor-nrepl middleware is enabled:

cider-jack-in-nrepl-middlewares is a variable defined in ‘cider.el’.
Its value is
("refactor-nrepl.middleware/wrap-refactor" "cider.nrepl/cider-middleware")

gganley21:03:01

It’s weird that it brings in Orchard

gganley21:03:47

L494 is the usage of this function and it doesnt include cider-jack-in-nrepl-middlewares