tools-deps

Discuss tools.deps.alpha, tools.build, and the clj/clojure command-line scripts! See also #depstar #clj-new
seancorfield 2021-06-15T21:44:59.217400Z

@alexmiller Peter (Monks) raises an interesting point on ask about -X, given that — currently, at least — the exec stuff goes through this path:

exec "$JAVA_CMD" "${jvm_cache_opts[@]}" "${jvm_opts[@]}" "-Dclojure.basis=$basis_file" -classpath "$cp:$install_dir/libexec/exec.jar" clojure.main -m clojure.run.exec "${exec_args[@]}" "$@"
I wonder whether it’s worth adding detection of --report as a CLI option and passing it into this line between clojure.main and -m?

alexmiller 2021-06-15T21:48:01.219100Z

it needs more thought. exec does some handling now and it will not necessarily always go through clojure.main

alexmiller 2021-06-15T21:49:21.220200Z

similarly, some of the choices in exec I like better than what's in main. the exec stuff may eventually make its way into clojure core itself too.

alexmiller 2021-06-15T21:52:21.220700Z

I have little interest in adding either more options to -X or more special cases :)

seancorfield 2021-06-15T22:04:44.222Z

That’s fair. Just thought I’d ask. Personally, with the improvements to error reporting in 1.10, I hardly ever need to rummage around in the temp EDN file, and I’ve never needed to do that in our CI system (BitBucket Pipelines).

alexmiller 2021-06-15T22:39:27.224600Z

-X follows the lead of other Clojure CLI stuff and will print in the case of an ex-info and throw (resulting in printed stack) in other cases. All error messages in exec and tools.deps throw ex-info so this mostly only yields a stack in unexpected cases. so far, that has been mostly a good strategy.

seancorfield 2021-06-15T22:55:38.226Z

Yeah, I’ve started to switch over to pretty much only throwing ex-info from my own code these days, figuring that having something upstream be able to print the ex-data along with the message will be more valuable than some “random” Java exception.