Skip to content

Commit b982761

Browse files
committed
Resolve some bzl build issues after bazel update.
PiperOrigin-RevId: 748491602
1 parent a5d4b8a commit b982761

File tree

5 files changed

+87
-98
lines changed

5 files changed

+87
-98
lines changed

WORKSPACE

Lines changed: 50 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,18 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
77
# the --incompatible_restrict_string_escapes=false flag (flag was removed in
88
# Bazel 5.0).
99
RULES_FOREIGN_CC_VERSION = "0.9.0"
10+
1011
http_archive(
1112
name = "rules_foreign_cc",
13+
patch_tool = "patch",
14+
patches = ["//third_party:rules_foreign_cc.patch"],
1215
sha256 = "2a4d07cd64b0719b39a7c12218a3e507672b82a97b98c6a89d38565894cf7c51",
1316
strip_prefix = "rules_foreign_cc-%s" % RULES_FOREIGN_CC_VERSION,
1417
url = "https://github.com/bazelbuild/rules_foreign_cc/archive/refs/tags/%s.tar.gz" % RULES_FOREIGN_CC_VERSION,
15-
patch_tool = "patch",
16-
patches = ["//third_party:rules_foreign_cc.patch",],
1718
)
1819

1920
load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")
21+
2022
rules_foreign_cc_dependencies()
2123

2224
http_archive(
@@ -28,30 +30,31 @@ http_archive(
2830
],
2931
)
3032

31-
_PROTOBUF_COMMIT = "3.21.9" # 3.20.3
33+
_PROTOBUF_COMMIT = "4.25.6" # 4.25.6
3234

3335
http_archive(
3436
name = "com_google_protobuf",
35-
sha256 = "f66073dee0bc159157b0bd7f502d7d1ee0bc76b3c1eac9836927511bdc4b3fc1",
37+
sha256 = "ff6e9c3db65f985461d200c96c771328b6186ee0b10bc7cb2bbc87cf02ebd864",
3638
strip_prefix = "protobuf-%s" % _PROTOBUF_COMMIT,
3739
urls = [
38-
"https://github.com/protocolbuffers/protobuf/archive/v3.21.9.zip"
40+
"https://github.com/protocolbuffers/protobuf/archive/v4.25.6.zip",
3941
],
4042
)
4143

4244
# Needed by abseil-py by zetasql.
4345
http_archive(
4446
name = "six_archive",
47+
build_file = "//third_party:six.BUILD",
48+
sha256 = "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a",
49+
strip_prefix = "six-1.10.0",
4550
urls = [
4651
"http://mirror.bazel.build/pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz",
4752
"https://pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz",
4853
],
49-
sha256 = "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a",
50-
strip_prefix = "six-1.10.0",
51-
build_file = "//third_party:six.BUILD"
5254
)
5355

5456
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
57+
5558
protobuf_deps()
5659

5760
# Use the last commit on the relevant release branch to update.
@@ -64,54 +67,58 @@ ARROW_COMMIT = "347a88ff9d20e2a4061eec0b455b8ea1aa8335dc" # 6.0.1
6467
http_archive(
6568
name = "arrow",
6669
build_file = "//third_party:arrow.BUILD",
67-
strip_prefix = "arrow-%s" % ARROW_COMMIT,
70+
patches = ["//third_party:arrow.patch"],
6871
sha256 = "55fc466d0043c4cce0756bc18e1e62b3233be74c9afe8dc0d18420b9a5fd9714",
72+
strip_prefix = "arrow-%s" % ARROW_COMMIT,
6973
urls = ["https://github.com/apache/arrow/archive/%s.zip" % ARROW_COMMIT],
70-
patches = ["//third_party:arrow.patch"],
7174
)
7275

73-
COM_GOOGLE_ABSL_COMMIT = "92fdbfb301f8b301b28ab5c99e7361e775c2fb8a" # 2022-08-25 Abseil Logging library first release
76+
COM_GOOGLE_ABSL_COMMIT = "fb3621f4f897824c0dbe0615fa94543df6192f30" # lts_2023_08_0
77+
7478
http_archive(
75-
name = "com_google_absl",
76-
url = "https://github.com/abseil/abseil-cpp/archive/%s.tar.gz" % COM_GOOGLE_ABSL_COMMIT,
77-
sha256 = "71d38c5f44997a5ccbc338f904c8682b40c25cad60b9cbaf27087a917228d5fa",
78-
strip_prefix = "abseil-cpp-%s" % COM_GOOGLE_ABSL_COMMIT
79+
name = "com_google_absl",
80+
sha256 = "0320586856674d16b0b7a4d4afb22151bdc798490bb7f295eddd8f6a62b46fea",
81+
strip_prefix = "abseil-cpp-%s" % COM_GOOGLE_ABSL_COMMIT,
82+
url = "https://github.com/abseil/abseil-cpp/archive/%s.tar.gz" % COM_GOOGLE_ABSL_COMMIT,
7983
)
8084

81-
TFMD_COMMIT = "71c756354375e9f72f32b7eb3d7f13221c83fea6" # 1.16.0
85+
TFMD_COMMIT = "404805761e614561cceedc429e67c357c62be26d" # 1.17.1
86+
8287
http_archive(
8388
name = "com_github_tensorflow_metadata",
84-
urls = ["https://github.com/tensorflow/metadata/archive/%s.zip" % TFMD_COMMIT],
89+
sha256 = "1b72e0e5085812cd9b19e004a381b544542f9545a081f0f738c5ed6b8bb886a2",
8590
strip_prefix = "metadata-%s" % TFMD_COMMIT,
86-
sha256 = "9826543733abbe1fdd0b1bf9a5155bc8279a44e738dfd6149e647592c4657594",
91+
urls = ["https://github.com/tensorflow/metadata/archive/%s.zip" % TFMD_COMMIT],
8792
)
8893

8994
# TODO(b/177694034): Follow the new format for tensorflow import after TF 2.5.
9095
#here
91-
TENSORFLOW_COMMIT = "810f233968cec850915324948bbbc338c97cf57f" # 2.16.2
96+
TENSORFLOW_COMMIT = "3c92ac03cab816044f7b18a86eb86aa01a294d95" # 2.17.1
97+
9298
http_archive(
9399
name = "org_tensorflow_no_deps",
94-
sha256 = "3b875c5121e752adc86578dc24747a220acfa2a7afa4026ff4172500b100854f",
100+
patches = [
101+
"//third_party:tensorflow_expose_example_proto.patch",
102+
],
103+
sha256 = "317dd95c4830a408b14f3e802698eb68d70d81c7c7cfcd3d28b0ba023fe84a68",
95104
strip_prefix = "tensorflow-%s" % TENSORFLOW_COMMIT,
96105
urls = [
97-
"https://mirror.bazel.build/github.com/tensorflow/tensorflow/archive/%s.tar.gz" % TENSORFLOW_COMMIT,
98106
"https://github.com/tensorflow/tensorflow/archive/%s.tar.gz" % TENSORFLOW_COMMIT,
99107
],
100-
patches = [
101-
"//third_party:tensorflow_expose_example_proto.patch",
102-
],
103108
)
104109

105110
PYBIND11_COMMIT = "8a099e44b3d5f85b20f05828d919d2332a8de841" # 2.11.1
111+
106112
http_archive(
107-
name = "pybind11",
108-
build_file = "//third_party:pybind11.BUILD",
109-
strip_prefix = "pybind11-%s" % PYBIND11_COMMIT,
110-
urls = ["https://github.com/pybind/pybind11/archive/%s.zip" % PYBIND11_COMMIT],
111-
sha256 = "8f4b7f28d214e36301435c055076c36186388dc9617117802cba8a059347cb00",
113+
name = "pybind11",
114+
build_file = "//third_party:pybind11.BUILD",
115+
sha256 = "8f4b7f28d214e36301435c055076c36186388dc9617117802cba8a059347cb00",
116+
strip_prefix = "pybind11-%s" % PYBIND11_COMMIT,
117+
urls = ["https://github.com/pybind/pybind11/archive/%s.zip" % PYBIND11_COMMIT],
112118
)
113119

114120
load("//third_party:python_configure.bzl", "local_python_configure")
121+
115122
local_python_configure(name = "local_config_python")
116123

117124
http_archive(
@@ -124,41 +131,48 @@ http_archive(
124131
],
125132
)
126133

127-
ZETASQL_COMMIT = "ac37cf5c0d80b5605176fc0f29e87b12f00be693" # 08/10/2022
134+
ZETASQL_COMMIT = "589026c410c42de9aa8ee92ad16f745977140041" # 11/01/2023
135+
128136
http_archive(
129137
name = "com_google_zetasql",
130-
urls = ["https://github.com/google/zetasql/archive/%s.zip" % ZETASQL_COMMIT],
131138
strip_prefix = "zetasql-%s" % ZETASQL_COMMIT,
132-
sha256 = "651a768cd51627f58aa6de7039aba9ddab22f4b0450521169800555269447840",
139+
urls = ["https://github.com/google/zetasql/archive/%s.zip" % ZETASQL_COMMIT],
133140
)
134141

135142
load("@com_google_zetasql//bazel:zetasql_deps_step_1.bzl", "zetasql_deps_step_1")
143+
136144
zetasql_deps_step_1()
145+
137146
load("@com_google_zetasql//bazel:zetasql_deps_step_2.bzl", "zetasql_deps_step_2")
147+
138148
zetasql_deps_step_2(
139149
analyzer_deps = True,
140150
evaluator_deps = True,
141-
tools_deps = False,
142151
java_deps = False,
143-
testing_deps = False)
152+
testing_deps = False,
153+
tools_deps = False,
154+
)
144155

145156
# This is part of what zetasql_deps_step_3() does.
146157
load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language")
158+
147159
switched_rules_by_language(
148160
name = "com_google_googleapis_imports",
149161
cc = True,
150162
)
151163

152164
_PLATFORMS_VERSION = "0.0.6"
165+
153166
http_archive(
154167
name = "platforms",
168+
sha256 = "5308fc1d8865406a49427ba24a9ab53087f17f5266a7aabbfc28823f3916e1ca",
155169
urls = [
156170
"https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/%s/platforms-%s.tar.gz" % (_PLATFORMS_VERSION, _PLATFORMS_VERSION),
157171
"https://github.com/bazelbuild/platforms/releases/download/%s/platforms-%s.tar.gz" % (_PLATFORMS_VERSION, _PLATFORMS_VERSION),
158172
],
159-
sha256 = "5308fc1d8865406a49427ba24a9ab53087f17f5266a7aabbfc28823f3916e1ca",
160173
)
161174

162175
# Specify the minimum required bazel version.
163176
load("@bazel_skylib//lib:versions.bzl", "versions")
164-
versions.check("6.1.0")
177+
178+
versions.check("6.5.0")

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ def select_constraint(default, nightly=None, git_master=None):
178178
'tensorflow>=2.17,<2.18',
179179
'tensorflow-metadata'
180180
+ select_constraint(
181-
default='>=1.16.1,<1.17.0',
182-
nightly='>=1.17.0.dev',
181+
default='>=1.17.1,<1.18.0',
182+
nightly='>=1.18.0.dev',
183183
git_master='@git+https://github.com/tensorflow/metadata@master',
184184
),
185185
'tensorflow-serving-api'

tfx_bsl/build_macros.bzl

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,25 @@
11
"""BUILD macros used in OSS builds."""
22

3-
load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library", "py_proto_library")
3+
load("@com_google_protobuf//:protobuf.bzl", "py_proto_library")
4+
load("@rules_cc//cc:defs.bzl", "cc_proto_library")
45

5-
def tfx_bsl_proto_library(
6-
name,
7-
srcs = [],
8-
has_services = False,
9-
deps = [],
10-
visibility = None,
11-
testonly = 0,
12-
cc_grpc_version = None):
13-
"""Opensource cc_proto_library."""
14-
_ignore = [has_services]
15-
native.filegroup(
16-
name = name + "_proto_srcs",
17-
srcs = srcs,
18-
testonly = testonly,
19-
)
6+
def tfx_bsl_proto_library(name, **kwargs):
7+
"""Google proto_library and cc_proto_library.
208
21-
use_grpc_plugin = None
22-
if cc_grpc_version:
23-
use_grpc_plugin = True
24-
cc_proto_library(
25-
name = name,
26-
srcs = srcs,
27-
deps = deps,
28-
cc_libs = ["@com_google_protobuf//:protobuf"],
29-
protoc = "@com_google_protobuf//:protoc",
30-
default_runtime = "@com_google_protobuf//:protobuf",
31-
use_grpc_plugin = use_grpc_plugin,
32-
testonly = testonly,
33-
visibility = visibility,
34-
)
9+
Args:
10+
name: Name of the cc proto library.
11+
**kwargs: Keyword arguments to pass to the proto libraries."""
12+
native.proto_library(name = name + "_proto", **kwargs) # buildifier: disable=native-proto
13+
cc_proto_kwargs = {
14+
"deps": [":" + name + "_proto"],
15+
}
16+
if "visibility" in kwargs:
17+
cc_proto_kwargs["visibility"] = kwargs["visibility"]
18+
if "testonly" in kwargs:
19+
cc_proto_kwargs["testonly"] = kwargs["testonly"]
20+
if "compatible_with" in kwargs:
21+
cc_proto_kwargs["compatible_with"] = kwargs["compatible_with"]
22+
cc_proto_library(name = name, **cc_proto_kwargs)
3523

3624
def tfx_bsl_py_proto_library(
3725
name,

tfx_bsl/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
"""Contains the version string of tfx_bsl."""
1515

1616
# Note that setup.py uses this version.
17-
__version__ = '1.17.0.dev'
17+
__version__ = '1.18.0.dev'

third_party/tensorflow_expose_example_proto.patch

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
1-
From a0a912ab8ae48205191b6295cc08e41064026ed0 Mon Sep 17 00:00:00 2001
2-
From: Ihor Indyk <ihor.indyk@gmail.com>
3-
Date: Thu, 23 Mar 2023 13:17:53 -0700
4-
Subject: [PATCH] update example visibility
5-
6-
---
7-
tensorflow/core/example/BUILD | 195 ++--------------------------------
8-
1 file changed, 9 insertions(+), 186 deletions(-)
9-
101
diff --git tensorflow/core/example/BUILD tensorflow/core/example/BUILD
11-
index 2a1b70a5350..c23ddcdf01d 100644
2+
index 4527044f383..2d61de25200 100644
123
--- tensorflow/core/example/BUILD
134
+++ tensorflow/core/example/BUILD
14-
@@ -1,187 +1,10 @@
15-
-load("//tensorflow:tensorflow.default.bzl", "filegroup")
16-
-load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
5+
@@ -1,187 +1,14 @@
176
-load(
187
- "@io_bazel_rules_closure//closure:defs.bzl",
198
- "closure_proto_library",
@@ -23,12 +12,14 @@ index 2a1b70a5350..c23ddcdf01d 100644
2312
- "tf_cc_test",
2413
- "tf_copts",
2514
-)
15+
-load("//tensorflow:tensorflow.default.bzl", "filegroup")
2616
-load(
2717
- "//tensorflow/core/platform:build_config.bzl",
2818
- "tf_jspb_proto_library",
2919
- "tf_proto_library",
3020
- "tf_pyclif_proto_library",
3121
-)
22+
-load("//tensorflow/core/platform:rules_cc.bzl", "cc_library")
3223
-
3324
-package(
3425
- # copybara:uncomment default_applicable_licenses = ["//tensorflow:license"],
@@ -119,15 +110,18 @@ index 2a1b70a5350..c23ddcdf01d 100644
119110
-
120111
-tf_proto_library(
121112
- name = "example_protos",
122-
- srcs = [
123-
- "example.proto",
124-
- "feature.proto",
125-
- ],
113+
+proto_library(
114+
+ name = "example_proto_genproto",
115+
srcs = [
116+
"example.proto",
117+
"feature.proto",
118+
],
126119
- cc_api_version = 2,
127120
- make_default_target_header_only = True,
128121
- tags = ["alt_dep=//third_party/tensorflow/core:protos_all"],
129-
-)
130-
-
122+
+ visibility = ["//visibility:public"],
123+
)
124+
131125
-tf_proto_library(
132126
- name = "example_parser_configuration_proto",
133127
- srcs = ["example_parser_configuration.proto"],
@@ -198,15 +192,8 @@ index 2a1b70a5350..c23ddcdf01d 100644
198192
- visibility = [
199193
- "//tensorflow/core:__pkg__",
200194
- ],
201-
+load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library", "py_proto_library")
202-
+
203195
+cc_proto_library(
204-
+ name = "example_proto",
205-
+ srcs = [
206-
+ "example.proto",
207-
+ "feature.proto",
208-
+ ],
209-
+ visibility = ["//visibility:public"],
196+
+ name = "example_proto",
197+
+ visibility = ["//visibility:public"],
198+
+ deps = [":example_proto_genproto"],
210199
)
211-
--
212-
2.40.0.348.gf938b09366-goog

0 commit comments

Comments
 (0)