-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't compile native image on arm64 along with jna-platform #31750
Comments
I'm not really sure if the issue is on Quarkus or JNA or Graal but hope you help me to figure it out. |
I wouldn't say that this is a problem in GraalVM. The error log is:
which indicates a conflict between the configuration in @mageddo you should use What got my eye in your configuration is:
why do you explicitly initialize You might also need to reconsider:
|
Hey @zakkak
I didn't use this option on this MRE but used that on the many tries I did, it shows up a not useful log saying that some other class called W32APITypeMapper interface proxy class but don't says who because the stacktrace ends before...
It's because on my real project I need to check the current operation system at build time to decide to go further or not in another code, not specifically related to JNA, I'm using this class as an utils but checked that class hasn't any other dependency which can cause the root cause here, anyway, If you remove that will still get the problem. Another information, the problem only occurs when combining JNA with Quarkus, if you remove one of them from the dependencies then you won't get the issue, that's why I opened the issue here. In other words, If you construct this exact same MRE without quarkus,you won't get the issue. |
Yes, that's because Quarkus asks GraalVM to initialize and link all classes (except for those explicitely excluded) at build-time. If you remove Quarkus the classes get runtime initialized so there is no conflict. Similarly if you remove JNA, GraalVM manages to initialize all classes at build time. |
Describe the bug
Hey I'm opening this issue because I'm having trouble generating native-image for Quarkus on arm64 while using jna-plaform dependency.
Context
I have an application which uses JNA and runs on different plataforms, Linux x64, arm64 and Windows x64. For the this case I need jna-platform dependency to use integrate with windows registry API (Advapi32). When compiling form arm64 I'm getting an issue because
Advapi32
is getting initialized, no idea why.Also confirmed that won't get this issue when not using quarkus dependencies.
log.txt
Actual behavior
I'm having trouble generating native-image for Quarkus on arm64 while using jna-plaform dependency.
How to Reproduce?
See MRE sample https://github.com/mageddo/java-examples/tree/quarkus-jna-platform-bug-evidence-tag/quarkus/quarkus-2-simple
The quarkus project was generated with quarkus mvn plugin ...
Output of
uname -a
orver
Linux typer-pc 5.15.0-47-generic #51-Ubuntu SMP Thu Aug 11 07:51:15 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
$ java -version
openjdk version "19.0.2" 2023-01-17
OpenJDK Runtime Environment GraalVM CE 22.3.1 (build 19.0.2+7-jvmci-22.3-b12)
OpenJDK 64-Bit Server VM GraalVM CE 22.3.1 (build 19.0.2+7-jvmci-22.3-b12, mixed mode, sharing)
The text was updated successfully, but these errors were encountered: