Fork me on GitHub
Karol Wójcik15:07:43

I highly recommend to watch the live stream regarding 21.2.0 release of GraalVM. What I liked the most is native-image tests. I'm very curious how we can universally run the tests in native-image with Clojure : )

🚀 2
graal-vm 2
👍 2
Karol Wójcik15:07:46

Does it mean that dynaload will work starting from 21.2?




> Desired classes that need to be loaded at run time must be made available to the static analysis at build time so that they are included in the closed world analysis, but otherwise the code patterns that include loading classes at arbitrary moments of run time are now working in native images just as you'd expected them to.


This means those classes must be available somewhere, so already pre-compiled AND reachable through static analysis. So, likely dynaload isn't working.

Karol Wójcik11:07:37

Oh. Ok got it!

Karol Wójcik11:07:34

Thank you so much for the explanation


> Changed the --initialize-at-build-time option behaviour to be used only with arguments. Oh that went in faster than I expected, the dev version said this was slated for 22. ;) PS: ah, it still works


What do you mean with still works? they added just a warning for now?


I'll bump graalvm in nix then later change clojure-lsp to use that version


I know how to fix this. I'll probably release a micro-library that you can use in graalvm builds or so


that'd be great, thanks


kind of sad that every clojure program would need to add that lib after 22


at least we have that option


they are fed up with problems from having everything at build time so they are trying to discourage it (after having tried to support it)


yeah, makes sense


we are kind of lucky that this option existed, else clojure + graalvm would probably have never happened


exactly 😔


There are already several approaches you can use to test libraries: - make a CLI out of it and run tests via the CLI from clojure.test - write SCI bindings for your library + clojure.test (babashka has these) and run the tests in a native-image I haven't tried compiling clojure.test unaltered with graalvm native-image lately but at the time I included clojure.test in babashka it was either problematic or slow.