Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(scala): support scala native image build (#1922)
## What does this PR do? This PR supports scala native image build and fix quarkus graalvm build for java in quarkiverse/quarkus-fury#7: ``` Error: Class initialization of org.apache.fury.type.ScalaTypes failed. Use the option '--initialize-at-run-time=org.apache.fury.type.ScalaTypes' to explicitly request initialization of this class at run time. com.oracle.svm.core.util.UserError$UserException: Class initialization of org.apache.fury.type.ScalaTypes failed. Use the option '--initialize-at-run-time=org.apache.fury.type.ScalaTypes' to explicitly request initialization of this class at run time. at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.UserError.abort(UserError.java:85) at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationSupport.ensureClassInitialized(ClassInitializationSupport.java:195) at .................. org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationSupport.ensureClassInitialized(ClassInitializationSupport.java:177) ... 43 more Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: scala.collection.Iterable at org.apache.fury.reflect.ReflectionUtils.loadClass(ReflectionUtils.java:649) at org.apache.fury.type.ScalaTypes.<clinit>(ScalaTypes.java:40) ... 46 more Caused by: java.lang.ClassNotFoundException: scala.collection.Iterable at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageClassLoader.loadClass(NativeImageClassLoader.java:637) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) at org.apache.fury.reflect.ReflectionUtils.loadClass(ReflectionUtils.java:646) ... 47 more ``` ## Related issues Closes quarkiverse/quarkus-fury#7 ## Does this PR introduce any user-facing change? <!-- If any user-facing interface changes, please [open an issue](https://github.com/apache/fury/issues/new/choose) describing the need to do so and update the document if necessary. --> - [ ] Does this PR introduce any public API change? - [ ] Does this PR introduce any binary protocol compatibility change? ## Benchmark <!-- When the PR has an impact on performance (if you don't know whether the PR will have an impact on performance, you can submit the PR first, and if it will have impact on performance, the code reviewer will explain it), be sure to attach a benchmark data here. -->
- Loading branch information