Skip to content
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

Provide grpc-xds artifact w/o the need of grpc-netty-shaded #9736

Closed
alesj opened this issue Dec 7, 2022 · 4 comments
Closed

Provide grpc-xds artifact w/o the need of grpc-netty-shaded #9736

alesj opened this issue Dec 7, 2022 · 4 comments

Comments

@alesj
Copy link

alesj commented Dec 7, 2022

Is your feature request related to a problem?

Yes.
The problem is when we try to generate a (GraalVM) native image with grpc-xds as a dependency

This is what I get when I exclude grpc-netty-shaded dependency ...

Describe the solution you'd like

To have a grpc-xds jar, which doesn't depend on grpc-netty-shaded.

Describe alternatives you've considered

Currently none.
Dunno if I can 'trick' GraalVM to handle this ...

Additional context

This is where we depend on grpc-xds

And current PR

@ejona86
Copy link
Member

ejona86 commented Dec 12, 2022

This error is reported at image build time because class io.grpc.netty.shaded.io.netty.util.internal.logging.Log4J2LoggerFactory is registered for linking at image build time by command line

This class is also transitively pulled in via grpc-netty, so anything that makes grpc-netty work should also make grpc-netty-shaded work. Why would this not be a problem for grpc-netty?

Excluding grpc-netty-shaded is definitely broken. We have code that tries to rewrite io.netty's configuration (since #8258). Maybe something there isn't working like we'd hope.

@ejona86
Copy link
Member

ejona86 commented Dec 12, 2022

(I will say we don't have any real familiarity with GraalVM static compilation, other than theory. So changes for this stuff have typically come from those more experienced.)

@alesj
Copy link
Author

alesj commented Dec 15, 2022

Yeah, the 1st error is weird -- as the Log4JLogger class is next to the 'factory' that wants to create it ... so no idea why that breaks.

There is more context here:

I did manage to get around this by extracting xDS stuff into a new module / jar, so our plain gRPC extension works as before; native and all ...

@ejona86
Copy link
Member

ejona86 commented Jan 3, 2023

We'd love contributions to make this easier, but we don't have the experience to figure out what is getting confused. So if someone figures out a way to make the GraalVM experience more seemless, please open an issue/PR.

@ejona86 ejona86 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 3, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants