This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-04-22
Channels
- # announcements (1)
- # beginners (27)
- # calva (11)
- # cider (37)
- # clj-kondo (44)
- # clojure-europe (14)
- # clojure-nl (1)
- # clojure-norway (6)
- # clojure-uk (4)
- # clojurescript (6)
- # cursive (17)
- # data-science (1)
- # datomic (27)
- # duct (4)
- # events (1)
- # fulcro (3)
- # graphql (14)
- # lingy (3)
- # lsp (1)
- # malli (16)
- # off-topic (23)
- # portal (19)
- # reitit (10)
- # releases (2)
- # ring (4)
- # ring-swagger (2)
- # scittle (22)
- # shadow-cljs (33)
- # sql (19)
- # testify (1)
Hello I'm experiencing some weirdness with enrich-classpath + flowstorm. I've added flow-storm support to my project like this:
{:extra-paths ["dev" "test"]
:extra-deps
{,,,
com.github.flow-storm/clojure {:mvn/version "1.11.2-4"}
com.github.flow-storm/flow-storm-dbg {:mvn/version "3.15.2"}}
;; for disabling the official compiler
:classpath-overrides {org.clojure/clojure nil}
:jvm-opts ["-Dclojure.storm.instrumentEnable=true"
"-Dclojure.storm.instrumentOnlyPrefixes=ingenieriauno.rsb."]}
If I disable enrich-classpath, the connection string is this:
/usr/bin/clojure -Sdeps \{\:deps\ \{nrepl/nrepl\ \{\:mvn/version\ \"1.0.0\"\}\ cider/cider-nrepl\ \{\:mvn/version\ \"0.45.0\"\}\ refactor-nrepl/refactor-nrepl\ \{\:mvn/version\ \"3.10.0\"\}\}\ \:aliases\ \{\:cider/nrepl\ \{\:main-opts\ \[\"-m\"\ \"nrepl.cmdline\"\ \"--middleware\"\ \"\[refactor-nrepl.middleware/wrap-refactor\,cider.nrepl/cider-middleware\]\"\]\}\}\} -M:dev:cider/nrepl
And at the REPL:
dev> *clojure-version*
{:major 1, :minor 11, :incremental 2, :qualifier "4"}
But if I enable enrich-classpath, the connection string is now:
;; Startup: bash /home/fvides/.config/emacs/elpa/cider-1.13.1/clojure.sh /usr/bin/clojure -Sdeps \{\:deps\ \{nrepl/nrepl\ \{\:mvn/version\ \"1.0.0\"\}\ cider/cider-nrepl\ \{\:mvn/version\ \"0.45.0\"\}\ refactor-nrepl/refactor-nrepl\ \{\:mvn/version\ \"3.10.0\"\}\}\ \:aliases\ \{\:cider/nrepl\ \{\:main-opts\ \[\"-m\"\ \"nrepl.cmdline\"\ \"--middleware\"\ \"\[refactor-nrepl.middleware/wrap-refactor\,cider.nrepl/cider-middleware\]\"\]\}\}\} -M:dev:cider/nrepl
dev> *clojure-version*
{:major 1, :minor 11, :incremental 1, :qualifier nil}
dev>
It looks like the clojure.sh scripts somehow affects the clojure version used, which causes problems using flow-storm (many thanks to @jpmonettas for his support).looks related to the creation of a new classpath in this function https://github.com/clojure-emacs/enrich-classpath/blob/f3244ba4ff2282e5ac30a701fa38b0944d75eb00/tools.deps/src/cider/enrich_classpath/clojure.clj#L18 not taking into account this clojure classpath overrides
will take a deeper look at it in a couple of hours
Given you're not running cider-nrepl latest, maybe you're not running cider latest either? Or try to determine the enrich-cp version
I was running with 1.19.0
dang, but now I can't reproduce, with the latest
@UM4CBJVLZ can you try with the latest cider, it looks like it is fixed there
This ended up being my startup log :
;; Connected to nREPL server -
;; CIDER 1.14.0-snapshot (package: 20240421.1419), nREPL 1.1.1
;; Clojure 1.11.2-4, Java 17.0.10
;; Docs: (doc function-name)
;; (find-doc part-of-name)
;; Source: (source function-name)
;; Javadoc: (javadoc java-object-or-class)
;; Exit: <C-c C-q>
;; Results: Stored in vars *1, *2, *3, an exception in *e;
;; Startup: bash /home/jmonetta/.emacs.d/elpa/cider-20240421.1419/clojure.sh /usr/local/bin/clojure -Sdeps \{\:deps\ \{nrepl/nrepl\ \{\:mvn/version\ \"1.1.1\"\}\ cider/cider-nrepl\ \{\:mvn/version\ \"0.47.0\"\}\ refactor-nrepl/refactor-nrepl\ \{\:mvn/version\ \"3.10.0\"\}\}\ \:aliases\ \{\:cider/nrepl\ \{\:main-opts\ \[\"-m\"\ \"nrepl.cmdline\"\ \"--middleware\"\ \"\[flow-storm.nrepl.middleware/wrap-flow-storm\,refactor-nrepl.middleware/wrap-refactor\,cider.nrepl/cider-middleware\]\"\]\}\}\} -M:dev:cider/nrepl
So, Cider 1.14, it is wrapping the enrich script but it is also loading ClojureStorm 1.11.2-4oh, but I run it again after changing some deps and now :
;; Connected to nREPL server -
;; CIDER 1.14.0-snapshot (package: 20240421.1419), nREPL 1.1.1
;; Clojure 1.11.1, Java 17.0.10
;; Docs: (doc function-name)
;; (find-doc part-of-name)
;; Source: (source function-name)
;; Javadoc: (javadoc java-object-or-class)
;; Exit: <C-c C-q>
;; Results: Stored in vars *1, *2, *3, an exception in *e;
;; Startup: bash /home/jmonetta/.emacs.d/elpa/cider-20240421.1419/clojure.sh /usr/local/bin/clojure -Sdeps \{\:deps\ \{nrepl/nrepl\ \{\:mvn/version\ \"1.1.1\"\}\ cider/cider-nrepl\ \{\:mvn/version\ \"0.47.0\"\}\ refactor-nrepl/refactor-nrepl\ \{\:mvn/version\ \"3.10.0\"\}\}\ \:aliases\ \{\:cider/nrepl\ \{\:main-opts\ \[\"-m\"\ \"nrepl.cmdline\"\ \"--middleware\"\ \"\[flow-storm.nrepl.middleware/wrap-flow-storm\,refactor-nrepl.middleware/wrap-refactor\,cider.nrepl/cider-middleware\]\"\]\}\}\} -M:dev:cider/nrepl
it loads Clojure 1.11.1 :thinking_face:The deftests above are easy to extend with real and isolated deps.edn files, feel free to contribute a repro
this dep is what seems to break it :
io.github.nubank/morse {:git/tag "v2023.10.06.02" :git/sha "88b5ff7"}
if I remove it it workssure, I'll take a deeper look after lunch and try to figure it out
FWIW I also confirm that the bug is still present after updating to last cider version.
it works for me after that change
the problem shows up when we use libs with git coordinates
added a small description of the issue on the PR desc
there are also some possibly problematic lines, like this https://github.com/clojure-emacs/enrich-classpath/blob/master/tools.deps/src/cider/enrich_classpath/clojure.clj#L123 which only add exclusions to maven libs
Let's just say that clojure.clj is not my most favorite program 😄 it was simpler originally... Any fix with a repro that can be run in the existing test suite can be merged.
I just updated the tests, testing to see it still works
and it didn't, some timed-out test is failing :thinking_face:
ok, done @U45T93RA6, amended the commit with the updated test
We got a Clojars deployment whoopsie so we'll have to wait ~1d till it's all available
(you can (setq cider-enrich-classpath nil)
in the meantime)
Enrich 1.19.2 is now released. CIDER latest (Git master or melpa unstable) already includes it