tools-deps

bhauman 2025-01-30T21:07:27.995399Z

When I'm creating a "tool" in and using :tools/usage what does the :exec-args key in :tools/usage do?

Alex Miller (Clojure team) 2025-01-30T21:11:32.523839Z

a map of default args to pass to :exec-fn

seancorfield 2025-01-30T21:14:05.092929Z

Only :ns-default and :ns-aliases seem to be documented and do anything -- or am I missing something in the code that uses the whole :tools/usage map?

bhauman 2025-01-30T21:15:51.059909Z

https://clojure.org/reference/deps_edn#tools_usage

seancorfield 2025-01-30T21:16:12.165749Z

The Spec for :tools/usage only lists those two keys, and clojure.tools.deps.extensions/coord-usage only documents returning those two keys.

bhauman 2025-01-30T21:16:40.111569Z

oh cool then the docs are out of sync

bhauman 2025-01-30T21:16:47.614009Z

thanks!

seancorfield 2025-01-30T21:16:54.718989Z

I mean, it makes sense that you can provide default :exec-args that way but I'm not finding that in the code yet...

bhauman 2025-01-30T21:17:32.220079Z

I was actually secretly wondering if it allowed for a default action

bhauman 2025-01-30T21:17:47.689289Z

or to call main somehow.

seancorfield 2025-01-30T21:18:46.528369Z

https://github.com/clojure/tools.deps/blob/master/src/main/clojure/clojure/tools/deps/script/make_classpath2.clj#L71 ignores :exec-args and the only other place that seems to use coord-usage is the show commands for -Ttools

Alex Miller (Clojure team) 2025-01-30T21:19:18.549799Z

I may be misremembering whatโ€™s allowed where so maybe the docs are wrong

bhauman 2025-01-30T21:20:38.832359Z

Thanks! That clears it up!

bhauman 2025-01-30T21:21:20.877509Z

I'm working on getting rebel-readline-nrepl going. Hopefully late is better than never.

seancorfield 2025-01-30T21:24:24.094109Z

Ah, I have aliases and some dev code that starts Rebel Readline and starts an nREPL server as well:

clojure "$@" -M:1.12:portal:test:cider-nrepl:rebel:dev/repl
and https://github.com/seancorfield/dot-clojure/blob/develop/src/org/corfield/dev/repl.clj#L116-L165

seancorfield 2025-01-30T21:25:41.944469Z

(but there are a few caveats around add-lib usage with my setup)

bhauman 2025-01-30T21:30:23.757089Z

Well now pretty soon you will be able to connect to the nREPL server instead of having to run it in your process.

seancorfield 2025-01-30T21:47:14.952819Z

Previously, I didn't bother with an interactive REPL at all -- just jacked-in from Calva and did everything via eval from RCFs -- but I was also running a separate, primitive "build REPL" for interactive test/build related tasks... which was what led me to unify them, and then to try to get Rebel Readline working with the "build REPL" (as well as spawning the nREPL server)... because a manually started REPL survives a window reload in VS Code, so you can update extensions etc, without losing REPL state ๐Ÿ™‚

๐Ÿ‘ 1