clj-easy/graal-build-time

maint: bump graal dep appropriatly

Closed this issue · 1 comments

I had a question while doing a maintenance pass.

https://graalvm.slack.com/archives/CN9KSFB40/p1718892938048379

Hey ho! I'm one of the maintainers for clj-easy/graal-build-time, a native image feature we use to help with building Clojure sources. I'm doing a little maintenance on it and see that we currently depend on org.graalvm.nativeimage/svm, I think maybe the current recommendation is to instead depend on org.graalvm.sdk/nativeimage? I assumed that latest is greatest, but then am 2nd guessing, should we refer to a version matching the version of native-image we are using?

I don't think this is terribly important, but we might as well go with the current GraalVM recommended flow and also set a good example for others.

And Fabio from the GraalVM team was kind enough to respond:

Fabio
Hi Lee, good to see you're moving your project off SVM internals and to the public API! The versions don't need to match. They are mostly backward compatibility, so I would pick the version depending on the minimal (JDK) version you want to support. 23.1 is for JDK 21, the latest LTS. If you need JDK 17, you can go with 23.0. Hope this helps!

Me
Thanks for your reply, Fabio. It is informative and very much appreciated!
💡 If there is an unambiguous mapping from the JDK version to the SDK jar version, it could be nice to describe that mapping clearly somewhere. Might the SDK changelog be a good spot?
❤️ Because each GraalVM release offers so many awesome improvements, we typically recommend the latest release to Clojure users. As of this writing, that means we recommend GraalVM 22.0.1 (Oracle or Community Edition).
Our dependency on org.graalvm.sdk/nativeimage is really for build purposes only. The actual SDK used is picked up at native-image build time from the GraalVM installation. I'm guessing we don't need to worry too much, and using the latest SDK (as of this writing, 24.1.0) is probably just fine for this little project. (edited)

Fabio
Next they, the versions will meet at 25 and then the dual version issue is gone. BTW: the SVM changelog does mention both versions: https://github.com/oracle/graal/blob/master/substratevm/CHANGELOG.md

Me
Thanks, that helps!

This clears up my foggy memory a bit. The GraalVM<->SDK version mismatch is, I think, a hangover from the GraalVM version scheme change when they decided to align GaalVM versioning with the JDK.