How to update the C++ sources of gRPC:
- Update the gRPC definitions in WORKSPACE file, currently we use https://github.com/grpc/grpc/archive/v1.41.0.tar.gz
- Update the gRPC patch file if necessary, it mostly helps avoid unnecessary dependencies.
- Update third_party/grpc/BUILD to redirect targets to @com_github_grpc_grpc if necessary.
How to update the BUILD/bzl sources of gRPC:
git clone http://github.com/grpc/grpc.git
in a convenient directorygit checkout <tag>
(current is v1.41.0
, commithash fc662b7964384b701af5bd3ce6994d2180080eb4
)mkdir -p third_party/grpc/bazel
cp <gRPC git tree>/bazel/{BUILD,cc_grpc_library.bzl,generate_cc.bzl,protobuf.bzl} third_party/grpc/bazel
- In the
third_party/grpc
directory, apply local patches: patch -p3 < bazel_1.41.0.patch
How to update the Java plugin:
- Checkout tag
v1.41.0
from https://github.com/grpc/grpc-java cp -R <grpc-java git tree>/compiler/src/java_plugin third_party/grpc/compiler/src
How to update the Java code:
Download the necessary jars at version 1.41.0
from maven central.
Submitting the change needs 3 pull requests
- Update third_party/grpc to include files from new version
- Switch distdir_deps.bzl, scripts/bootstrap/compile.sh and any other references to new version
- Remove older version from third_party/grpc