Skip to content

Commit

Permalink
[fix] [#360] Broken GraalVM compatibility (@borkdude)
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed Nov 18, 2022
1 parent 5d95919 commit 6a980e0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/taoensso/timbre.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -752,8 +752,9 @@
;; Try enable reproducible builds by ensuring that `log!` macro expansion
;; produces deterministic callsite-ids, Ref. #354
#?(:cljs (def ^:private deterministic-rand rand) ; Dummy, non-deterministic
:clj (let [rand ^java.util.Random (java.util.Random. 715873)]
(defn- deterministic-rand [] (.nextDouble rand))))
:clj (let [;; Must be delayed for GraalVM compatibility, Ref. #360
rand_ (delay (java.util.Random. 715873))]
(defn- deterministic-rand [] (.nextDouble ^java.util.Random @rand_))))

(defmacro log! ; Public wrapper around `-log!`
"Core low-level log macro. Useful for tooling/library authors, etc.
Expand Down

0 comments on commit 6a980e0

Please sign in to comment.