Skip to content

Commit 4126e87

Browse files
committed
Replace bind() targets with alias() ones
release notes: no
1 parent c9e97a3 commit 4126e87

10 files changed

Lines changed: 248 additions & 237 deletions

File tree

WORKSPACE

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ load("@com_github_google_benchmark//:bazel/benchmark_deps.bzl", "benchmark_deps"
109109

110110
benchmark_deps()
111111

112+
# This is a transitive dependency from com_github_google_benchmark
113+
bind(
114+
name = "cares",
115+
actual = "@com_github_cares_cares//:ares",
116+
)
117+
112118
load("@io_opentelemetry_cpp//bazel:repository.bzl", "opentelemetry_cpp_deps")
113119

114120
opentelemetry_cpp_deps()
@@ -117,6 +123,12 @@ load("@io_opentelemetry_cpp//bazel:extra_deps.bzl", "opentelemetry_extra_deps")
117123

118124
opentelemetry_extra_deps()
119125

126+
# Transitive dependency of opentelemetry_extra_deps()
127+
bind(
128+
name = "madler_zlib",
129+
actual = "@zlib//:zlib",
130+
)
131+
120132
# TODO: Enable below once https://github.com/bazel-xcode/PodToBUILD/issues/232 is resolved
121133
#
122134
#http_archive(

bazel/generate_cc.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ _generate_cc = rule(
187187
mandatory = False,
188188
),
189189
"_protoc": attr.label(
190-
default = Label("//external:protocol_compiler"),
190+
default = Label("//third_party:protocol_compiler"),
191191
executable = True,
192192
cfg = "exec",
193193
),

bazel/generate_objc.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ generate_objc = rule(
180180
default = "@com_google_protobuf//:well_known_type_protos",
181181
),
182182
"_protoc": attr.label(
183-
default = Label("//external:protocol_compiler"),
183+
default = Label("//third_party:protocol_compiler"),
184184
executable = True,
185185
cfg = "exec",
186186
),

bazel/grpc_build_system.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def _get_external_deps(external_deps):
6565
elif dep == "cares":
6666
ret += select({
6767
"//:grpc_no_ares": [],
68-
"//conditions:default": ["//external:cares"],
68+
"//conditions:default": ["//third_party:cares"],
6969
})
7070
elif dep == "cronet_c_for_grpc":
7171
ret.append("//third_party/objective_c/Cronet:cronet_c_for_grpc")
@@ -78,7 +78,7 @@ def _get_external_deps(external_deps):
7878
elif dep.startswith("google_cloud_cpp"):
7979
ret.append(dep.replace("google_cloud_cpp", "@google_cloud_cpp//"))
8080
else:
81-
ret.append("//external:" + dep)
81+
ret.append("//third_party:" + dep)
8282
return ret
8383

8484
def _update_visibility(visibility):

bazel/grpc_deps.bzl

Lines changed: 1 addition & 215 deletions
Original file line numberDiff line numberDiff line change
@@ -14,217 +14,12 @@
1414
"""Load dependencies needed to compile and test the grpc library as a 3rd-party consumer."""
1515

1616
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
17-
load("@com_github_grpc_grpc//bazel:grpc_python_deps.bzl", "grpc_python_deps")
17+
load("//bazel:grpc_python_deps.bzl", "grpc_python_deps")
1818

1919
# buildifier: disable=unnamed-macro
2020
def grpc_deps():
2121
"""Loads dependencies need to compile and test the grpc library."""
2222

23-
native.bind(
24-
name = "upb_amalgamation_lib",
25-
actual = "@com_google_protobuf//upb:amalgamation",
26-
)
27-
28-
native.bind(
29-
name = "upb_base_lib",
30-
actual = "@com_google_protobuf//upb/base",
31-
)
32-
33-
native.bind(
34-
name = "upb_message_lib",
35-
actual = "@com_google_protobuf//upb:message",
36-
)
37-
38-
native.bind(
39-
name = "upb_mem_lib",
40-
actual = "@com_google_protobuf//upb/mem",
41-
)
42-
43-
native.bind(
44-
name = "upb_reflection",
45-
actual = "@com_google_protobuf//upb:reflection",
46-
)
47-
48-
native.bind(
49-
name = "upb_lib_descriptor",
50-
actual = "@com_google_protobuf//upb:descriptor_upb_proto",
51-
)
52-
53-
native.bind(
54-
name = "upb_lib_descriptor_reflection",
55-
actual = "@com_google_protobuf//upb:descriptor_upb_proto_reflection",
56-
)
57-
58-
native.bind(
59-
name = "upb_textformat_lib",
60-
actual = "@com_google_protobuf//upb/text",
61-
)
62-
63-
native.bind(
64-
name = "upb_json_lib",
65-
actual = "@com_google_protobuf//upb/json",
66-
)
67-
68-
native.bind(
69-
name = "upb_generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
70-
actual = "@com_google_protobuf//upb:generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
71-
)
72-
73-
native.bind(
74-
name = "libssl",
75-
actual = "@boringssl//:ssl",
76-
)
77-
78-
native.bind(
79-
name = "libcrypto",
80-
actual = "@boringssl//:crypto",
81-
)
82-
83-
native.bind(
84-
name = "madler_zlib",
85-
actual = "@zlib//:zlib",
86-
)
87-
88-
native.bind(
89-
name = "protobuf",
90-
actual = "@com_google_protobuf//:protobuf",
91-
)
92-
93-
native.bind(
94-
name = "protobuf_clib",
95-
actual = "@com_google_protobuf//:protoc_lib",
96-
)
97-
98-
native.bind(
99-
name = "protobuf_headers",
100-
actual = "@com_google_protobuf//:protobuf_headers",
101-
)
102-
103-
native.bind(
104-
name = "protocol_compiler",
105-
actual = "@com_google_protobuf//:protoc",
106-
)
107-
108-
native.bind(
109-
name = "cares",
110-
actual = "@com_github_cares_cares//:ares",
111-
)
112-
113-
native.bind(
114-
name = "gtest",
115-
actual = "@com_google_googletest//:gtest",
116-
)
117-
118-
native.bind(
119-
name = "fuzztest",
120-
actual = "@com_google_fuzztest//fuzztest",
121-
)
122-
123-
native.bind(
124-
name = "fuzztest_main",
125-
actual = "@com_google_fuzztest//fuzztest:fuzztest_gtest_main",
126-
)
127-
128-
native.bind(
129-
name = "benchmark",
130-
actual = "@com_github_google_benchmark//:benchmark",
131-
)
132-
133-
native.bind(
134-
name = "re2",
135-
actual = "@com_googlesource_code_re2//:re2",
136-
)
137-
138-
native.bind(
139-
name = "grpc_cpp_plugin",
140-
actual = "@com_github_grpc_grpc//src/compiler:grpc_cpp_plugin",
141-
)
142-
143-
native.bind(
144-
name = "grpc++_codegen_proto",
145-
actual = "@com_github_grpc_grpc//:grpc++_codegen_proto",
146-
)
147-
148-
native.bind(
149-
name = "opencensus-context",
150-
actual = "@io_opencensus_cpp//opencensus/context:context",
151-
)
152-
153-
native.bind(
154-
name = "opencensus-trace",
155-
actual = "@io_opencensus_cpp//opencensus/trace:trace",
156-
)
157-
158-
native.bind(
159-
name = "opencensus-trace-context_util",
160-
actual = "@io_opencensus_cpp//opencensus/trace:context_util",
161-
)
162-
163-
native.bind(
164-
name = "opencensus-trace-propagation",
165-
actual = "@io_opencensus_cpp//opencensus/trace:grpc_trace_bin",
166-
)
167-
168-
native.bind(
169-
name = "opencensus-trace-span_context",
170-
actual = "@io_opencensus_cpp//opencensus/trace:span_context",
171-
)
172-
173-
native.bind(
174-
name = "opencensus-stats",
175-
actual = "@io_opencensus_cpp//opencensus/stats:stats",
176-
)
177-
178-
native.bind(
179-
name = "opencensus-stats-test",
180-
actual = "@io_opencensus_cpp//opencensus/stats:test_utils",
181-
)
182-
183-
native.bind(
184-
name = "opencensus-with-tag-map",
185-
actual = "@io_opencensus_cpp//opencensus/tags:with_tag_map",
186-
)
187-
188-
native.bind(
189-
name = "opencensus-tags",
190-
actual = "@io_opencensus_cpp//opencensus/tags:tags",
191-
)
192-
193-
native.bind(
194-
name = "opencensus-tags-context_util",
195-
actual = "@io_opencensus_cpp//opencensus/tags:context_util",
196-
)
197-
198-
native.bind(
199-
name = "opencensus-trace-stackdriver_exporter",
200-
actual = "@io_opencensus_cpp//opencensus/exporters/trace/stackdriver:stackdriver_exporter",
201-
)
202-
203-
native.bind(
204-
name = "opencensus-stats-stackdriver_exporter",
205-
actual = "@io_opencensus_cpp//opencensus/exporters/stats/stackdriver:stackdriver_exporter",
206-
)
207-
208-
native.bind(
209-
name = "googleapis_trace_grpc_service",
210-
actual = "@com_google_googleapis//google/devtools/cloudtrace/v2:cloudtrace_cc_grpc",
211-
)
212-
213-
native.bind(
214-
name = "googleapis_monitoring_grpc_service",
215-
actual = "@com_google_googleapis//google/monitoring/v3:monitoring_cc_grpc",
216-
)
217-
218-
native.bind(
219-
name = "googleapis_logging_grpc_service",
220-
actual = "@com_google_googleapis//google/logging/v2:logging_cc_grpc",
221-
)
222-
223-
native.bind(
224-
name = "googleapis_logging_cc_proto",
225-
actual = "@com_google_googleapis//google/logging/v2:logging_cc_proto",
226-
)
227-
22823
if "platforms" not in native.existing_rules():
22924
http_archive(
23025
name = "platforms",
@@ -545,15 +340,6 @@ def grpc_test_only_deps():
545340
546341
Loads dependencies that are only needed to run grpc library's tests.
547342
"""
548-
native.bind(
549-
name = "twisted",
550-
actual = "@com_github_twisted_twisted//:twisted",
551-
)
552-
553-
native.bind(
554-
name = "yaml",
555-
actual = "@com_github_yaml_pyyaml//:yaml",
556-
)
557343

558344
if "com_github_twisted_twisted" not in native.existing_rules():
559345
http_archive(

bazel/python_rules.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ _gen_py_aspect = aspect(
110110
fragments = ["py"],
111111
attrs = {
112112
"_protoc": attr.label(
113-
default = Label("//external:protocol_compiler"),
113+
default = Label("//third_party:protocol_compiler"),
114114
providers = ["files_to_run"],
115115
executable = True,
116116
cfg = "exec",
@@ -166,7 +166,7 @@ py_proto_library = rule(
166166
aspects = [_gen_py_aspect],
167167
),
168168
"_protoc": attr.label(
169-
default = Label("//external:protocol_compiler"),
169+
default = Label("//third_party:protocol_compiler"),
170170
providers = ["files_to_run"],
171171
executable = True,
172172
cfg = "exec",
@@ -259,7 +259,7 @@ _generate_pb2_grpc_src = rule(
259259
executable = True,
260260
providers = ["files_to_run"],
261261
cfg = "exec",
262-
default = Label("//external:protocol_compiler"),
262+
default = Label("//third_party:protocol_compiler"),
263263
),
264264
"_grpc_library": attr.label(
265265
default = Label("//src/python/grpcio/grpc:grpcio"),

0 commit comments

Comments
 (0)