@lee I am using classes from svm. I'm not sure what GraalVM SDK vs svm is. import com.oracle.svm.core.annotate.Substitute; import com.oracle.svm.core.annotate.TargetElement; import com.oracle.svm.core.annotate.TargetClass; import com.oracle.svm.core.jdk.JDK11OrLater;
Problem is that tools deps includes tar.gz files from org.graalvm.nativeimgage/svm in classpath which causes native-image to fail. I looked at deps within org.graalvm.nativeimage/svm and found org.graalvm.sdk/graal-sdk which seems to have all we really need.
@lee What I don't understand is that the SDK jar doesn't mention any svm jars:
ls_jar.clj org.graalvm.sdk/graal-sdk 20.1.0 | grep svm
while I'm importing these:
import com.oracle.svm.core.annotate.Substitute;
Maybe the dependency isn't needed once it's compiled? But that's not how Java classes work right?
@lee What happens if you leave out the graal-sdk as well?
I’ll play around a little more and get back to you.
Ya I was out to lunch with thinking org.graalvm.sdk/graal-sdk
helped. If I leave it out as well, my compile still works. If I look at output from native-image
I see that there is a lib/svm/builder/svm.jar
from Graal’s install dir included for both native-image’s -cp
and -imagecp
. This svm.jar
contains all classes you listed above.
ah
that explains it
so I guess I can ditch the dependency then
Ya, I think you can.
still the svm.jar would be the same version in the dependency as in Graal's install, so don't think it's needed and the problem might be elsewhere
and declaring the dependency is stating a truth: it IS dependent on that
I guess it is more like a provided dep then. It would be harmless if tools deps handled native deps like lein seems to, but tools deps does not.
If leaving it in is correct then https://github.com/borkdude/clj-reflector-graal-java11-fix README could be updated on tools dep usage. Happy to PR, lemme know.
PR would be good
Ok I shall do PR for README.
what's the root of the issue though? is it something with tools.deps?
ah I see: https://clojurians.slack.com/archives/C6QH853H8/p1593559436160400
Ya, you found it.
@lee Thanks for clearing up the mystery.
Wow, thanks so much Lee for figuring this out and documenting it for others! :hugging_face:
Has anyone been able to get a graal compiled binary working with dynamodb?