alessiodf opened a new issue, #1555:
URL: https://github.com/apache/incubator-fury/issues/1555

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-fury/issues) and found no similar 
issues.
   
   
   ### Version
   
   Version: 0.5.0 (built from source)
   OS: macOS
   JDK: 22
   
   The `withCompatibleMode(CompatibleMode.COMPATIBLE)` option causes a 
compilation failure in GraalVM `native-image` if `fury.register()` is called 
with `createSerializer` set to `true`. Compilation works fine if 
`withCompatibleMode(CompatibleMode.COMPATIBLE)` is not used.
   
   ### Component(s)
   
   Java
   
   ### Minimal reproduce step
   
   ```
   import org.apache.fury.Fury;
   import org.apache.fury.config.CompatibleMode;
   public class Main {
       private final int myVar = 1;
       static Fury fury;
       static {
           fury = 
Fury.builder().withCompatibleMode(CompatibleMode.COMPATIBLE).build();
           fury.register(Main.class, true);
       }
       public static void main(String[] args) {
           fury.deserialize(fury.serialize(Main.class));
       }
   }
   ```
   
   ### What did you expect to see?
   
   Compilation should succeed in `native-image`
   
   ### What did you see instead?
   
   Compilation fails with:
   ```
   Error: Class initialization of org.example.Main failed. Use the option 
   
       '--initialize-at-run-time=org.example.Main'
   ```
   
   Of course, we can't use `--initialize-at-run-time=org.example.Main` because 
a `java.lang.UnsupportedOperationException` error will occur at runtime, which 
is totally expected due to the constraints of using `native-image`.
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to