This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-10-05
Channels
- # announcements (19)
- # babashka (28)
- # beginners (62)
- # biff (3)
- # calva (19)
- # cider (24)
- # clj-kondo (8)
- # cljdoc (15)
- # clojure (32)
- # clojure-europe (16)
- # clojure-nl (1)
- # clojure-norway (17)
- # clojure-uk (8)
- # clojuredesign-podcast (26)
- # cursive (64)
- # datomic (43)
- # deps-new (1)
- # fulcro (4)
- # honeysql (1)
- # hyperfiddle (46)
- # kaocha (16)
- # lsp (15)
- # missionary (51)
- # music (1)
- # nbb (4)
- # off-topic (55)
- # pedestal (11)
- # podcasts-discuss (1)
- # polylith (7)
- # practicalli (1)
- # releases (4)
- # shadow-cljs (120)
- # tools-build (34)
- # vscode (1)
- # xtdb (2)
Struggling a bit with deps.edn and cider. Have not had any problems with it earlier. Any reason why extra deps
…
:aliases
{:dev
{:extra-paths ["dev"]
:extra-deps {integrant/repl {:mvn/version "0.3.3"}}}
…
gives java.io.FileNotFoundException could not locate ...
, and is therefore not available on classpath from ROOT/dev/user.clj? (Using Emacs+Cider, starting REPL with -A:dev). It used to work so smoothly, iirc — it’s been a while.
Output from clj -X:deps list :aliases '[:dev]'
:
$ clj -X:deps list :aliases '[:dev]'
...
integrant/integrant 0.8.1 (MIT)
integrant/repl 0.3.3 (MIT)
...
What am I missing?what's the actual error you're seeing? could not locate ... what?
2. Unhandled clojure.lang.Compiler$CompilerException
...
1. Caused by java.io.FileNotFoundException
Could not locate integrant/repl__init.class, integrant/repl.clj or
integrant/repl.cljc on classpath.
can you paste the clojure command that cider is running? it will show it when it starts the repl
/opt/homebrew/bin/clojure -Sdeps \{\:deps\ \{nrepl/nrepl\ \{\:mvn/version\ \"1.0.0\"\}\ cider/cider-nrepl\ \{\:mvn/version\ \"0.38.1\"\}\ refactor-nrepl/refactor-nrepl\ \{\:mvn/version\ \"3.9.0\"\}\}\
\:aliases\ \{\:cider/nrepl\ \{\:main-opts\ \[\"-m\"\ \"nrepl.cmdline\"\ \"--middleware\"\ \"\[refactor-nrepl.middleware/wrap-refactor\,cider.nrepl/cider-middleware\]\"\]\}\}\} -M:cider/nrepl -A:dev
that -A:dev has to be before the -M to take effect
yeah that is weird, mine puts all the aliases in -M
-M (and -X and -T) consume all args after them
combining into -M would be better :)
Ohh... is that new? Or have I somehow, for unknown reasons, just imagined it working before. Testing...
not new, has been like that for al ong time
yeah, I normally have a .dir-locals.el on each project with at least :
((clojure-mode . ((cider-clojure-cli-aliases . "dev:dev-tools:storm"))))
that will allow different aliases for different projects, now if you want to try that remember that this vars are set when you open a buffer, so you will have to re-open the buffers after creating that .dir-locals.el (just the first time)
Aliases should start with a colon btw (not critical, and cider fixes it if missing)
In Alex' words:
> aliases should always use :
> in some cases, aliases without colons are tolerated (but don't do that)
btw your problem is a usual one for tools.dps - not the best UX from CIDER's side. Today I put an improvement in the hammock: https://github.com/clojure-emacs/cider/issues/3497#issuecomment-1748510919
To be fair, there is a warning about using -M and not -A. That's on me. But the issue comment looks like it could bring some improvement to the UX, indeed.
https://practical.li/spacemacs/clojure-development/project-configuration/ has examples of using .dir-locals.el
with Clojure CLI aliases and other variables, also covers the basic syntax.
In Emacs, the universal argument, i.e. C-u
can be used before calling jack-in to check the command that will be used to jack-in (and edit it if required)
ℹ️ cider-nrepl 0.39.0, as bundled with CIDER latest (Git master
/
snapshot) bundles refinements in the https://docs.cider.mx/cider/indent_spec.html#indentation-inference feature, such that it will work better with def-like and threading macros.
It also powers something else which will be demoed tomorrow 👀
