graalvm

Discuss GraalVM related topics. Use clojure 1.10.2 or newer for all new projects. Contribute to https://github.com/clj-easy/graal-docs and https://github.com/BrunoBonacci/graalvm-clojure. GraalVM slack: https://www.graalvm.org/slack-invitation/.
2020-01-20T14:47:18.010600Z

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

Error: No instances of <http://javax.net|javax.net>.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$<http://java.io|java.io>.ByteArrayOutputStream$ff19274a.flush(Unknown Source)
	at <http://java.io|java.io>.PrintStream.newLine(PrintStream.java:627)
	at <http://java.io|java.io>.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)

2020-01-20T14:48:04.011200Z

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

2020-01-20T14:58:27.012500Z

hmm interesting 👀

borkdude 2020-01-20T15:00:56.012900Z

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

2020-01-20T15:03:11.014Z

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

2020-01-20T15:04:20.014300Z

I might be able to switch over to that too

borkdude 2020-01-20T15:04:42.014600Z

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

👍 1