-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Apply package name shading to native-image config files in grpc-netty-shaded #7540
Comments
cc @ejona86 |
It appears https://www.graalvm.org/reference-manual/native-image/BuildConfiguration/ is the documentation for this format. It seems this will need a custom Transformer, potentially along with a Relocator to rework the folder structure. https://imperceptiblethoughts.com/shadow/configuration/merging/ . Ideally that code would be in the Shadow plugin so it can be reused by others. |
Hey, I would like to contribute to this. Could you provide some more guidance on where the Transformer code would live, and how try testing out the shading logic? |
Initially the transformer code would probably live in https://github.com/grpc/grpc-java/blob/master/netty/shaded/build.gradle , but we should consider upstreaming it. Here's the documentation for the shadow plugin: https://imperceptiblethoughts.com/shadow/configuration/merging/ |
The
grpc-netty-shaded
JAR provides several config files under theresources/META-INF
dir:I.e.
native-image.properties
andreflection-config.json
in the screenshot.Inside these config files, the library writers reference Netty package classes, and it would be very useful if these classes could also have their packages renamed during the shading process.
For example
META-INF/native-image/io.netty/codec-http/native-image.properties
is currently this:But it should be updated to this:
These files and settings are used by Oracle's GraalVM compiler to assist in the ahead-of-time compilation process. The original library writers added it in so that it would work with native image building.
Is your feature request related to a problem?
Yes, this will greatly contribute to the internal effort of getting Google Cloud Java client libraries compatible with GraalVM native image compilation.
There is significant user interest from Native image app developers for this feature (Quarkus, Micronaut, Spring + GraalVM).
Describe the solution you'd like
Is it possible to extend the shading process to apply package name updates to config files under
META-INF/native-image/
?Describe alternatives you've considered
Users can duplicate configuration on their own manually, but this runs the risk of going out of sync with the Netty repo when changes are made.
cc/ @meltsufin
The text was updated successfully, but these errors were encountered: