Upgrade rules_cc to 0.2.20 and bazel_skylib to 1.9.0 in TensorFlow

- Explicitly define rules_cc 0.2.20 in workspace3.bzl.
- Call compatibility_proxy_repo() in WORKSPACE and workspace1.bzl to define
  @cc_compatibility_proxy in WORKSPACE mode.
- Bump rules_cc to 0.2.20 in MODULE.bazel.
- Bump bazel_skylib to 1.9.0 in workspace3.bzl and MODULE.bazel to support
  the 'scope' attribute on bool_flag used by rules_cc 0.2.20.
- In third_party/googleapis/build_rules.bzl.oss, load cc_proto_library from
  protobuf instead of rules_cc defs.bzl, avoiding errors from the removal
  of cc_proto_library in rules_cc >= 0.2.18.

PiperOrigin-RevId: 975045752
This commit is contained in:
Adrian Kuegel
2026-09-02 04:22:46 -07:00
committed by TensorFlower Gardener
parent eb0f8c70aa
commit fccb487ea3
5 changed files with 21 additions and 5 deletions
+2 -2
View File
@@ -20,7 +20,7 @@ bazel_dep(name = "nlohmann_json", version = "3.12.0.bcr.1", repo_name = "nlohman
bazel_dep(name = "abseil-py", version = "2.1.0", repo_name = "absl_py")
bazel_dep(name = "rules_python", version = "1.6.1")
bazel_dep(name = "rules_shell", version = "0.6.1")
bazel_dep(name = "bazel_skylib", version = "1.8.1")
bazel_dep(name = "bazel_skylib", version = "1.9.0")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "rules_license", version = "1.0.0")
bazel_dep(name = "rules_pkg", version = "1.0.1")
@@ -35,7 +35,7 @@ single_version_override(
bazel_dep(name = "google_cloud_cpp", version = "3.0.0-rc1", repo_name = "com_github_googlecloudplatform_google_cloud_cpp")
bazel_dep(name = "crc32c", version = "1.1.0", repo_name = "com_github_google_crc32c")
bazel_dep(name = "brotli", version = "1.1.0", repo_name = "org_brotli")
bazel_dep(name = "rules_cc", version = "0.2.11")
bazel_dep(name = "rules_cc", version = "0.2.20")
bazel_dep(name = "curl", version = "8.11.0.bcr.5")
bazel_dep(name = "rules_webtesting", version = "0.4.1", repo_name = "io_bazel_rules_webtesting")
bazel_dep(name = "rules_closure", version = "0.15.0", repo_name = "io_bazel_rules_closure")
+4
View File
@@ -44,6 +44,10 @@ load("@bazel_features//:deps.bzl", "bazel_features_deps")
bazel_features_deps()
load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo")
compatibility_proxy_repo()
load("@rules_shell//shell:repositories.bzl", "rules_shell_dependencies", "rules_shell_toolchains")
rules_shell_dependencies()
+3
View File
@@ -18,6 +18,7 @@
load("@com_google_benchmark//:bazel/benchmark_deps.bzl", "benchmark_deps")
load("@grpc//bazel:grpc_deps.bzl", "grpc_deps")
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_repositories")
load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo")
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
load("@xla//third_party/llvm:setup.bzl", "llvm_setup")
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
@@ -33,6 +34,8 @@ def workspace(with_rules_cc = True):
llvm_setup(name = "llvm-project")
native.register_toolchains("@local_config_python//:py_toolchain")
rules_pkg_dependencies()
if "cc_compatibility_proxy" not in native.existing_rules():
compatibility_proxy_repo()
closure_repositories()
+11 -2
View File
@@ -36,9 +36,9 @@ def workspace():
# https://github.com/bazelbuild/bazel-skylib/releases
tf_http_archive(
name = "bazel_skylib",
sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f",
sha256 = "3b5b49006181f5f8ff626ef8ddceaa95e9bb8ad294f7b5d7b11ea9f7ddaf8c59",
urls = tf_mirror_urls(
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.9.0/bazel-skylib-1.9.0.tar.gz",
),
)
@@ -67,6 +67,15 @@ def workspace():
),
)
tf_http_archive(
name = "rules_cc",
sha256 = "69e05df29f0010ba248ef8dafc1f084c8fd2f5c553da634422d8167f5c4b277b",
strip_prefix = "rules_cc-0.2.20",
urls = tf_mirror_urls(
"https://github.com/bazelbuild/rules_cc/releases/download/0.2.20/rules_cc-0.2.20.tar.gz",
),
)
# Toolchains for ML projects hermetic builds.
# Details: https://github.com/google-ml-infra/rules_ml_toolchain
tf_http_archive(
+1 -1
View File
@@ -16,8 +16,8 @@
Utilities for building grpc and proto libraries from googleapis.
"""
load("@com_google_protobuf//bazel:cc_proto_library.bzl", native_cc_proto_library = "cc_proto_library")
load("@grpc//bazel:generate_cc.bzl", "generate_cc")
load("@rules_cc//cc:defs.bzl", native_cc_proto_library = "cc_proto_library")
def _tf_cc_headers(ctx):
if len(ctx.attr.deps) != 1: