This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-01-30
Channels
- # announcements (3)
- # babashka (5)
- # beginners (68)
- # calva (34)
- # cider (6)
- # cljsrn (3)
- # clojure (48)
- # clojure-australia (2)
- # clojure-europe (1)
- # clojure-nl (4)
- # clojure-spec (28)
- # clojurescript (10)
- # conjure (20)
- # datahike (1)
- # deps-new (1)
- # depstar (27)
- # events (2)
- # fulcro (61)
- # graalvm (32)
- # membrane (18)
- # off-topic (20)
- # practicalli (10)
- # reagent (2)
- # shadow-cljs (8)
- # slack-help (20)
- # spacemacs (9)
- # sql (5)
- # vim (10)
- # xtdb (8)
Not sure if anyone is interested in yet another example of how to compile a native image, but if so https://gitlab.com/tvaughan/kibit-runner#native-image. Only docker is required. For anyone looking to reproduce this without docker, Clojure 1.10.2 is required and for some reason this needs to be specified in deps.edn. A recent version of depstar is also required.

Just upgraded rewrite-clj v1 branch tests to use Graal v21.0.0. One more datapoint, @borkdude, for the https://github.com/borkdude/clj-reflector-graal-java11-fix not being needed!
For my Graal sci test under JDK11, I did still need to include borkdude/sci.impl.reflector
. Did not dig in at all, did you expect this still to be needed @borkdude?
Oh sorry, I meant the 0.0.1-java11
override version of borkdude/sci.impl.reflector
for JDK11.
If I retry my rewrite-clj sci tests without overriding borkdude/sci.impl.reflector
to 0.0.1-java11
, native-image compile works fine, but when I interpret my tests I get java.lang.NoSuchMethodError: java.lang.reflect.AccessibleObject.canAccess
exceptions. I’ll create a todo for myself to look at this sometime later.
@lee I have encountered this error as well. Adding this method to the reflection config did the trick for me
See comment here: https://github.com/seancorfield/next-jdbc/issues/157#issuecomment-770192263
@lee I think this is because the method is looked up using reflection: https://github.com/clojure/clojure/blob/140ed11e905de46331de705e955c50c0ef79095b/src/jvm/clojure/lang/Reflector.java#L38
This might become a very common config for projects that hit this path, so probably worth documenting
[{"name": "java.lang.reflect.AccessibleObject",
"methods" : [{"name":"canAccess"}]},
...
I think I'll copy your note to the reflector graal-fix repo then as well, since if you ran into that one, you'll probably now need this
Note that I did not need it when 1) compiling rewrite-clj and its tests, only when 2) compiling rewrite-clj for sci tests. But I don’t use a reflection.json for 1, so maybe that’s the diff.