Fork me on GitHub
#graalvm
<
2020-01-20
>
rickmoynihan14:01:18

Just tried compiling a project with graalvm native image, and am seeing errors like:

Error: No instances of .ssl.SSLContext are allowed in the image heap as this class should be initialized at image runtime. To see how this object got instantiated use -H:+TraceClassInitialization.
Trace: 	object java.lang.Object[]
	object clojure.lang.PersistentArrayMap
	object clojure.lang.Var
	object java.lang.Object[]
	object clojure.lang.PersistentHashMap$BitmapIndexedNode
	object clojure.lang.PersistentHashMap$INode[]
	object clojure.lang.PersistentHashMap$ArrayNode
	object clojure.lang.PersistentHashMap$INode[]
	object clojure.lang.PersistentHashMap$ArrayNode
	object clojure.lang.PersistentHashMap
	object java.util.concurrent.atomic.AtomicReference
	object clojure.lang.Namespace
	object java.util.concurrent.ConcurrentHashMap$Node
	object java.util.concurrent.ConcurrentHashMap$Node[]
	object java.util.concurrent.ConcurrentHashMap
	method clojure.lang.Namespace.find(Symbol)
Call path from entry point to clojure.lang.Namespace.find(Symbol): 
	at clojure.lang.Namespace.find(Namespace.java:188)
	at clojure.core$find_ns.invokeStatic(core.clj:4096)
	at clojure.core$find_ns.invoke(core.clj:4092)
	at clojure.tools.logging.proxy$.ByteArrayOutputStream$ff19274a.flush(Unknown Source)
	at .PrintStream.newLine(PrintStream.java:627)
	at .PrintStream.println(PrintStream.java:883)
	at com.oracle.svm.jni.functions.JNIFunctions.ExceptionDescribe(JNIFunctions.java:750)
	at com.oracle.svm.core.code.IsolateEnterStub.JNIFunctions_ExceptionDescribe_b5412f7570bccae90b000bc37855f00408b2ad73(generated:0)

rickmoynihan14:01:04

I’m currently using: https://github.com/taylorwood/clj.native-cli Wondering what I need to do to make progress…

rickmoynihan14:01:27

hmm interesting 👀

borkdude15:01:56

I've also found an issue here: https://github.com/oracle/graal/issues/1074 (lmgtfy ;))

rickmoynihan15:01:11

yeah also found that clojurl uses org.martinklepsch/clj-http-lite {:mvn/version "0.4.1"} guessing that works around this issue… need to do more digging

rickmoynihan15:01:20

I might be able to switch over to that too

borkdude15:01:42

I'm even using that as an interpreted version in babashka: https://github.com/borkdude/clj-http-lite

👍 4