-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Netty update caused failure when building image with GraalVM for JDK 17 #39819
Comments
/cc @geoand |
Nice :) |
I assume we should also add the change you made in your PR to main @jponge |
I'm looking into the reproducer and will check |
🙏🏼 |
Confirmed this happens on 17 and not 21 😞 |
Interesting |
@zakkak do we still support building with GraalVM for Java 17? |
With 17 I've been able to shelve a few issues by adding these 2 classes, just like in my 3.2 backport branch diff --git a/extensions/netty/deployment/src/main/java/io/quarkus/netty/deployment/NettyProcessor.java b/extensions/netty/deployment/src/main/java/io/quarkus/netty/deployment/NettyProcessor.java
index a7d5ae3e2c2..4c2741d2092 100644
--- a/extensions/netty/deployment/src/main/java/io/quarkus/netty/deployment/NettyProcessor.java
+++ b/extensions/netty/deployment/src/main/java/io/quarkus/netty/deployment/NettyProcessor.java
@@ -105,6 +105,8 @@ NativeImageConfigBuildItem build(
.addRuntimeInitializedClass("io.netty.handler.ssl.ReferenceCountedOpenSslEngine")
.addRuntimeInitializedClass("io.netty.handler.ssl.ReferenceCountedOpenSslContext")
.addRuntimeInitializedClass("io.netty.handler.ssl.ReferenceCountedOpenSslClientContext")
+ .addRuntimeInitializedClass("io.netty.handler.ssl.JdkSslServerContext")
+ .addRuntimeInitializedClass("io.netty.handler.ssl.JdkSslClientContext")
.addRuntimeInitializedClass("io.netty.handler.ssl.util.ThreadLocalInsecureRandom")
.addRuntimeInitializedClass("io.netty.buffer.ByteBufUtil$HexUtil")
.addRuntimeInitializedClass("io.netty.buffer.PooledByteBufAllocator") Now the newly added Mutiny native integration tests fail on 17 with the remaining issue (I had tested with 21, just like in CI)
This one looks tricky |
It's tricky because this class must not be loaded (initialized) at runtime as it loads buffers (which are machine-dependent). At the same time, to register for Unusafe access, the class must be loaded... |
And 21 is fine, not 17 🤦 |
To be exhaustive:
yields:
|
So, it uses the Quarkus feature to register the unsafe access. This feature requires loading the class (at build time) to extract the Unsafe field. I'm not sure, but we may be able to do that differently without the Quarkus feature (using plain old metadata). What's suspicious is that only |
You need to register |
Ok, so... removing all I'm getting mad 🤣 |
AFAIK GraalVM for Java 17 support is on "best effort" mode. We prefer to keep it working since it allows us to do cross-version comparisons but shouldn't be a blocker, i.e. if something is essential to Quarkus and breaks GraalVM for Java 17 compatibility it's OK. |
To me this would be a quarkus decision. It seems fine to only support GraalVM for JDK 21 and GraalVM for JDK 22 for quarkus main. Quarkus 3.2 needs to support GraalVM for JDK 17. |
Note: I'm still working on a fix that'd work for 17 + 21 😉 |
See quarkusio#39819 and quarkusio#39788 (cherry picked from commit b35ae00)
See quarkusio#39819 and quarkusio#39788 (cherry picked from commit b35ae00)
See quarkusio#39819 and quarkusio#39788 (cherry picked from commit b35ae00) (cherry picked from commit d2673c8)
See quarkusio#39819 and quarkusio#39788 (cherry picked from commit b35ae00) (cherry picked from commit d2673c8)
See quarkusio#39819 and quarkusio#39788 (cherry picked from commit b35ae00) (cherry picked from commit d2673c8)
Describe the bug
When building image containing
quarkus-jdbc-postgresql
the build failing onPerforming analysis...
step with error:It was caused probably by #39764 (not tested it without this commit) and it's probably same or simillar problem as in #39788 PR.
This seems only affecting jdk 17 not jdk 21.
Looking at GeaalVM info for jdk 17:
for jdk 21:
Both GraalVM version is pulled automatically as I'm using openjdk
Expected behavior
No response
Actual behavior
No response
How to Reproduce?
git clone -b netty-native [email protected]:jedla97/quarkus-reproducers.git
cd quarkus-reproducers
./mvnw package -Dnative
Output of
uname -a
orver
No response
Output of
java -version
No response
Mandrel or GraalVM version (if different from Java)
No response
Quarkus version or git rev
main/999-SNAPSHOT
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: