Files
grpc/MODULE.bazel
yuanweiz 8713acf3a6 [bzlmod] Support repo @google_cloud_cpp in bzlmod (#41311)
This change should enable us to build most C/C++ tests with bzlmod.

`googleapis` is also updated because google_cloud_cpp 2.35.0 uses a modified version of googleapis. This requires us to copy some boilerplate code from upstream (BCR and google_cloud_cpp respectively).

Alternatively we could also use google_cloud_cpp from BCR, it takes less coding work but the lowest version available is 3.0.0 and requires a bunch of version bumps to other modules, so it might be more risky.

`rules_proto` version is increase to 7.1.0 (requested by google_cloud_cpp)

<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes #41311

PiperOrigin-RevId: 859764899
2026-01-22 14:07:31 -08:00

129 lines
5.0 KiB
Python

# Copyright 2025 the gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
module(
name = "grpc",
version = "1.79.0-dev",
compatibility_level = 1,
repo_name = "com_github_grpc_grpc",
)
# Regular dependencies
# ====================
bazel_dep(name = "abseil-cpp", version = "20250512.1", repo_name = "com_google_absl")
bazel_dep(name = "apple_support", version = "1.17.1", repo_name = "build_bazel_apple_support")
bazel_dep(name = "bazel_skylib", version = "1.8.1")
bazel_dep(name = "boringssl", version = "0.20241024.0") # mistmatched 20241211
bazel_dep(name = "c-ares", version = "1.19.1", repo_name = "com_github_cares_cares")
bazel_dep(name = "envoy_api", version = "0.0.0-20251216-6ef568c")
bazel_dep(name = "googleapis-cc", version = "1.0.0")
bazel_dep(name = "googleapis-grpc-cc", version = "1.0.0")
bazel_dep(name = "googleapis-python", version = "1.0.0")
bazel_dep(name = "googletest", version = "1.17.0", repo_name = "com_google_googletest")
bazel_dep(name = "opencensus-cpp", version = "0.0.0-20230502-50eb5de.bcr.2", repo_name = "io_opencensus_cpp")
bazel_dep(name = "openssl", version = "3.3.1.bcr.1")
bazel_dep(name = "opentelemetry-cpp", version = "1.19.0", repo_name = "io_opentelemetry_cpp")
bazel_dep(name = "platforms", version = "0.0.11")
bazel_dep(name = "protobuf", version = "31.1", repo_name = "com_google_protobuf")
bazel_dep(name = "protoc-gen-validate", version = "1.2.1.bcr.1", repo_name = "com_envoyproxy_protoc_gen_validate") # Not needed directly
bazel_dep(name = "re2", version = "2024-07-02.bcr.1", repo_name = "com_googlesource_code_re2") # mistmached 2022-04-01
bazel_dep(name = "rules_apple", version = "3.16.0", repo_name = "build_bazel_rules_apple")
bazel_dep(name = "rules_cc", version = "0.1.1")
bazel_dep(name = "rules_proto", version = "7.0.2")
bazel_dep(name = "xds", version = "0.0.0-20240423-555b57e", repo_name = "com_github_cncf_xds") # mismatched 20231116
bazel_dep(name = "zlib", version = "1.3.1.bcr.5")
# Development dependencies
# ========================
bazel_dep(name = "google_benchmark", version = "1.9.0", dev_dependency = True, repo_name = "com_github_google_benchmark")
bazel_dep(name = "rules_shell", version = "0.4.0", dev_dependency = True)
# Python dependencies
# ===================
bazel_dep(name = "rules_python", version = "1.6.3")
PYTHON_VERSIONS = [
"3.9",
"3.10",
"3.11",
"3.12",
"3.13",
"3.14",
]
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
[
python.toolchain(
is_default = python_version == PYTHON_VERSIONS[-1],
python_version = python_version,
)
for python_version in PYTHON_VERSIONS
]
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
[
pip.parse(
hub_name = "grpc_python_dependencies",
python_version = python_version,
requirements_lock = "//:requirements.bazel.lock",
)
for python_version in PYTHON_VERSIONS
]
use_repo(pip, "grpc_python_dependencies")
bazel_dep(name = "cython", version = "3.0.11-1")
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "typing_extensions",
build_file = "//third_party:typing_extensions.BUILD",
sha256 = "bf6f56b36d8bc9156e518eb1cc37a146284082fa53522033f772aefbecfd15fc",
strip_prefix = "typing_extensions-4.12.2",
url = "https://github.com/python/typing_extensions/archive/4.12.2.tar.gz",
)
# Provide repo @com_google_fuzztest.
include("//bazel:com_google_fuzztest.MODULE.bazel")
# Provides repo @grpc_custom_exec_properties.
include("//bazel:grpc_custom_exec_properties.MODULE.bazel")
# -- google_cloud_cpp 2.35.0 related repos, which requires a modified version of googleapis, hence the version pinning.
bazel_dep(name = "googleapis", version = "0.0.0-20251003-2193a2bf", repo_name = "com_google_googleapis")
single_version_override(
module_name = "googleapis",
patch_strip = 1,
patches = [
"//bazel:googleapis/patches/fix_google_cloud_cpp.patch",
],
version = "0.0.0-20251003-2193a2bf",
)
bazel_dep(name = "google_cloud_cpp", version = "2.35.0", dev_dependency = True)
archive_override(
module_name = "google_cloud_cpp",
integrity = "sha256-geooz55bsDLTVrAYdAnzCxA1+OpbUwZ16iSMimwAcKo=",
strip_prefix = "google-cloud-cpp-2.35.0",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/googleapis/google-cloud-cpp/archive/refs/tags/v2.35.0.tar.gz",
"https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v2.35.0.tar.gz",
],
)