Fork me on GitHub
#graalvm
<
2020-12-10
>
Max14:12:04

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

borkdude14:12:23

Also, make sure you're using 1.10.2-alpha4

Max15:12:09

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

borkdude15:12:40

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

Max15:12:53

graalvm-ce-java8-20.3.0

borkdude15:12:52

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

Max15:12:00

not yet!

Max15:12:36

I get this error:

borkdude16:12:43

@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.

Max16:12:14

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)

Max16:12:14

Thanks for the help so far!

borkdude16:12:33

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

borkdude16:12:43

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

borkdude16:12:04

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

❤️ 3