From 434ed89af911a0b72479eb62e38a6ae77b178c9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20W=C3=B3jcik?= Date: Sun, 5 Dec 2021 13:22:02 +0100 Subject: [PATCH] [#146] [New] Add Graal native configurations (@FieryCod) --- project.clj | 3 + .../nippy/native-image.properties | 3 + .../com.taoensso/nippy/reflection-config.json | 82 ++++++++++++++++ .../nippy/serialization-config.json | 96 +++++++++++++++++++ 4 files changed, 184 insertions(+) create mode 100644 resources/META-INF/native-image/com.taoensso/nippy/native-image.properties create mode 100644 resources/META-INF/native-image/com.taoensso/nippy/reflection-config.json create mode 100644 resources/META-INF/native-image/com.taoensso/nippy/serialization-config.json diff --git a/project.clj b/project.clj index ae1758c..1dc1e15 100644 --- a/project.clj +++ b/project.clj @@ -19,6 +19,9 @@ [org.tukaani/xz "1.9"] [org.lz4/lz4-java "1.8.0"]] + :resources + ["resources"] + :plugins [[lein-pprint "1.3.2"] [lein-ancient "0.7.0"] diff --git a/resources/META-INF/native-image/com.taoensso/nippy/native-image.properties b/resources/META-INF/native-image/com.taoensso/nippy/native-image.properties new file mode 100644 index 0000000..d68fd2a --- /dev/null +++ b/resources/META-INF/native-image/com.taoensso/nippy/native-image.properties @@ -0,0 +1,3 @@ +Args=--initialize-at-build-time=clojure,taoensso \ + -H:SerializationConfigurationResources=${.}/serialization-config.json \ + -H:ReflectionConfigurationResources=${.}/reflection-config.json diff --git a/resources/META-INF/native-image/com.taoensso/nippy/reflection-config.json b/resources/META-INF/native-image/com.taoensso/nippy/reflection-config.json new file mode 100644 index 0000000..5402839 --- /dev/null +++ b/resources/META-INF/native-image/com.taoensso/nippy/reflection-config.json @@ -0,0 +1,82 @@ +[ + { + "name":"net.jpountz.lz4.LZ4HCJNICompressor", + "fields":[ + { + "name":"INSTANCE" + } + ], + "methods":[ + { + "name":"", + "parameterTypes":[ + "int" + ] + } + ] + }, + { + "name":"net.jpountz.lz4.LZ4JNICompressor", + "fields":[ + { + "name":"INSTANCE" + } + ] + }, + { + "name":"net.jpountz.lz4.LZ4JNIFastDecompressor", + "fields":[ + { + "name":"INSTANCE" + } + ] + }, + { + "name":"net.jpountz.lz4.LZ4JNISafeDecompressor", + "fields":[ + { + "name":"INSTANCE" + } + ] + }, + { + "name":"net.jpountz.lz4.LZ4JavaSafeCompressor", + "fields":[ + { + "name":"INSTANCE" + } + ] + }, + { + "name":"net.jpountz.lz4.LZ4HCJavaSafeCompressor", + "fields":[ + { + "name":"INSTANCE" + } + ], + "methods":[ + { + "name":"", + "parameterTypes":[ + "int" + ] + } + ] + }, + { + "name":"net.jpountz.lz4.LZ4JavaSafeFastDecompressor", + "fields":[ + { + "name":"INSTANCE" + } + ] + }, + { + "name":"net.jpountz.lz4.LZ4JavaSafeSafeDecompressor", + "fields":[ + { + "name":"INSTANCE" + } + ] + } +] diff --git a/resources/META-INF/native-image/com.taoensso/nippy/serialization-config.json b/resources/META-INF/native-image/com.taoensso/nippy/serialization-config.json new file mode 100644 index 0000000..622f6ce --- /dev/null +++ b/resources/META-INF/native-image/com.taoensso/nippy/serialization-config.json @@ -0,0 +1,96 @@ +[ + { + "name":"clojure.lang.APersistentMap" + }, + { + "name":"clojure.lang.ExceptionInfo" + }, + { + "name":"clojure.lang.ExceptionInfo", + "customTargetConstructorClass":"java.lang.Object" + }, + { + "name":"clojure.lang.Keyword" + }, + { + "name":"clojure.lang.Keyword", + "customTargetConstructorClass":"java.lang.Object" + }, + { + "name":"clojure.lang.PersistentArrayMap" + }, + { + "name":"clojure.lang.PersistentArrayMap", + "customTargetConstructorClass":"clojure.lang.AFn" + }, + { + "name":"clojure.lang.Symbol" + }, + { + "name":"clojure.lang.Symbol", + "customTargetConstructorClass":"clojure.lang.AFn" + }, + { + "name":"java.lang.ArithmeticException" + }, + { + "name":"java.lang.ArithmeticException", + "customTargetConstructorClass":"java.lang.Object" + }, + { + "name":"java.lang.Exception" + }, + { + "name":"java.lang.Object[]" + }, + { + "name":"java.lang.RuntimeException" + }, + { + "name":"java.lang.StackTraceElement" + }, + { + "name":"java.lang.StackTraceElement", + "customTargetConstructorClass":"java.lang.Object" + }, + { + "name":"java.lang.StackTraceElement[]" + }, + { + "name":"java.lang.String" + }, + { + "name":"java.lang.String", + "customTargetConstructorClass":"java.lang.Object" + }, + { + "name":"java.lang.Throwable" + }, + { + "name":"java.util.ArrayList" + }, + { + "name":"java.util.ArrayList", + "customTargetConstructorClass":"java.util.AbstractList" + }, + { + "name":"java.util.Collections$UnmodifiableCollection" + }, + { + "name":"java.util.Collections$UnmodifiableList" + }, + { + "name":"java.util.Collections$UnmodifiableRandomAccessList" + }, + { + "name":"java.util.Collections$UnmodifiableRandomAccessList", + "customTargetConstructorClass":"java.lang.Object" + }, + { + "name":"java.util.Collections$EmptyList", + "customTargetConstructorClass":"java.util.AbstractList" + }, + { + "name":"clojure.lang.APersistentMap" + } +]