From 99d20dfab3d5e399fa0d05420be2aece63445bc7 Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Thu, 14 Jan 2021 15:26:55 -0800 Subject: [PATCH] Add patch to protobuf --- bazel/grpc_deps.bzl | 2 ++ third_party/protobuf.patch | 14 ++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 third_party/protobuf.patch diff --git a/bazel/grpc_deps.bzl b/bazel/grpc_deps.bzl index 1519ba43f5d..1823889f108 100644 --- a/bazel/grpc_deps.bzl +++ b/bazel/grpc_deps.bzl @@ -175,6 +175,8 @@ def grpc_deps(): "https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/protobuf/archive/19fb89416f3fdc2d6668f3738f444885575285bc.tar.gz", "https://github.com/google/protobuf/archive/19fb89416f3fdc2d6668f3738f444885575285bc.tar.gz", ], + patches = ["//third_party:protobuf.patch"], + patch_args = ["-p1"], ) if "com_google_googletest" not in native.existing_rules(): diff --git a/third_party/protobuf.patch b/third_party/protobuf.patch new file mode 100644 index 00000000000..0b302e4d812 --- /dev/null +++ b/third_party/protobuf.patch @@ -0,0 +1,14 @@ +diff --git a/python/google/protobuf/__init__.py b/python/google/protobuf/__init__.py +index 97ac28028..8b7585d9d 100644 +--- a/python/google/protobuf/__init__.py ++++ b/python/google/protobuf/__init__.py +@@ -31,3 +31,9 @@ + # Copyright 2007 Google Inc. All Rights Reserved. + + __version__ = '3.14.0' ++ ++if __name__ != '__main__': ++ try: ++ __import__('pkg_resources').declare_namespace(__name__) ++ except ImportError: ++ __path__ = __import__('pkgutil').extend_path(__path__, __name__)