This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-22
Channels
- # announcements (11)
- # babashka (4)
- # beginners (98)
- # calva (18)
- # chlorine-clover (1)
- # cider (44)
- # clj-kondo (6)
- # clojure (61)
- # clojure-australia (4)
- # clojure-dev (4)
- # clojure-europe (132)
- # clojure-italy (5)
- # clojure-nl (4)
- # clojure-uk (31)
- # clojurescript (40)
- # community-development (8)
- # conjure (20)
- # data-science (1)
- # datomic (42)
- # defnpodcast (6)
- # emacs (3)
- # events (1)
- # fulcro (9)
- # graphql (2)
- # hugsql (1)
- # jobs (1)
- # malli (4)
- # off-topic (28)
- # pathom (27)
- # rdf (1)
- # re-frame (10)
- # reagent (4)
- # remote-jobs (1)
- # reveal (32)
- # sci (5)
- # shadow-cljs (18)
- # spacemacs (1)
- # tools-deps (62)
- # xtdb (4)
Getting a weird error when running cider-jack-in-clj
with a Clojure CLI deps.edn
project and using an alias with the -M
flag rather than the deprecated -A
flag (I've tried a few aliases with the same error). I have tried this with several versions of Clojure CLI tools installed, from 1.10.1.697 onwards.
Using the -A
flag does not give this error...
error in process sentinel: Could not start nREPL server: Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).
-Sdeps (No such file or directory)
CIDER 1.0.0snapshot (package: <tel:202009301242|20200930.1242>)
Update: In the #tools-deps channel I am asking if the -M
flag has issues when the -Sdeps
option is also supplied (as I cant seem to turn -Sdeps
injection for cider-jack-in-clj
off completely with variables in .dir-locals.el)Root cause:
When using a .dir-locals.el
file to set (cider-clojure-cli-global-options . "-M:env/test")
the -M
flag and aliase is placed before -Sdeps
when it should be placed after
clojure [clj-opt*] -M[:aliases] [init-opt*] [main-opt] [arg*]
-Sdeps
is an clj-opt (as shown when running clojure -h
in a terminal)
A working command line with the -M
flag and an :env/test
alias should look as follows:
/usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.8.2"} refactor-nrepl {:mvn/version "2.5.0"} cider/cider-nrepl {:mvn/version "0.25.3"}}}' -M:env/test -m nrepl.cmdline --middleware '["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"]'
The same positional rule applies for -A
flag, however, the -A
flag seems more flexible about following the rules.
As a temporary work-around I can use the universal argument (C-u in Emacs / SPC-u in Spacemacs) before calling cider-jack-in and manually edit the command line, putting the alias in the right position.
I still havent found a way to disable the -Sdeps
from being injected. I can configure for an empty deps list, but have not found a way to prevent the -Sdeps
option from being added, except by removing all arguments including the -M alias and -m main-namespace
I'e raised an issue and see if I can figure out a PR, although I got a little lost looking at the jack-in code last time.
https://github.com/clojure-emacs/cider/issues/2916Pull request to fix the Clojure CLI projects ordering of parameters https://github.com/clojure-emacs/cider/pull/2917
I am seeing the same error as @jr0cket, but using cider 20201020..1058 package
Root cause:
When using a .dir-locals.el
file to set (cider-clojure-cli-global-options . "-M:env/test")
the -M
flag and aliase is placed before -Sdeps
when it should be placed after
clojure [clj-opt*] -M[:aliases] [init-opt*] [main-opt] [arg*]
-Sdeps
is an clj-opt (as shown when running clojure -h
in a terminal)
A working command line with the -M
flag and an :env/test
alias should look as follows:
/usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.8.2"} refactor-nrepl {:mvn/version "2.5.0"} cider/cider-nrepl {:mvn/version "0.25.3"}}}' -M:env/test -m nrepl.cmdline --middleware '["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"]'
The same positional rule applies for -A
flag, however, the -A
flag seems more flexible about following the rules.
As a temporary work-around I can use the universal argument (C-u in Emacs / SPC-u in Spacemacs) before calling cider-jack-in and manually edit the command line, putting the alias in the right position.
I still havent found a way to disable the -Sdeps
from being injected. I can configure for an empty deps list, but have not found a way to prevent the -Sdeps
option from being added, except by removing all arguments including the -M alias and -m main-namespace
I'e raised an issue and see if I can figure out a PR, although I got a little lost looking at the jack-in code last time.
https://github.com/clojure-emacs/cider/issues/2916hey. how can I use cider to debug my code, I watch the doc, but found nothing I understand.
@steiner3044 debugging basics with Cider https://practicalli.github.io/spacemacs/debug-clojure/cider-debug.html
only difference is C-M-x
instead of , d b
to start
C-u C-M-x
with the cursor on a function will instrument that function. This adds breakpoints to that function.
Then evaluate a call to that function using the usual key bindings or command
A menu should appear above the instrumented function.
Use n
(next) to step through the evaluation of each expression or form in the function, using any arguments passed to that function.
C-u C-M-x it seems. I dont use the cider keybindings, but the keybinding is described in the docs
another question, how to set proxy in cider, cider-jack-in
failed because former proxy port is forbidden by me, and now I use a new port for proxy
eh, I am trying to debug in cider now, and I copy this code from doc:
(loop [i 0]
#break
(when (< i 10)
(println i)
(recur (inc i))))
but it throws me an error that
1. Caused by java.lang.RuntimeException
Unmatched delimiter: )
what's happening??ps: I am sure `
{:user {:plugins [[cider/cider-nrepl "0.9.0"]]}}
has been writen in my .lein/profile.clj
i can't believe it even works. remove that from lein profiles. if you use cider-jack-in
CIDER now makes sure the correct dependencies are added
no. don't add anything. if you use cider-jack-in
it will add it automatically. also, that version is from 2015 so you certainly shouldn't use that version in any case
but however, cider-toggle-trace-var
only works when [cider/cier-nrepl] writen in .lein/profile.clj
CIDER needs cider-nrepl
on the classpath. if you remove that from your lein profiles, but you use cider-jack-in
CIDER will add the correct version for you on startup
/Users/dan/bin/lein update-in :dependencies conj \[nrepl\ \"0.8.2\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.25.3\"\] -- repl :headless :host localhost
is an example of the way that CIDER starts up a lein project. as you can see, it includes the correct recent version of cider-nrepl for all features of CIDER to work correctly
if you are starting your project in another manner then you are responsible for ensuring the dependencies are on the classpath. I'd recommend a profile and then lein with-profile +name-of-the-profile
that includes the dep [cider/cider-nrepl "0.25.3"]
or the most recent version of cider-nrepl
user-error: 'cider-toggle-trace-var' requires the nREPL op "toggle-trace-var" (provided by cider-nrepl)
at the top of the repl buffer do you see something like: ;; Startup:
with a big command after it? can you post that?
hold on please, I install it from apt, now I want to build it from source, just for fun, can I do it??
and in general, never put stuff in lein/profiles. Use a profile in the project or let CIDER manage it for you
one more question  how can I do like this?? I copy it in my emacs, but find it not stop
and this is Startup message
;; Connected to nREPL server -
;; CIDER 1.0.0-snapshot, nREPL 0.8.2
;; Clojure 1.8.0, Java 11.0.8
;; 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;
;; ======================================================================
;; If you're new to CIDER it is highly recommended to go through its
;; user manual first. Type <M-x cider-view-manual> to view it.
;; In case you're seeing any warnings you should consult the manual's
;; "Troubleshooting" section.
Pull request to fix the Clojure CLI projects ordering of parameters https://github.com/clojure-emacs/cider/pull/2917