blob: 4096720569a23c841f6321b5ba1e7bc44e7ccc92 [file] [log] [blame]
Alexander Polcyn54a70402017-11-29 17:06:16 -08001"""Load dependencies needed to compile and test the grpc library as a 3rd-party consumer."""
Ning Ren174e02a2017-11-20 15:24:21 -08002
Alexander Polcyn54a70402017-11-29 17:06:16 -08003def grpc_deps():
4 """Loads dependencies need to compile and test the grpc library."""
David Garcia Quintas483b4b72018-05-31 16:45:03 -07005
6 native.bind(
7 name = "nanopb",
David Garcia Quintas00e045d2018-06-01 15:44:03 -07008 actual = "@com_github_nanopb_nanopb//:nanopb",
David Garcia Quintas483b4b72018-05-31 16:45:03 -07009 )
10
Ning Ren174e02a2017-11-20 15:24:21 -080011 native.bind(
Vizerai41e4ced2018-04-13 18:19:21 -070012 name = "absl-base",
13 actual = "@com_google_absl//absl/base",
14 )
15
16 native.bind(
17 name = "absl-time",
18 actual = "@com_google_absl//absl/time:time",
19 )
20
21 native.bind(
Ning Ren174e02a2017-11-20 15:24:21 -080022 name = "libssl",
23 actual = "@boringssl//:ssl",
24 )
25
26 native.bind(
27 name = "zlib",
28 actual = "@com_github_madler_zlib//:z",
29 )
30
31 native.bind(
32 name = "protobuf",
33 actual = "@com_google_protobuf//:protobuf",
34 )
35
36 native.bind(
37 name = "protobuf_clib",
38 actual = "@com_google_protobuf//:protoc_lib",
39 )
40
41 native.bind(
42 name = "protobuf_headers",
43 actual = "@com_google_protobuf//:protobuf_headers",
44 )
45
46 native.bind(
47 name = "protocol_compiler",
48 actual = "@com_google_protobuf//:protoc",
49 )
50
51 native.bind(
52 name = "cares",
53 actual = "@com_github_cares_cares//:ares",
54 )
55
56 native.bind(
57 name = "gtest",
58 actual = "@com_github_google_googletest//:gtest",
59 )
60
61 native.bind(
62 name = "gmock",
63 actual = "@com_github_google_googletest//:gmock",
64 )
65
66 native.bind(
67 name = "benchmark",
68 actual = "@com_github_google_benchmark//:benchmark",
69 )
70
71 native.bind(
72 name = "gflags",
73 actual = "@com_github_gflags_gflags//:gflags",
74 )
75
Ian Sturdy3a8c0d62018-03-07 12:11:21 -080076 native.bind(
77 name = "grpc_cpp_plugin",
David Garcia Quintas483b4b72018-05-31 16:45:03 -070078 actual = "@com_github_grpc_grpc//:grpc_cpp_plugin",
Ian Sturdy3a8c0d62018-03-07 12:11:21 -080079 )
80
81 native.bind(
82 name = "grpc++_codegen_proto",
David Garcia Quintas483b4b72018-05-31 16:45:03 -070083 actual = "@com_github_grpc_grpc//:grpc++_codegen_proto",
Ian Sturdy3a8c0d62018-03-07 12:11:21 -080084 )
85
Vizerai41e4ced2018-04-13 18:19:21 -070086 native.bind(
87 name = "opencensus-trace",
88 actual = "@io_opencensus_cpp//opencensus/trace:trace"
89 )
90
91 native.bind(
92 name = "opencensus-stats",
93 actual = "@io_opencensus_cpp//opencensus/stats:stats"
94 )
95
96 native.bind(
97 name = "opencensus-stats-test",
98 actual = "@io_opencensus_cpp//opencensus/stats:test_utils"
99 )
100
Alexander Polcyn54a70402017-11-29 17:06:16 -0800101 if "boringssl" not in native.existing_rules():
102 native.http_archive(
103 name = "boringssl",
Jan Tattermusch7f0a4ba2018-05-07 20:05:23 +0200104 # on the chromium-stable-with-bazel branch
105 url = "https://boringssl.googlesource.com/boringssl/+archive/dcd3e6e6ecddf059adb48fca45bc7346a108bdd9.tar.gz",
Alexander Polcyn54a70402017-11-29 17:06:16 -0800106 )
Ning Ren174e02a2017-11-20 15:24:21 -0800107
Alexander Polcyn54a70402017-11-29 17:06:16 -0800108 if "com_github_madler_zlib" not in native.existing_rules():
109 native.new_http_archive(
110 name = "com_github_madler_zlib",
111 build_file = "@com_github_grpc_grpc//third_party:zlib.BUILD",
112 strip_prefix = "zlib-cacf7f1d4e3d44d871b605da3b647f07d718623f",
113 url = "https://github.com/madler/zlib/archive/cacf7f1d4e3d44d871b605da3b647f07d718623f.tar.gz",
114 )
Ning Ren174e02a2017-11-20 15:24:21 -0800115
Alexander Polcyn54a70402017-11-29 17:06:16 -0800116 if "com_google_protobuf" not in native.existing_rules():
117 native.http_archive(
118 name = "com_google_protobuf",
Jan Tattermuschcbb9fee2018-08-02 08:45:08 +0200119 strip_prefix = "protobuf-48cb18e5c419ddd23d9badcfe4e9df7bde1979b2",
120 url = "https://github.com/google/protobuf/archive/48cb18e5c419ddd23d9badcfe4e9df7bde1979b2.tar.gz",
Jan Tattermusche8c3bf02018-06-01 10:07:26 +0200121 )
David Garcia Quintas00e045d2018-06-01 15:44:03 -0700122
123 if "com_github_nanopb_nanopb" not in native.existing_rules():
124 native.new_http_archive(
125 name = "com_github_nanopb_nanopb",
126 build_file = "@com_github_grpc_grpc//third_party:nanopb.BUILD",
127 strip_prefix = "nanopb-f8ac463766281625ad710900479130c7fcb4d63b",
128 url = "https://github.com/nanopb/nanopb/archive/f8ac463766281625ad710900479130c7fcb4d63b.tar.gz",
Alexander Polcyn54a70402017-11-29 17:06:16 -0800129 )
Ning Ren174e02a2017-11-20 15:24:21 -0800130
Alexander Polcyn54a70402017-11-29 17:06:16 -0800131 if "com_github_google_googletest" not in native.existing_rules():
132 native.new_http_archive(
133 name = "com_github_google_googletest",
134 build_file = "@com_github_grpc_grpc//third_party:gtest.BUILD",
135 strip_prefix = "googletest-ec44c6c1675c25b9827aacd08c02433cccde7780",
136 url = "https://github.com/google/googletest/archive/ec44c6c1675c25b9827aacd08c02433cccde7780.tar.gz",
137 )
Ning Ren174e02a2017-11-20 15:24:21 -0800138
Alexander Polcyn54a70402017-11-29 17:06:16 -0800139 if "com_github_gflags_gflags" not in native.existing_rules():
140 native.http_archive(
141 name = "com_github_gflags_gflags",
142 strip_prefix = "gflags-30dbc81fb5ffdc98ea9b14b1918bfe4e8779b26e",
143 url = "https://github.com/gflags/gflags/archive/30dbc81fb5ffdc98ea9b14b1918bfe4e8779b26e.tar.gz",
144 )
Ning Ren174e02a2017-11-20 15:24:21 -0800145
Alexander Polcyn54a70402017-11-29 17:06:16 -0800146 if "com_github_google_benchmark" not in native.existing_rules():
147 native.new_http_archive(
148 name = "com_github_google_benchmark",
149 build_file = "@com_github_grpc_grpc//third_party:benchmark.BUILD",
Vizerai41e4ced2018-04-13 18:19:21 -0700150 strip_prefix = "benchmark-9913418d323e64a0111ca0da81388260c2bbe1e9",
151 url = "https://github.com/google/benchmark/archive/9913418d323e64a0111ca0da81388260c2bbe1e9.tar.gz",
Alexander Polcyn54a70402017-11-29 17:06:16 -0800152 )
Ning Ren174e02a2017-11-20 15:24:21 -0800153
Alexander Polcyn54a70402017-11-29 17:06:16 -0800154 if "com_github_cares_cares" not in native.existing_rules():
155 native.new_http_archive(
156 name = "com_github_cares_cares",
157 build_file = "@com_github_grpc_grpc//third_party:cares/cares.BUILD",
158 strip_prefix = "c-ares-3be1924221e1326df520f8498d704a5c4c8d0cce",
159 url = "https://github.com/c-ares/c-ares/archive/3be1924221e1326df520f8498d704a5c4c8d0cce.tar.gz",
160 )
Ning Ren174e02a2017-11-20 15:24:21 -0800161
Alexander Polcyn54a70402017-11-29 17:06:16 -0800162 if "com_google_absl" not in native.existing_rules():
163 native.http_archive(
164 name = "com_google_absl",
Vizerai41e4ced2018-04-13 18:19:21 -0700165 strip_prefix = "abseil-cpp-cd95e71df6eaf8f2a282b1da556c2cf1c9b09207",
166 url = "https://github.com/abseil/abseil-cpp/archive/cd95e71df6eaf8f2a282b1da556c2cf1c9b09207.tar.gz",
Alexander Polcyn54a70402017-11-29 17:06:16 -0800167 )
168
169 if "com_github_bazelbuild_bazeltoolchains" not in native.existing_rules():
170 native.http_archive(
171 name = "com_github_bazelbuild_bazeltoolchains",
Adele Zhou5f844452018-08-24 14:17:12 -0700172 strip_prefix = "bazel-toolchains-cdea5b8675914d0a354d89f108de5d28e54e0edc",
Alexander Polcyn54a70402017-11-29 17:06:16 -0800173 urls = [
Adele Zhou5f844452018-08-24 14:17:12 -0700174 "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/cdea5b8675914d0a354d89f108de5d28e54e0edc.tar.gz",
175 "https://github.com/bazelbuild/bazel-toolchains/archive/cdea5b8675914d0a354d89f108de5d28e54e0edc.tar.gz",
Alexander Polcyn54a70402017-11-29 17:06:16 -0800176 ],
Adele Zhou5f844452018-08-24 14:17:12 -0700177 sha256 = "cefb6ccf86ca592baaa029bcef04148593c0efe8f734542f10293ea58f170715",
Alexander Polcyn54a70402017-11-29 17:06:16 -0800178 )
Alex Polcynaa560342018-02-12 23:13:13 +0000179
Vizerai41e4ced2018-04-13 18:19:21 -0700180 if "io_opencensus_cpp" not in native.existing_rules():
181 native.http_archive(
182 name = "io_opencensus_cpp",
183 strip_prefix = "opencensus-cpp-fdf0f308b1631bb4a942e32ba5d22536a6170274",
184 url = "https://github.com/census-instrumentation/opencensus-cpp/archive/fdf0f308b1631bb4a942e32ba5d22536a6170274.tar.gz",
185 )
186
187
Alex Polcynaa560342018-02-12 23:13:13 +0000188# TODO: move some dependencies from "grpc_deps" here?
189def grpc_test_only_deps():
190 """Internal, not intended for use by packages that are consuming grpc.
191 Loads dependencies that are only needed to run grpc library's tests."""
192 native.bind(
193 name = "twisted",
194 actual = "@com_github_twisted_twisted//:twisted",
195 )
196
197 native.bind(
198 name = "yaml",
199 actual = "@com_github_yaml_pyyaml//:yaml",
200 )
201
202 if "com_github_twisted_twisted" not in native.existing_rules():
203 native.new_http_archive(
204 name = "com_github_twisted_twisted",
205 strip_prefix = "twisted-twisted-17.5.0",
206 url = "https://github.com/twisted/twisted/archive/twisted-17.5.0.zip",
207 build_file = "@com_github_grpc_grpc//third_party:twisted.BUILD",
208 )
209
210 if "com_github_yaml_pyyaml" not in native.existing_rules():
211 native.new_http_archive(
212 name = "com_github_yaml_pyyaml",
213 strip_prefix = "pyyaml-3.12",
214 url = "https://github.com/yaml/pyyaml/archive/3.12.zip",
215 build_file = "@com_github_grpc_grpc//third_party:yaml.BUILD",
216 )
217
218 if "com_github_twisted_incremental" not in native.existing_rules():
219 native.new_http_archive(
220 name = "com_github_twisted_incremental",
221 strip_prefix = "incremental-incremental-17.5.0",
222 url = "https://github.com/twisted/incremental/archive/incremental-17.5.0.zip",
223 build_file = "@com_github_grpc_grpc//third_party:incremental.BUILD",
224 )
225
226 if "com_github_zopefoundation_zope_interface" not in native.existing_rules():
227 native.new_http_archive(
228 name = "com_github_zopefoundation_zope_interface",
229 strip_prefix = "zope.interface-4.4.3",
230 url = "https://github.com/zopefoundation/zope.interface/archive/4.4.3.zip",
231 build_file = "@com_github_grpc_grpc//third_party:zope_interface.BUILD",
232 )
233
234 if "com_github_twisted_constantly" not in native.existing_rules():
235 native.new_http_archive(
236 name = "com_github_twisted_constantly",
237 strip_prefix = "constantly-15.1.0",
238 url = "https://github.com/twisted/constantly/archive/15.1.0.zip",
239 build_file = "@com_github_grpc_grpc//third_party:constantly.BUILD",
240 )