Closed flyingsilverfin closed 11 months ago
Do not edit the content of this comment. The PR reviewer should simply update this comment by ticking each review item below, as they get completed.
Trivial Change
Code
Architecture
Closing due the following findings:
This upgrade required upgrading the grpc
build rules to a much newer version. However, the newer version of the stackb
rules were tricky to use and didn't appear to work very easily. Instead, this work proceeded with rules-proto-grpc
and successfully got typedb-protocol
(PR), client-java
(PR), factory-tracing
(PR), and typedb
(PR) to a working state, with the exception of assembling the final distributions.
The java_grpc_library
rule provided by rules-proto-grpc
are architected as macros that automatically pull in various dependencies via Bazel. See https://github.com/rules-proto-grpc/rules_proto_grpc/blob/7064b28a75b3feb014b20d3276e17498987a68e2/java/java_grpc_library.bzl#L26.
These dependencies are Bazel, not Maven dependencies. However, in order to build TypeDB's zip
distributions, as well as deploy the Java client, we must provide maven coordinates for every java library we depend on. Because rules-proto-grpc
does not depend on these repositories via Maven, our assembly rules fail.
One 'correct' solution could be to provide a mapping from Bazel targets to Maven coordinates to both the java_deps
and the assemble_maven
rules in vaticle/bazel-distribution. However, we consider reverting back to stackb
simpler, since it produces source Java files instead of compiled JARs, which we can compile into our own java library and control its dependencies explicitly.
We also can gain some efficiency by delaying the Bazel and GRPC upgrade since we will drop Python support for compiling our protocol (after implementing native JNI-based drivers.)
What is the goal of this PR?
In order to use the latest Bazel and GRPC versions, we have to upgrade the various
rules_<lang>
dependencies during the upgrade ofgrpc
dependencies. We also replacestackb_rules_proto
(https://github.com/stackb/rules_proto) withrules-proto-grpc
(https://rules-proto-grpc.com/en/latest/).What are the changes implemented in this PR?
rules_<lang>
versions declared theregrpc
, and replacestackb_rules_proto
withrules-proto-grpc
. However, to make this setup work with the hermitic Python installation, we apply a patch outlined outlined from https://github.com/grpc/grpc/issues/31892. Without this patch, we can receive errors about missing python headers on some operating systems.bazel_toolchains
which were unused (?)