clr

dmiller 2024-05-31T14:03:40.175949Z

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-alpha2

🎉 2
dmiller 2024-05-31T15:58:35.520209Z

BTW, 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.

seancorfield 2024-05-31T16:22:09.722409Z

(~/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=>

seancorfield 2024-05-31T16:24:36.927839Z

(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)

dmiller 2024-05-31T17:17:35.731299Z

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

seancorfield 2024-05-31T16:31:09.441279Z

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?

seancorfield 2024-05-31T16:32:01.198059Z

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?

seancorfield 2024-05-31T16:37:26.474319Z

Ah, the "default" has :paths ["."] in the install folder... and does have :deps

seancorfield 2024-05-31T16:42:22.319259Z

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: tree

seancorfield 2024-05-31T16:38:58.168809Z

Are 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}}}

Nazral 2024-10-05T05:08:06.329869Z

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)

seancorfield 2024-05-31T16:39:25.903409Z

I commented out :extra-paths and renamed the alias to test the multiple alias scenario.

dmiller 2024-05-31T17:19:42.948029Z

It should be allowed. I'll look into it.

dmiller 2024-05-31T17:35:54.436589Z

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.

seancorfield 2024-05-31T17:42:48.933189Z

I have both deps-clr.edn and deps.edn since the dependencies are different -- I wonder if that matters?

dmiller 2024-05-31T17:45:31.098239Z

If you have a deps-clr.edn, cljr won't look at a deps.edn in the same directory.

dmiller 2024-10-08T16:25:15.612349Z

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. 😁)

Nazral 2024-10-08T16:28:25.292669Z

Oof take care !