Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureCLR by
retagged by

Putting the dependencies in a deps-clr.edn file works.

But not via cljr -Sdeps. E.g.: try to launch nREPL server:
$ cljr -Sdeps '{:deps {io.github.clojure/clr.tools.nrepl {:git/tag "v0.1.2-alpha2"}}}' -X clojure.tools.nrepl/start-server! Clojure core loaded in 4177 milliseconds. Starting exec/tool Clojure core loaded in 4207 milliseconds. Namespace could not be loaded: clojure.tools.nrepl

I did custom compile some things so wondering if it's just me. The README for clr.core.cli says -Sdeps is supported.

I can malform the string and seems to throw no errors, I don't think it's being processed.

Well I'll poke around and report back what I find meanwhile.

by
edited by
Ok I see -Sdeps is ignored if deps was already cached. Need -Sforce to re-process new -Sdeps.

But another problem, looks like the tool arguments are quoted in a broken way on Linux. Results in something like --foo --bar "--tree" "--config-data" ""{:deps {:git/sha "127273928394937"}}"" being passed on to Clojure.Main through the shell script installed here:
`~/.dotnet/tools/.store/clojure.cljr/0.1.0-alpha6/clojure.cljr/0.1.0-alpha6/tools/net8.0/any/tools/run-clojure-main.sh`

You can edit that script with an initial `echo "$@"` to see how things are misquoted.

I think solution is to not quote anything and instead escape the characters just like CIDER does. \{ \: \" also escape spaces. I assume should work on powershell too, as that's what CIDER does when it shells out that same stuff as arguments to relevant tools, how they "Jack in" dependencies.
by
edited by
So looks like the double quote thing is even dependent on powershell version. "" might be treated as either " or "" depending on version.

Here are some CIDER discussions on powershell:
https://github.com/clojure-emacs/cider/issues/3588
https://github.com/clojure-emacs/cider/pull/3590#issuecomment-1832783190

Also:
https://ask.clojure.org/index.php/13496/clojure-cli-bug-on-windows
https://clojure.org/reference/clojure_cli#quoting

Well I'll try to make a PR for clr.core.cli that'll work on Linux but with good faith effort for powershell.

Please log in or register to answer this question.

...