This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-03
Channels
- # adventofcode (107)
- # announcements (1)
- # asami (14)
- # babashka (67)
- # beginners (89)
- # calva (34)
- # cider (17)
- # clj-kondo (5)
- # cljs-dev (2)
- # clojure (57)
- # clojure-europe (52)
- # clojure-india (1)
- # clojure-italy (1)
- # clojure-losangeles (2)
- # clojure-nl (6)
- # clojure-uk (39)
- # clojurescript (40)
- # community-development (3)
- # conjure (3)
- # cursive (17)
- # datomic (11)
- # docker (13)
- # events (3)
- # figwheel-main (3)
- # fulcro (12)
- # graalvm (7)
- # holy-lambda (7)
- # honeysql (9)
- # introduce-yourself (5)
- # malli (9)
- # minecraft (3)
- # missionary (21)
- # nextjournal (7)
- # off-topic (52)
- # pathom (3)
- # polylith (11)
- # portal (3)
- # re-frame (21)
- # reagent (34)
- # reclojure (7)
- # reitit (1)
- # reveal (11)
- # shadow-cljs (68)
- # tools-build (12)
- # tools-deps (5)
- # vim (4)
- # xtdb (9)
Hello I am having trouble jacking in to a polylith project (not sure if it is due to it, I am new to the project). The trouble is actually that no dependencies are being loaded so getting things like: Could not locate io/pedestal/http__init.class, io/pedestal/http.clj
.
The jack-in startup string is this:
/usr/local/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.9.0-beta5"} refactor-nrepl/refactor-nrepl {:mvn/version "3.1.0"} cider/cider-nrepl {:mvn/version "0.27.2"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}}}' -M:cider/nrepl -A:dev:test
If I try to connect by launching a command line process with this string, then everything works fine:
clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version,"0.8.3"},cider/cider-nrepl {:mvn/version,"0.27.2"}}}' -A:dev:test -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
Can anyone help me figure out what is going on?i don’t think this can work: -M:cider/nrepl -A:dev:test
. If you use a prefix arg with jack in you can edit the string. If you instead edit it to be -M:dev:test:cider/nrepl
does it work?
Would work if you swapped the order -M and -X consume all arguments after them so -A should go prior to be used
But putting them all with -M is better
ah that’s right. I think i used to prefer the “aliases” and then “main” style but it doesn’t really matter. and it gets confusing because -A
still allows for main args from an alias so it doesn’t do what i thought it was doing anyways
once that is confirmed, i think you can set
(defcustom cider-clojure-cli-aliases
nil
"A list of aliases to include when using the clojure cli.
Should be of the form `foo:bar`. Any leading \"-A\" or \"-M\" will be
stripped as these are concatenated into the \"-M[your-deps]:cider/nrepl\"
form."
:type 'string
:group 'cider
:safe #'stringp
:package-version '(cider . "1.1"))
to include those and it will work it outThanks, this works indeed (pretty new to tools.deps as well)
So then I can do cider-jack-in-clj
? I am trying that without luck. I have the .dir-locals.el
in the same directory as my deps.edn
(never used .dir-locals.el
so I am not sure if I am doing something wrong)
I see this error though: Error reading dir-locals: (wrong-type-argument listp "dev:test")
i think
((nil
(cider-clojure-cli-aliases . "dev:drivers:drivers-dev:ee:ee-dev:user")))
is a full one you can useit’s an alist of modes to overrides. use nil to say “all modes”, and the override is the cli alias is “dev:test”
then you just cider-jack-in-clj. That’s the point of the dir-locals, in directories, these variables will be set.
Thanks a lot @dpsutton