Skip to content

Commit

Permalink
build TF using its internal protobuf (make sure cms uses the same pro…
Browse files Browse the repository at this point in the history
…tobuf version)
  • Loading branch information
smuzaffar committed Nov 23, 2023
1 parent b97d91a commit 76adab7
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
13 changes: 13 additions & 0 deletions tensorflow/workspace2.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,19 @@ def _tf_repositories():
urls = tf_mirror_urls("https://github.com/googleapis/googleapis/archive/6b3fdcea8bc5398be4e7e9930c693f0ea09316a0.tar.gz"),
)

tf_http_archive(
name = "com_google_protobuf",
patch_file = ["//third_party/protobuf:protobuf.patch"],
sha256 = "f66073dee0bc159157b0bd7f502d7d1ee0bc76b3c1eac9836927511bdc4b3fc1",
strip_prefix = "protobuf-3.21.9",
system_build_file = "//third_party/systemlibs:protobuf.BUILD",
system_link_files = {
"//third_party/systemlibs:protobuf.bzl": "protobuf.bzl",
"//third_party/systemlibs:protobuf_deps.bzl": "protobuf_deps.bzl",
},
urls = tf_mirror_urls("https://github.com/protocolbuffers/protobuf/archive/v3.21.9.zip"),
)

tf_http_archive(
name = "nsync",
patch_file = ["//third_party:nsync.patch"],
Expand Down
1 change: 0 additions & 1 deletion third_party/cms/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ def repos():
hwloc()
grpc()
eigen()
protobuf()
pybind11()
curl()
zlib()
Expand Down
1 change: 0 additions & 1 deletion third_party/systemlibs/grpc.bazel.protobuf.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ _PROTO_EXTENSION = ".proto"
_VIRTUAL_IMPORTS = "/_virtual_imports/"

def well_known_proto_libs():
return []
return [
"@com_google_protobuf//:any_proto",
"@com_google_protobuf//:api_proto",
Expand Down
3 changes: 2 additions & 1 deletion third_party/systemlibs/zlib.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ filegroup(

cc_library(
name = "zlib",
hdrs = ["zlib.h"],
linkopts = ["-Lexternal/zlib/lib -lz"],
includes = ["include"],
includes = ["."],
visibility = ["//visibility:public"],
)
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ def py_proto_library(
if dep != "@com_google_protobuf//:protobuf_python":
genproto_deps.append(dep + "_genproto")
else:
pass
genproto_deps.append("@com_google_protobuf//:well_known_types_py_pb2_genproto")

proto_gen(
name = name + "_genproto",
Expand Down

0 comments on commit 76adab7

Please sign in to comment.