This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-17
Channels
- # announcements (11)
- # beginners (29)
- # calva (2)
- # clara (12)
- # cljsjs (1)
- # cljsrn (7)
- # clojure (39)
- # clojure-europe (6)
- # clojure-nl (7)
- # clojure-spec (6)
- # clojure-sweden (1)
- # clojure-uk (15)
- # clojuredesign-podcast (6)
- # code-reviews (2)
- # conjure (29)
- # cursive (3)
- # datomic (13)
- # duct (15)
- # emacs (1)
- # figwheel-main (2)
- # fulcro (7)
- # graalvm (16)
- # lambdaisland (4)
- # luminus (1)
- # meander (15)
- # observability (15)
- # off-topic (27)
- # parinfer (7)
- # pathom (2)
- # reitit (2)
- # rum (11)
- # shadow-cljs (57)
- # spacemacs (6)
- # sql (56)
- # tools-deps (36)
- # xtdb (3)
Hello, has anyone tried compiling native-image with taoensso.timbre
. I'm doing a minimal lein project with nothing but these:
[org.clojure/clojure "1.9.0"]
[com.taoensso/timbre "4.10.0"]
and I get the following error:
Error: Frame states being merged are incompatible: unbalanced monitors - locked objects do not match
This frame state: [locals: [1,2,3,65,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_] stack: [71] locks: [] rethrowException]
Other frame state: [locals: [1,2,82,65,3,_,_,_,_,_,_,_,_,_,_,_,_,_,_] stack: [85] locks: [78 / 69] rethrowException]
Parser context: io.aviso.exception$write_exception_STAR_.invokeStatic(exception.clj:509) [bci: 55, intrinsic: false]
55: checkcast #25 // clojure.lang.IFn
58: aload 4
60: invokeinterface#7, 2 // clojure.lang.IFn.invoke:(java.lang.Object)java.lang.Object
65: dup
Detailed message:
Call path from entry point to io.aviso.exception$write_exception_STAR_.invokeStatic(Object, Object, Object):
at io.aviso.exception$write_exception_STAR_.invokeStatic(exception.clj:496)
at io.aviso.exception$write_exception_STAR_.invoke(exception.clj:496)
at clojure.lang.AFn.applyToHelper(AFn.java:160)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at test2.core.main(Unknown Source)
at com.oracle.svm.core.JavaMainWrapper.runCore(JavaMainWrapper.java:149)
at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:184)
at com.oracle.svm.core.code.IsolateEnterStub.JavaMainWrapper_run_5087f5482cc9a6abc971913ece43acb471d2631b(generated:0)
Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
Error: Image build request failed with exit status 1
com.oracle.svm.driver.NativeImage$NativeImageError: Image build request failed with exit status 1
at com.oracle.svm.driver.NativeImage.showError(NativeImage.java:1541)
at com.oracle.svm.driver.NativeImage.build(NativeImage.java:1299)
at com.oracle.svm.driver.NativeImage.performBuild(NativeImage.java:1260)
at com.oracle.svm.driver.NativeImage.main(NativeImage.java:1219)
at com.oracle.svm.driver.NativeImage$JDK9Plus.main(NativeImage.java:1722
Tried this command:
native-image --verbose -H:Log=registerResource: --no-fallback --initialize-at-build-time --report-unsupported-elements-at-runtime -jar ./target/test2-0.1.0-SNAPSHOT-standalone.jar
@totoyok285 clojure + GraalVM native-image 101: use 1.10.2-alpha1. Also see the topic of this channel
I avoided 1.10.0 because I came across the locking issue, so going to try 10.2-alpha1
Well checked with 1.10.2-alpha, and it managed to compile, but took nearly 1 hour to complete! Using 1.9.0 took a long time too, but I got impatient and stopped it, so it might just work. It only happens with timbre added to the extremely minimal project.
are you using -Dclojure.compiler.direct-linking=true
? It can make a huge difference in compilation time
native-image --verbose -J-Dclojure.compiler.direct-linking=true -H:Log=registerResource: --no-fallback --initialize-at-build-time --report-unsupported-elements-at-runtime -jar ./target/test2-0.1.0-SNAPSHOT-standalone.jar
I think you need to specify that flag when creating the uberjar
yea, its effect is during AOT compilation