Nothing advanced in this GraalVM presentation, but it gives a good overview of benefits of using GraalVM as your regular JDK and then effects of native-image. https://youtu.be/NXyACuQuIHI
Small note: the enterprise edition has better performance than the community edition (which should it turn have better performance than other JVMs, at least that is their goal)
Thanks for the link
Anyone have experience with Github Action + lein-native? I'm trying to compile a native-image with the --static
flag. But I get the following error:
com.oracle.svm.core.util.UserError$UserException: Must specify main entry point class when building EXECUTABLE native image. Use '-H:Class=<fully-qualified-class-name>'.
The MacOS build also seems to fail. lein-native
builds seem to work (linux non-static and windows).
The build (with error): https://github.com/kwrooijen/hiccup-cli/runs/1882255111?check_suite_focus=true
My GH Action yml: https://github.com/kwrooijen/hiccup-cli/blob/master/.github/workflows/release.yml
project.clj / graalvm config: https://github.com/kwrooijen/hiccup-cli/blob/master/project.clj
If anyone has an idea that would be great. I can move away from lein-native
if I have to but it would be nice if I could keep using it.
(Sorry, the NON static binaries break)
oh hmm.. my build is failing locally apparently
it looks like you need an else branch with -H:Class=<fully-qualified-class-name>
at https://github.com/kwrooijen/hiccup-cli/blob/master/project.clj#L2
You must be right
I assumed an empty string would be ignored
the error is saying you have to have a main if you're building an executable
I think this should work if I remove the empty string
This is why I never use tools to compile with native-image. Why wrap a tool with another tool which only complicates things, in my opinion.
Here's some bash: https://github.com/clj-kondo/clj-kondo/blob/32cf9cbb2bac1e699c40ba200752373042f8a0e7/script/compile#L17-L33
No thanks 😛
I love bash
Why use Babashka when you can use bash
Exactly
Back to basics
I wrote my script in babashka of course, you should try it sometime @borkdude!
It works! Thanks. I get to keep my extra complicated setup for no reason now
So what was it?
The empty string, thought it would get ignored
But apparently it broke my build
makes sense
It was your main problem 🙂