diff --git a/WORKSPACE b/WORKSPACE index 4b25bfc046..be04cfe68a 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -293,7 +293,7 @@ tb_http_archive( urls = tb_mirror_urls("https://github.com/bazelbuild/rules_cc/archive/refs/tags/0.1.0.tar.gz"), ) -tb_http_archive( +http_archive( name = "tb_rules_java", sha256 = "b2519fabcd360529071ade8732f208b3755489ed7668b118f8f90985c0e51324", strip_prefix = "rules_java-8.6.1", @@ -305,11 +305,17 @@ local_repository( path = "third_party/compatibility_proxy", ) +# Protobuf 6.31.1 still expects a pip-style requirements helper repo from its +# WORKSPACE macros. TensorBoard only needs the narrow `install_deps()` / +# `requirement()` surface that protobuf actually loads in this configuration. local_repository( name = "protobuf_pip_deps", path = "third_party/protobuf_pip_deps", ) +# Protobuf's python/dist BUILD also references +# `external/protobuf_pip_deps_setuptools/site-packages`, so keep this separate +# repo shape even though it only vendors an empty placeholder tree here. local_repository( name = "protobuf_pip_deps_setuptools", path = "third_party/protobuf_pip_deps_setuptools", @@ -350,14 +356,14 @@ protobuf_deps() # # Keep this aligned with TensorFlow 2.21's Bazel-side gRPC dependency so the # grpc plugin and protobuf repository stay on a known-compatible combination. -tb_http_archive( +http_archive( name = "com_github_grpc_grpc", sha256 = "dd6a2fa311ba8441bbefd2764c55b99136ff10f7ea42954be96006a2723d33fc", strip_prefix = "grpc-1.74.0", urls = tb_mirror_urls("https://github.com/grpc/grpc/archive/refs/tags/v1.74.0.tar.gz"), ) -tb_http_archive( +http_archive( name = "build_bazel_rules_swift", sha256 = "9919ed1d8dae509645bfd380537ae6501528d8de971caebed6d5185b9970dc4d", urls = tb_mirror_urls("https://github.com/bazelbuild/rules_swift/releases/download/2.1.1/rules_swift.2.1.1.tar.gz"), diff --git a/tensorboard/plugins/debugger_v2/debugger_v2_plugin_test.py b/tensorboard/plugins/debugger_v2/debugger_v2_plugin_test.py index ae30000138..115abfec4b 100644 --- a/tensorboard/plugins/debugger_v2/debugger_v2_plugin_test.py +++ b/tensorboard/plugins/debugger_v2/debugger_v2_plugin_test.py @@ -1494,7 +1494,7 @@ def testServeSourceFileContentOfThisTestFile(self): data = json.loads(response.get_data()) self.assertEqual(data["host_name"], _HOST_NAME) self.assertEqual(data["file_path"], _CURRENT_FILE_FULL_PATH) - with open(__file__, "r") as f: + with open(__file__, "r", newline="") as f: lines = f.read().split("\n") self.assertEqual(data["lines"], lines) diff --git a/third_party/protobuf_pip_deps/requirements.bzl b/third_party/protobuf_pip_deps/requirements.bzl index 5e6cacac3b..0b1227212e 100644 --- a/third_party/protobuf_pip_deps/requirements.bzl +++ b/third_party/protobuf_pip_deps/requirements.bzl @@ -3,7 +3,11 @@ Protobuf's Bazel macros load a pip-style requirements helper that provides `requirement()` and `install_deps()`. TensorBoard only needs a very small subset of that surface here, so this file supplies just the labels -protobuf actually asks for here. +protobuf 6.31.1 actually asks for here: + +* `install_deps()` from protobuf's WORKSPACE setup +* `requirement("setuptools")` from `python/dist/BUILD.bazel` +* `requirement("numpy")` from protobuf's numpy test target """ def requirement(name): @@ -15,5 +19,5 @@ def requirement(name): fail("Unsupported protobuf pip dependency: %s" % name) def install_deps(): - """Compatibility no-op for callers that expect an install_deps symbol.""" + """Compatibility no-op for protobuf's WORKSPACE dependency hook.""" return None diff --git a/third_party/protobuf_pip_deps_setuptools/BUILD.bazel b/third_party/protobuf_pip_deps_setuptools/BUILD.bazel index d1ea5b160c..26855dd329 100644 --- a/third_party/protobuf_pip_deps_setuptools/BUILD.bazel +++ b/third_party/protobuf_pip_deps_setuptools/BUILD.bazel @@ -1,3 +1,6 @@ +# Protobuf's python/dist wheel genrule exports this exact external repo path on +# PYTHONPATH, so preserve the repo/target shape even though TensorBoard only +# needs an empty placeholder tree here. filegroup( name = "site_packages", srcs = glob(["site-packages/**"]), diff --git a/third_party/repo.bzl b/third_party/repo.bzl index 1d26dd3738..5bda8c33fe 100644 --- a/third_party/repo.bzl +++ b/third_party/repo.bzl @@ -23,17 +23,8 @@ def tb_mirror_urls(url): url, ] -def _get_link_dict(ctx, link_files, build_file): - """Builds the destination->source map for files linked into a repo rule.""" - link_dict = {ctx.path(v): ctx.path(Label(k)) for k, v in link_files.items()} - if build_file: - link_dict[ctx.path("BUILD.bazel")] = ctx.path(Label(build_file)) - return link_dict - def _tb_http_archive_impl(ctx): - """Repository-rule implementation with optional patching and linked files.""" - link_dict = _get_link_dict(ctx, ctx.attr.link_files, ctx.attr.build_file) - + """Repository-rule implementation with optional patching.""" patch_files = ctx.attr.patch_file # Resolve patch labels up front so Bazel reports missing patch inputs before # download/extract work has completed. @@ -53,11 +44,6 @@ def _tb_http_archive_impl(ctx): if patch_file: ctx.patch(patch_file, strip = 1) - # Link in any repository-local BUILD/link files after extraction and patching. - for dst, src in link_dict.items(): - ctx.delete(dst) - ctx.symlink(src, dst) - _tb_http_archive = repository_rule( implementation = _tb_http_archive_impl, attrs = { @@ -66,13 +52,11 @@ _tb_http_archive = repository_rule( "strip_prefix": attr.string(), "type": attr.string(), "patch_file": attr.string_list(), - "build_file": attr.string(), - "link_files": attr.string_dict(), }, ) def tb_http_archive(name, sha256, urls, **kwargs): - """Downloads a mirrored archive and creates a TensorBoard external repo.""" + """Downloads a mirrored archive for TensorBoard-specific repo wiring.""" if len(urls) < 2: fail("tb_http_archive(urls) must have redundant URLs.")