Add GraalVM native-image metadata for tcnative#992
Open
emilienbev wants to merge 1 commit into
Open
Conversation
This was referenced Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Note: the follow-up PR to this one is netty/netty#17131
OpenSsl.isAvailable()returnstrueon the JVM butfalsein a GraalVM native image (netty/netty#11088), so apps silently fall back to the JDK SSL provider.netty-tcnativeships noMETA-INF/native-imagemetadata, so the native library never gets embedded, the JNI classes go unregistered, and the tcnative classes initialize at build time instead of runtime. Shipping the metadata in the artifacts keeps it version-matched out of the box.Modifications
Added native-image metadata across the
tcnativeartifacts:netty-tcnative-classes:native-image.properties: initializesio.netty.internal.tcnativeclasses at runtime.jni-config.json: registers alltcnativeclasses for JNI, plus the standard Java types native code creates or throws.reflect-config.json: mirrors the reflection registration fortcnativeclasses.netty-tcnative-boringssl-static:resource-config.json: embeds the native binaries (.so,.jnilib,.dll) soNativeLibraryLoadercan extract and load them at runtime.Result
OpenSsl.isAvailable()now returnstrueinside native images, and BoringSSL loads without issues. Tested alongside the companion Netty PR on Mandrel 25.0.1 (macOS aarch64).