first of all i would like to thank for developing this software! I am a backend engineer at Prisma. I am opening this issue as we are a happy user of this library and would like it to be compatible with Graal.
What is Graal?
We would like to turn our Prisma Server into a lightweight binary with Graal.
However the Graal native image tool comes with some limitations. Some features of the JVM are not supported, e.g. the support for reflection is limited because it is not a good fit with ahead of time compilation. Therefore we created a test suite to check the compatibility of our used dependencies with Graal. For each dependency we tried to come up with a super small program and see whether it compiles with Graal or not.
The program to test compatibility with SnakeYAML can be found here.
What's the problem we have hit?
Exception in thread "main" java.lang.NullPointerException at org.yaml.snakeyaml.util.PlatformFeatureDetector.isRunningOnAndroid(PlatformFeatureDetector.java:25) at org.yaml.snakeyaml.introspector.PropertyUtils.<init>(PropertyUtils.java:60) at org.yaml.snakeyaml.introspector.PropertyUtils.<init>(PropertyUtils.java:50) at org.yaml.snakeyaml.constructor.BaseConstructor.getPropertyUtils(BaseConstructor.java:531) at org.yaml.snakeyaml.constructor.BaseConstructor.addTypeDescription(BaseConstructor.java:552) at org.yaml.snakeyaml.constructor.Constructor.<init>(Constructor.java:84) at org.yaml.snakeyaml.constructor.Constructor.<init>(Constructor.java:70) at org.yaml.snakeyaml.constructor.Constructor.<init>(Constructor.java:56) at org.yaml.snakeyaml.constructor.Constructor.<init>(Constructor.java:46) at org.yaml.snakeyaml.Yaml.<init>(Yaml.java:64) at Main$.main(Main.scala:9) at Main.main(Main.scala) at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:177)
I think the problem is the call to
System.getProperty("java.runtime.name") that returns null within the native Graal runtime.
Note: The Graal compilation terminates on the first encountered error. Therefore there might be more problems that need to be addressed.
How can incompatibilities with Graal be fixed?
Here is a blog post by the Graal team that explains how the native image tool is working and how they were able to compile a server built on top of netty into a binary.