Fork me on GitHub
#cider
<
2022-01-16
>
stardiviner04:01:44

[BUG] I found I canโ€™t complete library namespace after require or import with latest version CIDER CIDER 1.3.0-snapshot (package: 20220113.610) . I tried to use old git source code commit version cider, still not working.

๐Ÿ‘€ 1
vemv04:01:44

could you report it on github as detailedly as possible? thanks!

stardiviner04:01:47

Sure. I originally message here to confirm whether itโ€™s a bug. I will report bug on github.

bozhidar08:01:45

I can't think of any recent changes in this area, but it's always possible there's some regression.

Nom Nom Mousse13:01:50

I have a program that relies on futures a lot. If I set a #break in a future will it still work?

Charles Comstock23:01:51

I've recently started to have problems with Cider and CLJS after updating to the latest Cider. After the application loads and it kicks off the nested Figwheel repl, the page loads, and is functioning (ie CLJS compiled), but just after it completes a "Exception updating the ns-cache" shows up in the repl output. Specifically it's triggering an NPE by way of cider.nrepl.inlined_deps.orchard.v0v9v0.orchard.cljs.analysis$all_ns. The repl is still running but it throws the NPE about updating the ns-cache even if I try to execute (+ 1 2). I'm happy to submit a detailed bug report, but am not sure if it should be against Cider, cider.nrepl, or orchard? I've been using this setup daily for the past year without any issue like this, so it's certainly possible I changed a config somewhere, but seems highly suspect it's related to some change in the Cider update. Anyone else encountering something like this?

Charles Comstock00:01:30

Here is a more detailed example of the output in the repl buffer: https://gist.github.com/dgtized/aa046d06c921d4cb9f7dc51ea2729459.

vemv00:01:48

We changed that code very recently. Looks like something was nilable whereas we didn't expect so. We'll be fixing it within ~1 day Thanks much for the report ๐Ÿ™

Charles Comstock00:01:24

You are welcome, thanks for taking a look so quickly!

vemv00:01:06

I realise this might be somewhat hard but do you have it possible to jump to cider.nrepl.inlined_deps.orchard.v0v9v0.orchard.cljs.analysis and add a println in line 12? https://github.com/clojure-emacs/orchard/blob/febf8169675af1b11a8c00cfe1155ed40db8be42/src/orchard/cljs/analysis.cljc#L12 In [ns-sym ns] , ns-sym is clearly nil, however I'm curious about ns

Charles Comstock00:01:18

Jump to mechanism is broken because of the error, but I guess could try to set that up as a local repo dependency temporarily? Though not quite sure what I would exclude as it's supposed to be an inline from the injected nrepl right? Sorry happy to try, but a little unsure how to start?

vemv01:01:59

note that the ns is jvm clojure, is jvm interaction broken as well?

Charles Comstock01:01:56

So I tried adding cider/orchard {:local/root "../../upstream/orchard/"} to my deps.edn after placing it there and making println the change, however, I'm getting the following error: error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Error building classpath. Manifest type not detected when finding deps for cider/orchard in coordinate #:local{:root "/home/clgc/code/upstream/orchard"}. Is it expecting a pom.xml file or something? I will double check on jvm alone, AFAIK that was working.

Charles Comstock01:01:12

Confirmed that CIDER is working fine on a tiny project that is only using Clojure, no CLJS. So it looks like it's CLJS specific?

vemv01:01:35

yes it's definitely cljs specific

vemv01:01:04

having a local checkout is pretty difficult, because we use "mranderson" to add prefixes to namespaces ... make install installs Orchard to your ~/.m2 with the mranderson stuff if you're willing to give it a shot

vemv01:01:41

but honestly it's no big deal, mostly I seek to gain understanding of what's going on, which is not crucial, I can just use some-> :)

Charles Comstock01:01:43

Ok and then I would roll back the local/root change?

๐Ÿ‘ 1
vemv01:01:33

mmm make install will not work, sorry for the noise. let's leave it at that, I'll add that some->

Charles Comstock01:01:14

Gotcha, yea I was trying adding a manual deps.edn to orchard root but it didn't seem to override it correctly

Charles Comstock01:01:44

Appreciate it might have it's own problems getting setup, but https://github.com/dgtized/shimmers is CLJS project I was having trouble with. Don't know if that helps for diagnosis at all, but if it helps.

vemv01:01:26

๐Ÿ‘€ if I run bin/repl can I expect to repro this?

Charles Comstock01:01:36

no if you cider-jack-in-cljs

Charles Comstock01:01:51

bin/repl I believe is working, will double check

Charles Comstock01:01:21

bin/repl is working but it's just setting up the figwheel repl and not doing any of the cider/piggieback handshake which is where this is failing I think. I don't know if I explained that well before but the CLJS builds, it launches the page but then a second or so later the exception triggers, so I don't think it's happening until piggieback starts trying to talk to the page in the browser?

vemv01:01:34

I'll see if I can repro using the repo else no issue :)

Charles Comstock01:01:46

I can also trigger it by running /usr/local/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.9.0"} cider/piggieback {:mvn/version "0.5.2"} refactor-nrepl/refactor-nrepl {:mvn/version "3.2.0"} cider/cider-nrepl {:mvn/version "0.28.0"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware,cider.piggieback/wrap-cljs-repl]"]}}}' -Mdev:cider/nrepl from the commandline, and then connecting with cider-connect-cljs. However it fails the same way after it compiles and kicks off figwheel to host the page. It brings up the prompt and then gives the NPE. So again I think that means it's only happening once it starts trying to talk with the browser repl. Thank you so much, happy to provide any other information that might help.

Charles Comstock01:01:14

(to clarify, "it starts trying to talk with the browser repl", the it is not figwheel/clojurescript, but Cider/orchard and associated tools)

vemv01:01:00

alright! so unfortunately my cider.el setup is really old so cider-connect-cljs won't work for me with a modern stack Anyway here's the fix, should be released within a day https://github.com/clojure-emacs/orchard/pull/148

Charles Comstock01:01:11

Cool, thank you so much!

Charles Comstock01:01:47

In the meantime, should I just try rolling back orchard to the previous release or something? Or is it more in something that uses that?

Charles Comstock01:01:56

(also can wait, just curious if there is a workaround)

vemv01:01:21

yes, but it's not orchard that you have to rollback but cider-nrepl

vemv01:01:33

because c-nrepl bundles orchard via "mranderson"

Charles Comstock02:01:51

gotcha, thanks. I tried overriding

(setq cider-required-middleware-version "0.27.4"
      cider-injected-middleware-version "0.27.4")
But that doesn't seem to update the version requested at connection as it's still requesting 0.28.0. So I must not be modifying the right values to force the older cider-nrepl. Anyway thanks for all your help, I guess I will just wait for the fix.

vemv02:01:12

cider-injected-middleware-version should work. It doesn't, of course, if you will use cider-connect over a process you spawned yourself

Charles Comstock02:01:39

oh right that makes sense, I will try that, thank you

Charles Comstock18:01:34

Oh! I figured it out:

(setq cider-required-middleware-version "0.27.4"
      cider-injected-middleware-version "0.27.4")

(cider-add-to-alist 'cider-jack-in-lein-plugins
                    "cider/cider-nrepl" cider-injected-middleware-version)
Just updating cider-injected-middleware-version is insufficient, because the add-to-alist update to 'cider-jack-in-lein-plugins is top level and only execute on initial require. I think it might make sense to force the add-to-alist calls to recompute just prior to running jack-in if they depend on a defcustom variable. Anyway I will submit an issue or see if I can dust off a PR to address it

vemv18:01:09

Got it! I think we introduced one of those defcustoms just a few months ago so yeah it's not impossible that it doesn't really work. PR welcome

Charles Comstock19:01:34

Ooph, that's kinda gnarly in there, I documented it in https://github.com/clojure-emacs/cider/issues/3133, and will think on if there is a clean PR to address.

Charles Comstock19:01:29

Thanks so much for your help again though!