clj-easy / graal-docs

Scripts and tips to get Clojure latest working with GraalVM latest
Eclipse Public License 1.0
387 stars 20 forks source link

Document better Java11 reflector fix #34

Closed borkdude closed 3 years ago

borkdude commented 4 years ago

Dump from Slack:

4:26 PM borkdude I think I found a better fix for the clojure.lang.Reflector issue with java11! https://github.com/oracle/graal/issues/2214#issuecomment-596598421 No need anymore to patch Clojure itself by overriding the class. (edited) 4:30 PM katox I updated some more deps and now the full app works with java8 graal! (edited) 4:31 PM borkdude I'll make some proper docs around this java11 fix later (edited) 4:32 PM katox @borkdude is the above a configuration class that can be included in the project along with json configuration? Because I tried the java configuration code before and ran into more troubles. 4:35 PM borkdude @katox This is the fix in action: https://github.com/borkdude/sci/commit/4c8190c0e95860ece8e8b195b05d31ad0866d763 you need to compile this with svm.jar on the classpath. The commit shows that. :open_mouth: 1

8 replies Last reply today at 4:55 PMView thread 4:38 PM lread Oh that’s interesting @borkdude, so with Java substitutions, we can monkey patch Clojure! 4:39 PM borkdude yes, at least the Java bits 4:39 PM so if Clojure is going to have more Java-version specific bits, we can maybe work around it this way 4:40 PM lread yeah… neat! Another tool in the chest! 4:44 PM katox I think oracle provided some maven svm artifact. You could put it as a native image profile dependence. 4:45 PM this one https://mvnrepository.com/artifact/org.graalvm.nativeimage/svm/19.3.1 4:46 PM borkdude ah nice. I'll use that then 4:47 PM it is GPL licenced. is this what the classpath exception is for, i.e. when I compile my binary with this, I can still distribute it? 4:51 PM This is from the native-image chat: Michiel Borkent [4:22 PM] Is the svm.jar available as a maven library so I can put it on my classpath via a package manager? Michiel Borkent [4:38 PM] it seems it is, but not updated for newer versions? https://mvnrepository.com/artifact/com.oracle.substratevm/svm (edited) David Lloyd [4:49 PM] the group ID changed to org.graalvm.nativeimage [4:49 PM] https://search.maven.org/search?q=svm search.maven.org The Central Repository Search Engine The Search Engine for The Central Repository Michiel Borkent [4:50 PM] oh thank you! Peter Niederwieser [4:50 PM] afaik the jar can't currently be used with openjdk. 4:52 PM caio left #graalvm. 4:56 PM katox But you don't use it with openjdk. You use graal and the graal's native image to create and link the binary. And the binary on linux is linked to some gnu libc stuff. (edited) 5:01 PM Crispin glibc (just that lib) is also LGPL not GPL. 5:01 PM the gnu library that normally causes linking license problems is libreadline (its GPL) new messages 5:05 PM katox You're right. Still there is no openjdk involved unless you use that on CI server. 5:06 PM borkdude I'll process this fix into proper docs and maybe a lib later this week(end)

lread commented 3 years ago

I think this is now documented via 7e692f5ef7b1dbebfa7f3c95c2d4977ec1a21640