Skip to content

Commit ee656c7

Browse files
authored
build: Use cc_test from rules_cc instead of native.cc_test (#129)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
1 parent 8bfbf64 commit ee656c7

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

MODULE.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ bazel_dep(name = "grpc", version = "1.68.0", repo_name = "com_github_grpc_grpc")
1111
bazel_dep(name = "protobuf", version = "29.3", repo_name = "com_google_protobuf")
1212
bazel_dep(name = "protoc-gen-validate", version = "1.2.1.bcr.1", repo_name = "com_envoyproxy_protoc_gen_validate")
1313
bazel_dep(name = "re2", version = "2024-07-02", repo_name = "com_googlesource_code_re2")
14+
bazel_dep(name = "rules_cc", version = "0.0.17")
1415
bazel_dep(name = "rules_go", version = "0.53.0", repo_name = "io_bazel_rules_go")
1516
bazel_dep(name = "rules_python", version = "1.6.3")
1617

bazel/api_build_system.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ load("@com_github_grpc_grpc//bazel:python_rules.bzl", _py_proto_library = "py_pr
44
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
55
load("@io_bazel_rules_go//go:def.bzl", "go_test")
66
load("@io_bazel_rules_go//proto:def.bzl", "go_grpc_library", "go_proto_library")
7+
load("@rules_cc//cc:cc_test.bzl", "cc_test")
78
load(
89
"//bazel:external_proto_deps.bzl",
910
"EXTERNAL_PROTO_CC_BAZEL_DEP_MAP",
@@ -136,7 +137,7 @@ def xds_proto_package(
136137
)
137138

138139
def xds_cc_test(name, **kwargs):
139-
native.cc_test(
140+
cc_test(
140141
name = name,
141142
**kwargs
142143
)
@@ -157,4 +158,3 @@ def udpa_cc_test(name, **kwargs):
157158

158159
def udpa_go_test(name, **kwargs):
159160
xds_go_test(name, **kwargs)
160-

bazel/repositories.bzl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ def xds_api_dependencies():
4242
"rules_proto",
4343
locations = REPOSITORY_LOCATIONS,
4444
)
45+
xds_http_archive(
46+
"rules_cc",
47+
locations = REPOSITORY_LOCATIONS,
48+
)
4549

4650
# Old name for backward compatibility.
4751
# TODO(roth): Remove once all callers are updated to use the new name.

bazel/repository_locations.bzl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ REPOSITORY_LOCATIONS = dict(
4343
"https://github.com/bazelbuild/rules_go/releases/download/v0.53.0/rules_go-v0.53.0.zip",
4444
],
4545
),
46+
rules_cc = dict(
47+
sha256 = "abc605dd850f813bb37004b77db20106a19311a96b2da1c92b789da529d28fe1",
48+
strip_prefix = "rules_cc-0.0.17",
49+
urls = ["https://github.com/bazelbuild/rules_cc/archive/refs/tags/0.0.17.tar.gz"],
50+
),
4651
rules_proto = dict(
4752
sha256 = "14a225870ab4e91869652cfd69ef2028277fc1dc4910d65d353b62d6e0ae21f4",
4853
strip_prefix = "rules_proto-7.1.0",

0 commit comments

Comments
 (0)