Fork me on GitHub

java -jar ".calva\deps.clj.jar" -Sdeps "{:deps {nrepl/nrepl {:mvn/version,""0.8.3""},cider/cider-nrepl {:mvn/version,""0.26.0""}}}"  -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"


WARNING: Implicit use of clojure.main with options is deprecated, use -M


what is this warning when running calva repl?


@fabrao It's a warning from the CLI -- deps.clj is a Java version of the Clojure CLI -- and it is deprecated to use -m without -M now.


(has been for ages)


(! 1116)-> clojure -m simple.clj
WARNING: Implicit use of clojure.main with options is deprecated, use -M


@seancorfield I don’t really understand its usage completely. The documentation for it says -M[aliases] Use concatenated aliases to modify classpath or supply main opts, so it looks related to using aliases, but I see in the deps and CLI guide an example of it being used without aliases, like so: clj -M -m hello. I confirmed that adding -M before -m in Calva’s jack-in command (at least the one I copied from a simple project), doesn’t trigger the warning. Can you explain its usage?


For everyone's information we have deferred this fix on purpose as a way to be backwards compatible to older versions of the CLI tools. It's probably time to drop that, but anyway. See:


I was looking for that issue! Thanks for linking.


Yeah, it's definitely a tricky one if you're trying to support "ancient" CLI versions. Several of my projects have very clear minimum CLI versions listed on their README but I still field questions from folks trying to use much older versions. Given the way the CLI has evolved, there's no backward compatible way to support everything: -M on older versions did not respect :extra-deps or :extra-paths in aliases (only :main-opts), -A for running clojure.main stuff is deprecated and produces a warning (and will stop running clojure.main at some point and only start a REPL), using clojure.main implicitly (without -M) is deprecated and produces a warning (all will also stop working at some point because the default behavior is/will be the same as -A).


It has been just over a year now since all that came in -- September 25, 2020 -- and then all the tooling stuff changed a bunch of stuff too (July 28, 2021). I think at some point you'll just have to draw a line in the sand and say "Requires Clojure CLI version x.y.z or higher" and just make it very clear.


clojure -version would be the "obvious" thing to check, but that was only added in (Feb 19, 2021) and prior to that it throws an exception 😞


clojure -Sdescribe is pretty safe -- it's been there since day one, I think, but I think it returns unreadable data on Windows on older versions so you can't just EDN parse it but regex should work to isolate :version "x.y.z" in the output.


Here's output from the July 17, 2020 version:

(! 716)-> /usr/local/Cellar/clojure\@ -version
Execution error (FileNotFoundException) at (
-version (No such file or directory)

Full report at:

(! 717)-> /usr/local/Cellar/clojure\@ -Sdescribe
{:version ""
 :config-files ["/usr/local/Cellar/[email protected]/" "/Users/sean/.clojure/deps.edn" ]


Dunno if that helps but happy to help explain/test anything you need on historical versions since I have pretty much every single version installed -- both prerelease and stable -- since


Since introduces a new config attribute :repl-aliases (and the -M warning), it's been used as crude version test here:


Thanks for the offer to access your suite of clojure versions, @seancorfield! We don’t really have an ambition to support ancient versions, though. As you are known to have said: “There is no way jack-in can be made to work for all cases” (sorry if I am butchering the original quote). We just thought that @U05254DQM’s suggestion to hold off getting rid of the warning some time, while projects upgraded, was great. But now it’s time to move on and stop confusing our users with a warning they. should ignore.


@U04VDTMKU I had to go look that up in the source code! TIL: -A is the shorthand for --repl-aliases 🙂


["-R" "--resolve-aliases ALIASES" "Concatenated resolve-deps alias names" :parse-fn parse/parse-kws]
   ["-C" "--makecp-aliases ALIASES" "Concatenated make-classpath alias names" :parse-fn parse/parse-kws]
   ["-A" "--repl-aliases ALIASES" "Concatenated repl alias names" :parse-fn parse/parse-kws]
   ["-M" "--main-aliases ALIASES" "Concatenated main option alias names" :parse-fn parse/parse-kws]
   ["-X" "--exec-aliases ALIASES" "Concatenated exec alias names" :parse-fn parse/parse-kws]
   ["-T" "--tool-aliases ALIASES" "Concatenated tool alias names" :parse-fn parse/parse-kws]
(although the first two are deprecated)


Ha yeah. Its existence offers a pretty clean version distinction then.


That's an old ticket I raised, feel free to close if you have a resolution that works for your users. If I remember correctly, the two challenges I had were 1) I couldn't specify the flags to use, i.e -M for repl stuff 2) user wide aliases were painful to use as extra config was needed per alias (and at the time it didn't like aliases with hyphens in the name) As someone who uses a lot of user level aliases, I always preferred to use calva connect. jack-in felt too limited for my needs. I appreciate I'm probably not the target audience for calva though, so please do what's best for your users.


I’ve only really considered the warning part of that ticket, @U05254DQM. You are welcome to raise separate tickets for the other concerns. We can do it ourselves, of course, but we might lose details in the translation. Specifically I don’t understand this one: > typing in `-M:alias-name` Where are you typing that in?


Generally, we do support changing options these days. We’ve added a command for copying the jack-in command and use that as a start for a workflow where you start the REPL yourself and then connect to it.


-M = clojure.main, -m is an option to clojure.main


-X = exec function


-A = start a REPL -- for historical reasons this also currently runs :main-opts but it will stop doing that "soon".


@brandon.ringe I gather you're not in #tools-deps?


I am, but have not been following along there. 😄


Thanks for the explanation.


This is just "standard" Clojure CLI stuff and it's documented on Pretty much all of this came in a year ago


(and then was the next big update with "tools" usage/support)


It's a bit frustrating but it shows that somehow the core team haven't really managed to communicate a lot of what they've been doing for the last year or two 🙂


I've been "Team CLI" since 2018 -- and haven't really touched lein since 2015 now (I was "Team Boot" for a while there) -- so it's hard to know what people don't know...


Wow that’s interesting stuff. Yeah I’ve been team CLI for some time, but obviously my usage of it has been narrow. I knew it was getting upgrades though.


I believe I listened to a podcast interview with you some time ago in which you mentioned using the CLI for all projects or switching all projects over to it at your job. If I wasn’t convinced by that time you may have played a role in convincing me I didn’t need lein. 😄


The CLI/`deps.edn` is extremely capable, especially with now.


Now, if only we could banish nREPL in favor of the built-in Socket REPL... 🙂


This is something I’ve been interested in exploring more, at least from a tooling perspective, though to be fair, I don’t have much of a problem with nREPL. I think that some (maybe much) of the functionality has been pulled out into orchard, so maybe it can be easily used from socket REPLs. Anyway, comments like yours make me want to learn more about socket REPLs and the differences in capabilities and functionality between them and nREPL.


My main issue is that I want to be able to connect my editor to a running process that has no specific dependencies but was started with a JVM option to tell Clojure to start a Socket REPL. I connect my editor to remote processes, so the editor has to be able to work without any server-side dependencies.


Clover side-loads a small blob of code to enable unrepl (which has its own problems) and I'm willing to live with that compromise -- but I really would prefer it not inject code into my QA/production processes for obvious reasons!


There's been talk for ages of nREPL being able to side-load itself over a bare Socket REPL but the amount of code in that equation definitely bothers me.


The main issue, I think, with a bare Socket REPL (or even a pREPL) is that you can't interrupt evaluation, and it's a pure stream, so it interleaves stdout and results (pREPL solves that problem to some extent) and you get the entire result back -- so evaluating (range) locks things up.


Again, unrepl has a "solution" to this but it causes its own problems -- @U3Y18N0UC has battled unrepl a lot during the history of Chlorine/Clover.


I see. It will be interesting to see where things go with regards to REPL tooling.



Yuner Bekir05:10:17

Is the ctrl+k a new command? It interferes with ctrl+k ctrl+c for commenting lines of code


Yes, it’s new. I didn’t know about ctrl+k ctrll+c and now I realize that a lot of cmd+k chords actually are ctrl+k on Windows… We’ll need to fix that. In the meantime, rebind the Kill Right command to some other shortcut (or remove the binding). And please file an issue about this.

👍 1

Hi @U0ETXRFEW I can work on it. What chord should it be bound to?

🙏 1

That’s the crazy thing, it should of course be ctrl+k the universal delete right. What on earth was going through the heads of the VS Code team hogging it for other things??? I think they are all Mac users and just goofed this one. 😃


We should do some research around default Windows VS Code bindings. But if ctrl+alt+k is free, maybe that. And then shift+ctrl+alt for Select Right, WDYT?


I'll defer to you. I use VS Spacecode so probably in the minority.


Will investigate what the defaults are on windows.


@U0ETXRFEW so ctrl+alt+k is free. ctrl+shift+alt+k is used for Calva Paredit: Drag Sexp Forward Up. so not sure how we can keep a similar mnemonic


Hahaha, I actually use that a lot!


I wonder if ctrl+e is bound to something interesting on Windows…


I now realize we should have this discussion on the issue:

👍 1

Dear Calva friends: I’d like to promote the use of threads for discussions in this channel. Because a major use of it is support. Keeping several discussions and support questions out in the main flow adds risk that a particular support question is missed. It is also much easier to consume a particular support question and its follow-ups as a thread.

👍 14

I just can't get calva to run my tests 😥 Whatever I try it says always No tests found. :scream:, ns: 0, vars: 0 In my clojure-lsp.out I can find the line Automatically resolved source-paths from project.clj: #{"turbod/test" "turbod/src" "turbod/dev"} which are the correct source paths. Anyone any idea what I can do to debug this?


Clojure-lsp has nothing related with repl, maybe you didn't eval the namespace?


I did eval the namespace. And I am not trying to run the tests from the repl, that actually works. I am trying to use calvas test runner (e.g. [Ctrl + Alt + C T]) (the lsp output I was just mentioning because it says here that I may have to add source paths to .lsp/config.edn )


Cider-nrepl is used to find and run tests. I’m guessing clojure-lsp is used somehow with the feature for switching between related test and source files. (I didn’t implement that feature.) Is this Clojure (not ClojureScript) code you are trying to run tests for? The test runner only works for Clojure.


If you keep having issues, please create a GitHub issue and link to a repro with a project we can reproduce the issue with, and list your repro steps.


yes its clojure


yes thanks, trying to reproduce it on a fresh small dummy project would be my next step. If I find a simple way to reproduce it I will create an issue. I was just hoping that maybe anyone has any idea on how I could potentially debug the issue. Some logs or similar to see what is actually going on


BTW clojure-lsp has no feature to switch between tests and source-path, yet :)

👍 1

Did you also load the test namespaces, @U06BCCQPL?


yes. I did the following: • opening the test namespace • being with the cursor on the actual test that I would like to run • [Ctrl + Alt + C Enter] to load the namespace • [Ctrl+Alt+C Ctrl+Alt+T] to run the current test Then I see in the REPL the message: No tests found. :scream:, ns: 0, vars: 0


Actually it says:

; Running test: test-encryption…
; No tests found. 😱, ns: 0, vars: 0


Yeah, I am a boomer who likes smileys 😃


What happens if you evaluate the test symbol?




In any case, if you can create a minimal repro, that would be awesome. We get quite a lot of reports about troubles running tests, so I suspect there is something we need to fix, but I never quite can reproduce the problems myself.


(test-encryption) ; => nil


@U0ETXRFEW Do we know why .lsp/config.edn is mentioned in the docs here? I don’t see where/how LSP might be used for that feature.

Marc O'Morain12:10:39

This can happen if the cider nrepl middleware is not loaded.

Marc O'Morain12:10:06

Calva never checks that the nrepl test middleware is loaded afaik.


That’s correct. We probably should start checking for it. 😃


@brandon.ringe At the top of my mind I have no idea. 😃


@U06BCCQPL Did you start the repl via jack-in, or did you connect to a repl started without jack-in? @U0K592YDP and @U0ETXRFEW, is it possible for the middleware to not be loaded even when it’s specified in the command that starts the repl, and the repl starts successfully? I’m not sure if / saying that is the case here. I’m just wondering if it’s possible.


I think you should see a warning if there is something preventing the middleware from starting. But I am not sure.


@brandon.ringe Thank you for information, excuse me if I´m understand well, but is there any way to change the jack-in command in the manual way? Or do I have to wait Calva fix deploy?


It's just a warning. Everything works. 😀


Yeah, as @U0ETXRFEW said, it’s just a warning. It’s not indicating that anything is broken.


but Is there any way to change that command line for starting it?


You can influence it in some ways: • Selecting different items in the various menus that the Jack-in process gives you • Create a custom connect sequence: • Use the command Copy Jack-in command line (or some such) and modify that command as you wish and submit it on the command line. Then use Calva Connect to connect to the nRepl server (that your command is then responsible to have started). • Similar to the previous, you can craft your repl start command freely. Just make sure Calva’s requirements on the started nRepl server are met.


I am having trouble with debug breakpoints being hit when I run tests either within a namespace or under the cursor. Is there something I might have missed. When I call the function in the namespace execution stops at the line containing the #dbg.


How do you run the tests?


This info may be helpful to you, if you haven’t seen it yet: