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
GraalVM native-image doesn't compile with Netty #11122
Comments
PRs welcome... Sorry I don't have much experience with graal at all. |
In netty java11 the setAccessible operation is disabled, you can change to java8 and below, or add the |
hmm I thought we had integration tests with GraalVM....as incompatibilites pile up with netty development it would get harder and harder to fix after time ;) @skyguard1 there are several crashes in this log while most are non-critical. I think setAccessible is non critical in this case.
and then possible adjust native-image.properties |
@ScottPierce I'm not so familiar with Gradle builds. Can you try out adding the suggested command line argument and post the resulting output?
The |
Sounds related to #10616 |
Yeah, this is a duplicate of #10616. Closing this one. Epoll is initialising classes from JNI code, hence it's not easy to get an accurate trace of what needs to be loaded. You can work around it by initialising all of
Or you can switch to using the NIO transport. |
@chrisvest The folks over at the quarkus project seem to be able to get away without initializing those whole packages at runtime. Instead, they just whitelist some classes that should be run there. I've tried in my big vertx-based application whether this approach works and it does. See https://github.com/quarkusio/quarkus/blob/main/extensions/netty/deployment/src/main/java/io/quarkus/netty/deployment/NettyProcessor.java for some more context in case you are not familiar with what they are doing. Maybe we can just implement the whole thing natively in the netty project? |
@jvican We don't have much graal expertise, so any help with that would be greatly appreciated. Do you want to open a PR? |
I hope to be able to dig some time to help out @chrisvest. It'd be ideal if the GraalVM team actually gave us better direction in how we could set up Netty with GraalVM Native to work effectively, perhaps working hand-to-hand with us for a few weeks. Another fruitful collaboration would be to engage with the Quarkus team. I might open a ticket in their repository to try to build more alignment. |
By the way, do keep us posted on the work you're doing to add epoll native support. I'll borrow whatever configuration you put together and can help test it in production. The JNI configuration is the hardest to get right. |
Motivation: People expect Netty to just be Netty when building native images, and so try to use the epoll transport. Modification: Add a native-image.properties file that tells native-image to initialise all of the epoll classes at runtime. Result: We can now use epoll in native runtime images. Fixes netty#11122 netty#10616 netty#9918
@ScottPierce ScottPierce, have you solved this issue, i have the same error when use graalvm |
No I have not. I’m surprised the Betty team hasn’t solved this yet.
…On Thu, Dec 8, 2022 at 5:57 AM weitingyuk ***@***.***> wrote:
@ScottPierce <https://github.com/ScottPierce> ScottPierce, have you
solved this issue, i have the same error when use graalvm
—
Reply to this email directly, view it on GitHub
<#11122 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGUWAJX5AYE2EGJ6QP5STDWMG5IXANCNFSM4Z6GVBYQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Expected behavior
Netty compiles with GraalVM native-image
Actual behavior
Compilation fails:
Steps to reproduce
Run
Minimal yet complete reproducer code (or URL to code)
Here is a gradle project to reproduce it:
social-media.zip
Netty version
io.netty:netty-all:4.1.60.Final
JVM version (e.g.
java -version
)OS version (e.g.
uname -a
)OSX
The text was updated successfully, but these errors were encountered: