clojure-emacs / orchard

A fertile ground for Clojure tooling
Eclipse Public License 1.0
326 stars 54 forks source link

[java] Don't crash if none of the parsers can be initialized #288

Closed alexander-yakushev closed 3 months ago

alexander-yakushev commented 3 months ago

Context here: https://clojurians.slack.com/archives/C17JYSA3H/p1724172844138059

On the JRE, loading CIDER (and hence Orchard) produces an exception like this:

error in process sentinel: Could not start nREPL server: Downloading: cider/cider-nrepl/0.45.0/cider-nrepl-0.45.0.pom from clojars
Downloading: cider/orchard/0.22.0/orchard-0.22.0.pom from clojars
Downloading: mx/cider/logjam/0.2.0/logjam-0.2.0.pom from clojars
Downloading: cider/orchard/0.22.0/orchard-0.22.0.jar from clojars
Downloading: mx/cider/logjam/0.2.0/logjam-0.2.0.jar from clojars
Downloading: cider/cider-nrepl/0.45.0/cider-nrepl-0.45.0.jar from clojars
Execution error (IllegalArgumentException) at orchard.misc/require-and-resolve (misc.clj:161).
No such namespace: orchard.java.parser-utils

alexander-yakushev commented 3 months ago

The culprit was not the source-info triggering parser loads, but the def module-info line requiring parser-utils. Given that module-info was loaded a bit awkwardly already (and there was a comment affirming it), I've moved it into a separate namespace that can be safely loaded on any JDK after 8.

Another sidenote is the usage of "JDK9" in the names. Obviously, we won't change the existing ones for no reason, but I suggest we use JDK11 as the LTS version that we actually support.

bbatsov commented 3 months ago

I'm fine with updating the references to JDK 9 - they are there just because it introduced the module system (that probably no one is using still) and all the complexity that came with it. I think the LTS concept was added shortly afterward, but we forgot to update the references accordingly.

alexander-yakushev commented 3 months ago

Replaced all mentions of JDK9.

bbatsov commented 3 months ago

This might be a good time for a new Orchard release.

theronic commented 3 weeks ago

Which version of cider-nrepl includes this fix, please?

alexander-yakushev commented 3 weeks ago

The latest one certainly does.