Upgrade protobuf to 3.9.2
PiperOrigin-RevId: 301935849 Change-Id: I63be177fc6601e4c68498e06bcba15fee8c445f1
This commit is contained in:
parent
08ab10f127
commit
40129bc3fa
@ -60,7 +60,7 @@ REQUIRED_PACKAGES = [
|
|||||||
'keras_preprocessing >= 1.1.0',
|
'keras_preprocessing >= 1.1.0',
|
||||||
'numpy >= 1.16.0, < 2.0',
|
'numpy >= 1.16.0, < 2.0',
|
||||||
'opt_einsum >= 2.3.2',
|
'opt_einsum >= 2.3.2',
|
||||||
'protobuf >= 3.8.0',
|
'protobuf >= 3.9.2',
|
||||||
'tensorboard >= 2.1.0, < 2.2.0',
|
'tensorboard >= 2.1.0, < 2.2.0',
|
||||||
'tensorflow_estimator >= 2.1.0, < 2.2.0',
|
'tensorflow_estimator >= 2.1.0, < 2.2.0',
|
||||||
'termcolor >= 1.1.0',
|
'termcolor >= 1.1.0',
|
||||||
|
@ -471,26 +471,19 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
# 310ba5ee72661c081129eb878c1bbcec936b20f0 is based on 3.8.0 with a fix for protobuf.bzl.
|
|
||||||
PROTOBUF_URLS = [
|
|
||||||
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/protocolbuffers/protobuf/archive/310ba5ee72661c081129eb878c1bbcec936b20f0.tar.gz",
|
|
||||||
"https://github.com/protocolbuffers/protobuf/archive/310ba5ee72661c081129eb878c1bbcec936b20f0.tar.gz",
|
|
||||||
]
|
|
||||||
PROTOBUF_SHA256 = "b9e92f9af8819bbbc514e2902aec860415b70209f31dfc8c4fa72515a5df9d59"
|
|
||||||
PROTOBUF_STRIP_PREFIX = "protobuf-310ba5ee72661c081129eb878c1bbcec936b20f0"
|
|
||||||
|
|
||||||
PROTOBUF_PATCH = "//third_party/protobuf:protobuf.patch"
|
|
||||||
|
|
||||||
tf_http_archive(
|
tf_http_archive(
|
||||||
name = "com_google_protobuf",
|
name = "com_google_protobuf",
|
||||||
patch_file = clean_dep(PROTOBUF_PATCH),
|
patch_file = clean_dep("//third_party/protobuf:protobuf.patch"),
|
||||||
sha256 = PROTOBUF_SHA256,
|
sha256 = "cfcba2df10feec52a84208693937c17a4b5df7775e1635c1e3baffc487b24c9b",
|
||||||
strip_prefix = PROTOBUF_STRIP_PREFIX,
|
strip_prefix = "protobuf-3.9.2",
|
||||||
system_build_file = clean_dep("//third_party/systemlibs:protobuf.BUILD"),
|
system_build_file = clean_dep("//third_party/systemlibs:protobuf.BUILD"),
|
||||||
system_link_files = {
|
system_link_files = {
|
||||||
"//third_party/systemlibs:protobuf.bzl": "protobuf.bzl",
|
"//third_party/systemlibs:protobuf.bzl": "protobuf.bzl",
|
||||||
},
|
},
|
||||||
urls = PROTOBUF_URLS,
|
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",
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
tf_http_archive(
|
tf_http_archive(
|
||||||
|
37
third_party/protobuf/protobuf.patch
vendored
37
third_party/protobuf/protobuf.patch
vendored
@ -1,17 +1,25 @@
|
|||||||
diff --git a/BUILD b/BUILD
|
diff --git a/BUILD b/BUILD
|
||||||
index 2fb26050..c2744d5b 100644
|
index dbae719ff..87dc38470 100644
|
||||||
--- a/BUILD
|
--- a/BUILD
|
||||||
+++ b/BUILD
|
+++ b/BUILD
|
||||||
@@ -19,7 +19,7 @@ config_setting(
|
@@ -23,7 +23,7 @@ config_setting(
|
||||||
# ZLIB configuration
|
# ZLIB configuration
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
-ZLIB_DEPS = ["@zlib//:zlib"]
|
-ZLIB_DEPS = ["@zlib//:zlib"]
|
||||||
+ZLIB_DEPS = ["@zlib"]
|
+ZLIB_DEPS = ["@zlib"]
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Protobuf Runtime Library
|
# Protobuf Runtime Library
|
||||||
@@ -209,6 +209,7 @@ cc_library(
|
@@ -143,6 +143,7 @@ cc_library(
|
||||||
|
copts = COPTS,
|
||||||
|
includes = ["src/"],
|
||||||
|
linkopts = LINK_OPTS,
|
||||||
|
+ alwayslink = 1,
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
)
|
||||||
|
|
||||||
|
@@ -213,6 +214,7 @@ cc_library(
|
||||||
copts = COPTS,
|
copts = COPTS,
|
||||||
includes = ["src/"],
|
includes = ["src/"],
|
||||||
linkopts = LINK_OPTS,
|
linkopts = LINK_OPTS,
|
||||||
@ -19,26 +27,17 @@ index 2fb26050..c2744d5b 100644
|
|||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [":protobuf_lite"] + PROTOBUF_DEPS,
|
deps = [":protobuf_lite"] + PROTOBUF_DEPS,
|
||||||
)
|
)
|
||||||
@@ -219,7 +220,7 @@ cc_library(
|
|
||||||
# TODO(keveman): Remove this target once the support gets added to Bazel.
|
|
||||||
cc_library(
|
|
||||||
name = "protobuf_headers",
|
|
||||||
- hdrs = glob(["src/**/*.h"]),
|
|
||||||
+ hdrs = glob(["src/**/*.h", "src/**/*.inc"]),
|
|
||||||
includes = ["src/"],
|
|
||||||
visibility = ["//visibility:public"],
|
|
||||||
)
|
|
||||||
|
|
||||||
diff --git a/protobuf.bzl b/protobuf.bzl
|
diff --git a/protobuf.bzl b/protobuf.bzl
|
||||||
index e0653321f..4ac23594b 100644
|
index e0653321f..253d9cbb5 100644
|
||||||
--- a/protobuf.bzl
|
--- a/protobuf.bzl
|
||||||
+++ b/protobuf.bzl
|
+++ b/protobuf.bzl
|
||||||
@@ -85,6 +85,8 @@ def _proto_gen_impl(ctx):
|
@@ -84,7 +84,9 @@ def _proto_gen_impl(ctx):
|
||||||
|
|
||||||
for dep in ctx.attr.deps:
|
for dep in ctx.attr.deps:
|
||||||
import_flags += dep.proto.import_flags
|
import_flags += dep.proto.import_flags
|
||||||
deps += dep.proto.deps
|
deps += dep.proto.deps
|
||||||
+ import_flags = depset(import_flags).to_list()
|
+ import_flags = depset(import_flags).to_list()
|
||||||
+ deps = depset(deps).to_list()
|
+ deps = depset(deps).to_list()
|
||||||
|
|
||||||
if not ctx.attr.gen_cc and not ctx.attr.gen_py and not ctx.executable.plugin:
|
if not ctx.attr.gen_cc and not ctx.attr.gen_py and not ctx.executable.plugin:
|
||||||
return struct(
|
return struct(
|
Loading…
Reference in New Issue
Block a user