diff --git a/tensorflow/core/platform/default/build_config.bzl b/tensorflow/core/platform/default/build_config.bzl index bef34eec8da..13969310358 100644 --- a/tensorflow/core/platform/default/build_config.bzl +++ b/tensorflow/core/platform/default/build_config.bzl @@ -152,7 +152,6 @@ def cc_proto_library( cc_libs = [], include = None, protoc = "@com_google_protobuf//:protoc", - internal_bootstrap_hack = False, use_grpc_plugin = False, use_grpc_namespace = False, make_default_target_header_only = False, @@ -169,10 +168,6 @@ def cc_proto_library( cc_library. include: a string indicating the include path of the .proto files. protoc: the label of the protocol compiler to generate the sources. - internal_bootstrap_hack: a flag indicate the cc_proto_library is used only - for bootstraping. When it is set to True, no files will be generated. - The rule will simply be a provider for .proto files, so that other - cc_proto_library can depend on it. use_grpc_plugin: a flag to indicate whether to call the grpc C++ plugin when processing the proto files. use_grpc_namespace: the namespace for the grpc services. @@ -194,25 +189,6 @@ def cc_proto_library( if protolib_name == None: protolib_name = name - if internal_bootstrap_hack: - # For pre-checked-in generated files, we add the internal_bootstrap_hack - # which will skip the codegen action. - proto_gen( - name = protolib_name + "_genproto", - srcs = srcs, - includes = includes, - protoc = protoc, - visibility = ["//visibility:public"], - deps = [s + "_genproto" for s in all_protolib_deps], - ) - - # An empty cc_library to make rule dependency consistent. - native.cc_library( - name = name, - **kargs - ) - return - grpc_cpp_plugin = None plugin_options = [] if use_grpc_plugin: @@ -272,10 +248,10 @@ def cc_proto_library( ) native.cc_library( name = header_only_name, + hdrs = gen_hdrs, deps = [ "@com_google_protobuf//:protobuf_headers", ] + header_only_deps + if_static([impl_name]), - hdrs = gen_hdrs, **kargs ) diff --git a/tensorflow/workspace2.bzl b/tensorflow/workspace2.bzl index 550cd925186..39b40f48d7c 100644 --- a/tensorflow/workspace2.bzl +++ b/tensorflow/workspace2.bzl @@ -529,15 +529,15 @@ def _tf_repositories(): tf_http_archive( name = "com_google_protobuf", patch_file = "//third_party/protobuf:protobuf.patch", - sha256 = "cfcba2df10feec52a84208693937c17a4b5df7775e1635c1e3baffc487b24c9b", - strip_prefix = "protobuf-3.9.2", + sha256 = "9748c0d90e54ea09e5e75fb7fac16edce15d2028d4356f32211cfa3c0e956564", + strip_prefix = "protobuf-3.11.4", system_build_file = "//third_party/systemlibs:protobuf.BUILD", system_link_files = { "//third_party/systemlibs:protobuf.bzl": "protobuf.bzl", }, urls = [ - "https://storage.googleapis.com/mirror.tensorflow.org/github.com/protocolbuffers/protobuf/archive/v3.9.2.zip", - "https://github.com/protocolbuffers/protobuf/archive/v3.9.2.zip", + "https://storage.googleapis.com/mirror.tensorflow.org/github.com/protocolbuffers/protobuf/archive/v3.11.4.zip", + "https://github.com/protocolbuffers/protobuf/archive/v3.11.4.zip", ], ) diff --git a/third_party/protobuf/protobuf.patch b/third_party/protobuf/protobuf.patch index 8ce4a843759..98f31908b8b 100644 --- a/third_party/protobuf/protobuf.patch +++ b/third_party/protobuf/protobuf.patch @@ -1,25 +1,25 @@ diff --git a/BUILD b/BUILD -index dbae719ff..87dc38470 100644 +index b32a1f161..9fa411783 100644 --- a/BUILD +++ b/BUILD -@@ -23,7 +23,7 @@ config_setting( +@@ -51,7 +51,7 @@ GTEST_MAIN = select({ # ZLIB configuration ################################################################################ - + -ZLIB_DEPS = ["@zlib//:zlib"] +ZLIB_DEPS = ["@zlib"] - + ################################################################################ # Protobuf Runtime Library -@@ -143,6 +143,7 @@ cc_library( +@@ -198,6 +198,7 @@ cc_library( copts = COPTS, includes = ["src/"], linkopts = LINK_OPTS, + alwayslink = 1, visibility = ["//visibility:public"], ) - -@@ -213,6 +214,7 @@ cc_library( + +@@ -270,6 +271,7 @@ cc_library( copts = COPTS, includes = ["src/"], linkopts = LINK_OPTS, @@ -27,17 +27,25 @@ index dbae719ff..87dc38470 100644 visibility = ["//visibility:public"], deps = [":protobuf_lite"] + PROTOBUF_DEPS, ) +@@ -849,7 +851,7 @@ py_proto_library( + py_extra_srcs = glob(["python/**/__init__.py"]), + py_libs = [ + ":python_srcs", +- "@six//:six", ++ "//external:six", + ], + srcs_version = "PY2AND3", + visibility = ["//visibility:public"], diff --git a/protobuf.bzl b/protobuf.bzl -index e0653321f..253d9cbb5 100644 +index e2821f5b5..9f6a13ef5 100644 --- a/protobuf.bzl +++ b/protobuf.bzl -@@ -84,7 +84,9 @@ def _proto_gen_impl(ctx): - +@@ -88,6 +88,8 @@ def _proto_gen_impl(ctx): for dep in ctx.attr.deps: import_flags += dep.proto.import_flags deps += dep.proto.deps + import_flags = depset(import_flags).to_list() + deps = depset(deps).to_list() - + if not ctx.attr.gen_cc and not ctx.attr.gen_py and not ctx.executable.plugin: - return struct( \ No newline at end of file + return struct(