I just uploaded an alpha2 release of cljr. This fixes a problem running on Linux. (I've tested it on WSL2-Ubuntu.)
dotnet tool install --global Clojure.Cljr --version 0.1.0-alpha2BTW, towards the end of the README on the repo (https://github.com/clojure/clr.core.cli) there is a list of things that need some input. E.g., what prep utilities are needed in the ClojureCLR arena. I could use some input on these matters.
(~/clojure)-(!2047)-> dotnet tool install --global Clojure.Cljr --version 0.1.0-alpha2
Tool 'clojure.cljr' was successfully updated from version '0.1.0-alpha1' to version '0.1.0-alpha2'.
Fri May 31 09:20:51
(~/clojure)-(!2048)-> cljr
WARNING: Use of :paths external to the project has been deprecated, please remove: .
Starting main
Clojure 1.12.0-alpha9
user=>(that warning comes if you don't have :paths in your deps file or don't have a deps file -- and the default should be
:paths ["src"]
from the root/system deps file)That warning comes from Clojure code, specifically in clojure.tools.deps. cljr should be copying in a deps.edn file to the user config directory, but that file does not have a :paths entry. It adds installDir/deps.edn to the configuration path -- but I see now that I didn't put one in the package.
I'm going to guess they use this one: https://github.com/clojure/brew-install/blob/1.11.3/src/main/resources/clojure/install/deps.edn
I'll hack that up to use non-Maven coords (and no Clojure version). Will be in alpha3.
thx
Is there a default (root) deps.edn baked into cljr? I was a bit surprised by this:
(~/clojure)-(!2052)-> cljr -X:deps list
Starting exec/tool
Unqualified function can't be resolved: list
Fri May 31 09:28:13
(~/clojure)-(!2053)-> clj -X:deps list
org.clojure/clojure 1.12.0-alpha12 (EPL-1.0)
org.clojure/core.specs.alpha 0.4.74 (EPL-1.0)
org.clojure/spec.alpha 0.5.238 (EPL-1.0)
and so I tried a non-existent alias and got this
(~/clojure)-(!2054)-> cljr -X:no-such-alias
Starting exec/tool
No function found on command line or in :exec-fn
Fri May 31 09:29:33
(~/clojure)-(!2055)-> clj -X:no-such-alias
WARNING: Specified aliases are undeclared and are not being used: [:no-such-alias]
No function found on command line or in :exec-fn
So it looks like cljr doesn't validate the alias and, I suspect, there are no defaults from a "root" deps.edn either?This is the default for clj:
{
:paths ["src"]
:deps {
org.clojure/clojure {:mvn/version "1.11.3"}
}
:aliases {
:deps {:replace-paths []
:replace-deps {org.clojure/tools.deps.cli {:mvn/version "0.10.66"}}
:ns-default clojure.tools.deps.cli.api
:ns-aliases {help }}
:test {:extra-paths ["test"]}
}
:mvn/repos {
"central" {:url " "}
"clojars" {:url " "}
}
}
Obvs the Clojure dep and the Maven repos don't make sense for cljr but the rest would?Ah, the "default" has :paths ["."] in the install folder... and does have :deps
The README says -X:deps list and -X:deps tree are supported but neither seem to work for me:
(~/clojure)-(!2066)-> cljr -X:deps tree
Starting exec/tool
Unqualified function can't be resolved: treeAre multiple aliases not supported on the command-line?
(~/clojure)-(!2063)-> cljr -X:test:runner
Starting exec/tool
No function found on command line or in :exec-fn
This should pull :test from the root deps (in the install) and :runner from my local deps-clr.edn which has
{:paths ["src"]
:aliases
{:runner
{;:extra-paths ["test"]
:extra-deps {io.github.dmiller/test-runner {:git/tag "v0.5.1clr" :git/sha "814e06f"}}
:exec-fn cognitect.test-runner.api/test}}}Sorry to bump this thread but i'm having a similar issue, this is my deps-clr.edn
{:paths ["src" "test" "resources"]
:deps {io.github.clojure/clr.data.priority-map {:git/tag "v1.2.0" :git/sha "1c22751"}}
:aliases
{:nrepl
{:extra-deps
{io.github.clojure/clr.tools.nrepl {:git/tag "v0.1.2-alpha2" :git/sha "a58009f03b"}}
:exec-fn clojure.tools.nrepl/start-server!
:exec-args {:port 5555}}}}
and I get
cljr -X:nrepl
Starting exec/tool
No function found on command line or in :exec-fn
any idea what I am doing wrong? (If I start the nrepl server from the repl directly it works fine)I commented out :extra-paths and renamed the alias to test the multiple alias scenario.
It should be allowed. I'll look into it.
It's getting passed to the make-classpath2 function. I ran cljr -X:test:runner and got
WARNING: Specified aliases are undeclared and are not being used: [:runner]
(no deps.edn where I ran it) So it did pass the :runner alias.
I'll do some more playing later.I have both deps-clr.edn and deps.edn since the dependencies are different -- I wonder if that matters?
If you have a deps-clr.edn, cljr won't look at a deps.edn in the same directory.
I'll take a look. I'm in Asheville, NC, so I don't have Internet at present. (Also don't have water service, but I'd go for Internet first. 😁)
Oof take care !