Skip to content

bazel: Use jarjar to avoid xds deps #12243

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

Merged
merged 2 commits into from
Jul 28, 2025
Merged

Conversation

ejona86
Copy link
Member

@ejona86 ejona86 commented Jul 24, 2025

Avoiding so many deps will allow us to upgrade the protos without being forced to upgrade to protobuf-java 4.x. It also removes the remaining non-bzlmod dependencies.

It'd be really easy to get this wrong, so we do two things 1) mirror the gradle configuration as much as possible, as that sees a lot of testing, and 2) run the fake control plane with the results of jarjar. There's lots of classes that we could mess up, but that at least kicks the tires.

XdsTestUtils.buildRouteConfiguration() was moved to ControlPlaneRule to stop the unnecessary circular dependency between the classes and to avoid the many dependencies of XdsTestUtils.

I'm totally hacking java_grpc_library to improve the dependency situation. Long-term, I think we will stop building Java libraries with Bazel and require users to rely entirely on Maven Central. That seems to be the direction Bazel is going and it will greatly simplify the problems we've seen with protobuf having a single repository for many languages. So while the hack isn't too bad, I hope we won't have to live with it long-term.

CC @shivaspeaks, @ted-xie, @mering

Avoiding so many deps will allow us to upgrade the protos without being
forced to upgrade to protobuf-java 4.x. It also removes the remaining
non-bzlmod dependencies.

It'd be really easy to get this wrong, so we do two things 1) mirror the
gradle configuration as much as possible, as that sees a lot of testing,
and 2) run the fake control plane with the _results_ of jarjar. There's
lots of classes that we could mess up, but that at least kicks the tires.

XdsTestUtils.buildRouteConfiguration() was moved to ControlPlaneRule to
stop the unnecessary circular dependency between the classes and to
avoid the many dependencies of XdsTestUtils.

I'm totally hacking java_grpc_library to improve the dependency
situation. Long-term, I think we will stop building Java libraries with
Bazel and require users to rely entirely on Maven Central. That seems to
be the direction Bazel is going and it will greatly simplify the
problems we've seen with protobuf having a single repository for many
languages. So while the hack isn't too bad, I hope we won't have to live
with it long-term.
@ejona86 ejona86 requested a review from kannanjgithub July 24, 2025 22:37
@ejona86 ejona86 added the kokoro:force-run Add this label to a PR to tell Kokoro to re-run all tests. Not generally necessary label Jul 25, 2025
@grpc-kokoro grpc-kokoro removed the kokoro:force-run Add this label to a PR to tell Kokoro to re-run all tests. Not generally necessary label Jul 25, 2025
@shivaspeaks shivaspeaks merged commit 8f09b96 into grpc:master Jul 28, 2025
16 checks passed
@ejona86 ejona86 deleted the bazel-jarjar branch July 28, 2025 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants