fury icon indicating copy to clipboard operation
fury copied to clipboard

feat(java): support graalvm copy

Open zhaommmmomo opened this issue 1 year ago • 10 comments

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

zhaommmmomo avatar Aug 22 '24 10:08 zhaommmmomo

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

chaokunyang avatar Aug 22 '24 12:08 chaokunyang

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

No problem. I haven't seen the graalvm_tests module before, so I wrote a temporary module test locally

zhaommmmomo avatar Aug 27 '24 08:08 zhaommmmomo

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

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

企业微信截图_17248349495811

zhaommmmomo avatar Aug 28 '24 08:08 zhaommmmomo

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

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

企业微信截图_17248349495811

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?

chaokunyang avatar Sep 02 '24 06:09 chaokunyang

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

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 企业微信截图_17248349495811

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?

I used Example class under the graalvm_tests module for testing

zhaommmmomo avatar Sep 06 '24 02:09 zhaommmmomo

@zhaommmmomo Could you push your test code? I will give it a try. And which graalvm JDK are you using?

chaokunyang avatar Sep 06 '24 08:09 chaokunyang

@zhaommmmomo你能推送你的测试代码吗?我会试试。你使用的是哪个 graalvm JDK?

GraalVM version: image

Fury version: 0.8.0-SNAPSHOT

Test code: org.apache.fury.graalvm.Main#main image

native-image.properties: image

CMD: mvn -DskipTests=true -Pnative package

Error msg: image

zhaommmmomo avatar Sep 13 '24 03:09 zhaommmmomo

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

mbasso avatar Sep 16 '24 15:09 mbasso

Hi @zhaommmmomo @mbasso , I fixed graalvm support in https://github.com/apache/fury/pull/1845. Please give it a try, it should work now.

chaokunyang avatar Sep 23 '24 06:09 chaokunyang

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!

mbasso avatar Sep 23 '24 08:09 mbasso