Hmm, I'm running into a locking issue with clojure 1.10-rc2 and GraalVM 20.3.0. Repro code:
(ns pod.babashka.lock
(:gen-class))
(def ^:private hosts-file
"Something to lock to tray and prevent concurrent updates/reads to
hosts file."
(Object.))
(defn -main [& _args]
(locking hosts-file
(prn (+ 1 2 3))))
GraalVM native-image output:
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Frame states being merged are incompatible: unbalanced monitors - locked objects do not match
This frame state: [locals: [1,5,_,_] stack: [9] locks: [] rethrowException]
Other frame state: [locals: [1,5,_,_] stack: [23] locks: [16 / 7] rethrowException]
Parser context: pod.babashka.lock$_main.invokeStatic(lock.clj:11) [bci: 17, intrinsic: false]
17: checkcast #26 // clojure.lang.IFn
20: lconst_1
21: ldc2_w #27 // 2
24: invokestatic #4 // clojure.lang.Numbers.add:(long, long)long
27: ldc2_w #35 // 3
This is a minimal repro from https://github.com/clj-commons/clj-ssh/blob/cad8841e6c898b803f276679f69ef563d47b9320/src/clj_ssh/ssh.clj#L150
This does seem to work:
(defn -main [& _args]
(let [x (Object.)]
(locking x
(prn (+ 1 2 3)))))
This may be false alarm because when I macroexpand I think I'm seeing the old locking macro code.
although 1.10.2-rc2 should be used according to -Stree and such
1.10.2-rc2 doesn't exist, only 1.10.2-rc1
yeah sorry, typo. Gosh, it seems depstar isn't picking up rc1 even when I include that in my aliases
when I print the clojure version at compile time I get 1.10.1
perhaps depstar is confused?
I think depstar now has a new :aliases arg
:aliases '[:webassets]'
https://github.com/seancorfield/depstar#classpathso probably I was confused
all good now, sorry for the noise and happy new year!