feat(java): support graalvm copy
What does this PR do?
support graalvm copy
Related issues
https://github.com/apache/fury/issues/1742 https://github.com/apache/fury/issues/1679
Does this PR introduce any user-facing change?
- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?
Benchmark
Could we add some unit tests in graalvm_tests module? Maybe we could construct some complex objects in fury-test-core, and reuse it for tests in fury-core and graalvm_tests
Could we add some unit tests in graalvm_tests module? Maybe we could construct some complex objects in
fury-test-core, and reuse it for tests infury-coreandgraalvm_tests
No problem. I haven't seen the graalvm_tests module before, so I wrote a temporary module test locally
Could we add some unit tests in graalvm_tests module? Maybe we could construct some complex objects in
fury-test-core, and reuse it for tests infury-coreandgraalvm_tests
I want to confirm that graalvm copy, which mainly means that the native-image executes correctly under different object copies?
Because I noticed that there are some errors when executing the mvn -DskipTests=true -Pnative package command under the graalvm_tests module. Some classes also need to add --initialize-at-build-time=xxx, some of which are code generated
Could we add some unit tests in graalvm_tests module? Maybe we could construct some complex objects in
fury-test-core, and reuse it for tests infury-coreandgraalvm_testsI want to confirm that graalvm copy, which mainly means that the
native-imageexecutes correctly under different object copies?Because I noticed that there are some errors when executing the
mvn -DskipTests=true -Pnative packagecommand under thegraalvm_testsmodule. Some classes also need to add--initialize-at-build-time=xxx, some of which are code generated
Could you share your unit test code here? This should not happen, we generated all code at graalvm build time. Do you init Fury and register all serializers in a static scope?
Could we add some unit tests in graalvm_tests module? Maybe we could construct some complex objects in
fury-test-core, and reuse it for tests infury-coreandgraalvm_testsI want to confirm that graalvm copy, which mainly means that the
native-imageexecutes correctly under different object copies? Because I noticed that there are some errors when executing themvn -DskipTests=true -Pnative packagecommand under thegraalvm_testsmodule. Some classes also need to add--initialize-at-build-time=xxx, some of which are code generatedCould you share your unit test code here? This should not happen, we generated all code at graalvm build time. Do you init Fury and register all serializers in a static scope?
I used Example class under the graalvm_tests module for testing
@zhaommmmomo Could you push your test code? I will give it a try. And which graalvm JDK are you using?
@zhaommmmomo你能推送你的测试代码吗?我会试试。你使用的是哪个 graalvm JDK?
GraalVM version:
Fury version: 0.8.0-SNAPSHOT
Test code: org.apache.fury.graalvm.Main#main
native-image.properties:
CMD: mvn -DskipTests=true -Pnative package
Error msg:
Hello,
I have tried to use Fury with GraalVM Native Image and encountered the same error reported by @zhaommmmomo (tests in the main branch, no code changes):
Because I noticed that there are some errors when executing the mvn -DskipTests=true -Pnative package command under the graalvm_tests module. Some classes also need to add --initialize-at-build-time=xxx, some of which are code generated
I am using a custom GraalVM build based on OpenJDK 21
Hi @zhaommmmomo @mbasso , I fixed graalvm support in https://github.com/apache/fury/pull/1845. Please give it a try, it should work now.
Hi @chaokunyang, The Native Image tests pass correctly now, thank you so much for the prompt reply and the fixes! Looking forward to a new version on the Maven repository!
