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/.
Max 2020-12-10T14:35:04.204Z

Hi all! I’ve been playing around a bit with Quil and Processing, and I wanted to share some stuff I made with some friends. I thought that compiling to a static executable using GraalVM might be a good way to do that. However when I run lein native-image, I get the following error. Note that I had to skip the --initialize-at-build-time flag because otherwise it tries to start my sketches. My code is here: https://github.com/maxrothman/playing-with-processing, and I’m using the native-image lein plugin. Any ideas? I took a look through https://github.com/lread/clj-graal-docs but I didn’t see anything that seemed related. I’m completely new to graalvm and fairly new to Java, so sorry if this has been asked before

borkdude 2020-12-10T14:41:36.204600Z

@max.r.rothman Take a look at https://github.com/borkdude/clj-reflector-graal-java11-fix

borkdude 2020-12-10T14:42:23.205100Z

Also, make sure you're using 1.10.2-alpha4

Max 2020-12-10T15:45:09.206Z

Thanks for the suggestion, @borkdude! I am using clojure 1.10.2-alpha4. I can’t use the fix you linked to though because Processing is only compatible with Java 8

borkdude 2020-12-10T15:45:40.206400Z

@max.r.rothman Which version of GraalVM are you using to compile then?

Max 2020-12-10T15:46:53.206600Z

graalvm-ce-java8-20.3.0

borkdude 2020-12-10T15:47:52.207200Z

@max.r.rothman Have you tried --report-unsupported-elements-at-runtime

Max 2020-12-10T15:48:00.207400Z

not yet!

Max 2020-12-10T15:58:36.207600Z

I get this error:

borkdude 2020-12-10T16:03:43.208700Z

@max.r.rothman It seems like you're getting the same error as https://clojurians.slack.com/archives/CAJN79WNT/p1607554227199300. I don't know how y'all are compiling your code, so unless you post a complete repro + build scripts online, I don't have much more to say.

Max 2020-12-10T16:05:14.209700Z

My code is at https://github.com/maxrothman/playing-with-processing, and I’m building using lein native-image (via the https://github.com/taylorwood/lein-native-image plugin)

Max 2020-12-10T16:06:14.210300Z

Thanks for the help so far!

borkdude 2020-12-10T16:06:33.210700Z

I recommend just writing a shell script to compile. It's hard to see what's wrong when using wrappers.

borkdude 2020-12-10T16:06:43.211Z

Take a look at the hello world examples how that is done.

borkdude 2020-12-10T16:07:30.211200Z

https://github.com/lread/clj-graal-docs

borkdude 2020-12-10T16:08:04.212Z

This is one of my simplest GraalVM projects: https://github.com/borkdude/puget-cli You could try to see if that runs on your machine and then port it to your code

❤️ 1