Skip to content

Commit 2332957

Browse files
Bump Orchard and protect initialization with try/catch
1 parent 666aa45 commit 2332957

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## master (unreleased)
44

5+
* Bump `orchard` to [0.29.1](https://github.com/clojure-emacs/orchard/blob/master/CHANGELOG.md#0291-2025-01-03).
6+
* [#910](https://github.com/clojure-emacs/cider-nrepl/pull/910): Protect Orchard Java machinery initialization with a try/catch.
7+
58
## 0.51.0 (2025-01-01)
69

710
* Bump `orchard` to [0.29.0](https://github.com/clojure-emacs/orchard/blob/master/CHANGELOG.md#0290-2024-12-31).

project.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
:url "http://www.eclipse.org/legal/epl-v10.html"}
2222
:scm {:name "git" :url "https://github.com/clojure-emacs/cider-nrepl"}
2323
:dependencies [[nrepl/nrepl "1.3.1" :exclusions [org.clojure/clojure]]
24-
[cider/orchard "0.29.0" :exclusions [org.clojure/clojure]]
24+
[cider/orchard "0.29.1" :exclusions [org.clojure/clojure]]
2525
^:inline-dep [mx.cider/haystack "0.3.3" :exclusions [cider/orchard]]
2626
^:inline-dep [thunknyc/profile "0.5.2"]
2727
^:inline-dep [mvxcvi/puget "1.3.4" :exclusions [org.clojure/clojure]]

src/cider/nrepl.clj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@
4444
(finally
4545
(System/exit 1))))
4646

47-
;; Perform the underlying dynamic `require`s asap, and also not within a separate thread
48-
;; (note the `future` used in `#'initializer`),
49-
;; since `require` is not thread-safe:
50-
(orchard.java/source-info `String)
47+
;; Perform the underlying dynamic `require`s asap, and also not within a
48+
;; separate thread (note the `future` used in `#'initializer`), since `require`
49+
;; is not thread-safe. We try it on LruMap which we know to be on the classpath,
50+
;; shipped with Orchard.
51+
(try (orchard.java/source-info 'mx.cider.orchard.LruMap)
52+
(catch Exception _))
5153
@analyzer/spec-abbrev
5254

5355
(defn warmup-orchard-caches!

0 commit comments

Comments
 (0)