1"""Load dependencies needed to compile and test the grpc library as a 3rd-party consumer.""" 2 3load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") 4load("@com_github_grpc_grpc//bazel:grpc_python_deps.bzl", "grpc_python_deps") 5 6def grpc_deps(): 7 """Loads dependencies need to compile and test the grpc library.""" 8 9 native.bind( 10 name = "upb_lib", 11 actual = "@upb//:upb", 12 ) 13 14 native.bind( 15 name = "absl", 16 actual = "@com_google_absl//absl", 17 ) 18 19 native.bind( 20 name = "absl-base", 21 actual = "@com_google_absl//absl/base", 22 ) 23 24 native.bind( 25 name = "absl-time", 26 actual = "@com_google_absl//absl/time:time", 27 ) 28 29 native.bind( 30 name = "libssl", 31 actual = "@boringssl//:ssl", 32 ) 33 34 native.bind( 35 name = "madler_zlib", 36 actual = "@zlib//:zlib", 37 ) 38 39 native.bind( 40 name = "protobuf", 41 actual = "@com_google_protobuf//:protobuf", 42 ) 43 44 native.bind( 45 name = "protobuf_clib", 46 actual = "@com_google_protobuf//:protoc_lib", 47 ) 48 49 native.bind( 50 name = "protobuf_headers", 51 actual = "@com_google_protobuf//:protobuf_headers", 52 ) 53 54 native.bind( 55 name = "protocol_compiler", 56 actual = "@com_google_protobuf//:protoc", 57 ) 58 59 native.bind( 60 name = "cares", 61 actual = "@com_github_cares_cares//:ares", 62 ) 63 64 native.bind( 65 name = "gtest", 66 actual = "@com_google_googletest//:gtest", 67 ) 68 69 native.bind( 70 name = "benchmark", 71 actual = "@com_github_google_benchmark//:benchmark", 72 ) 73 74 native.bind( 75 name = "re2", 76 actual = "@com_github_google_re2//:re2", 77 ) 78 79 native.bind( 80 name = "gflags", 81 actual = "@com_github_gflags_gflags//:gflags", 82 ) 83 84 native.bind( 85 name = "grpc_cpp_plugin", 86 actual = "@com_github_grpc_grpc//src/compiler:grpc_cpp_plugin", 87 ) 88 89 native.bind( 90 name = "grpc++_codegen_proto", 91 actual = "@com_github_grpc_grpc//:grpc++_codegen_proto", 92 ) 93 94 native.bind( 95 name = "opencensus-context", 96 actual = "@io_opencensus_cpp//opencensus/context:context", 97 ) 98 99 native.bind( 100 name = "opencensus-trace", 101 actual = "@io_opencensus_cpp//opencensus/trace:trace", 102 ) 103 104 native.bind( 105 name = "opencensus-trace-context_util", 106 actual = "@io_opencensus_cpp//opencensus/trace:context_util", 107 ) 108 109 native.bind( 110 name = "opencensus-stats", 111 actual = "@io_opencensus_cpp//opencensus/stats:stats", 112 ) 113 114 native.bind( 115 name = "opencensus-stats-test", 116 actual = "@io_opencensus_cpp//opencensus/stats:test_utils", 117 ) 118 119 native.bind( 120 name = "opencensus-with-tag-map", 121 actual = "@io_opencensus_cpp//opencensus/tags:with_tag_map", 122 ) 123 124 native.bind( 125 name = "opencensus-tags", 126 actual = "@io_opencensus_cpp//opencensus/tags:tags", 127 ) 128 129 native.bind( 130 name = "libuv", 131 actual = "@libuv//:libuv", 132 ) 133 134 if "boringssl" not in native.existing_rules(): 135 http_archive( 136 name = "boringssl", 137 # Use github mirror instead of https://boringssl.googlesource.com/boringssl 138 # to obtain a boringssl archive with consistent sha256 139 sha256 = "5bbb2bbddf5e4e5fefd02501f930436f3f45402152d7ea9f8f27916d5cf70157", 140 strip_prefix = "boringssl-e8a935e323510419e0b37638716f6df4dcbbe6f6", 141 urls = [ 142 "https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/boringssl/archive/e8a935e323510419e0b37638716f6df4dcbbe6f6.tar.gz", 143 "https://github.com/google/boringssl/archive/e8a935e323510419e0b37638716f6df4dcbbe6f6.tar.gz", 144 ], 145 ) 146 147 if "zlib" not in native.existing_rules(): 148 http_archive( 149 name = "zlib", 150 build_file = "@com_github_grpc_grpc//third_party:zlib.BUILD", 151 sha256 = "6d4d6640ca3121620995ee255945161821218752b551a1a180f4215f7d124d45", 152 strip_prefix = "zlib-cacf7f1d4e3d44d871b605da3b647f07d718623f", 153 urls = [ 154 "https://storage.googleapis.com/grpc-bazel-mirror/github.com/madler/zlib/archive/cacf7f1d4e3d44d871b605da3b647f07d718623f.tar.gz", 155 "https://github.com/madler/zlib/archive/cacf7f1d4e3d44d871b605da3b647f07d718623f.tar.gz", 156 ], 157 ) 158 159 if "com_google_protobuf" not in native.existing_rules(): 160 http_archive( 161 name = "com_google_protobuf", 162 sha256 = "efaf69303e01caccc2447064fc1832dfd23c0c130df0dc5fc98a13185bb7d1a7", 163 strip_prefix = "protobuf-678da4f76eb9168c9965afc2149944a66cd48546", 164 urls = [ 165 "https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/protobuf/archive/678da4f76eb9168c9965afc2149944a66cd48546.tar.gz", 166 "https://github.com/google/protobuf/archive/678da4f76eb9168c9965afc2149944a66cd48546.tar.gz", 167 ], 168 ) 169 170 if "com_google_googletest" not in native.existing_rules(): 171 http_archive( 172 name = "com_google_googletest", 173 sha256 = "443d383db648ebb8e391382c0ab63263b7091d03197f304390baac10f178a468", 174 strip_prefix = "googletest-c9ccac7cb7345901884aabf5d1a786cfa6e2f397", 175 urls = [ 176 # 2019-08-19 177 "https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/googletest/archive/c9ccac7cb7345901884aabf5d1a786cfa6e2f397.tar.gz", 178 "https://github.com/google/googletest/archive/c9ccac7cb7345901884aabf5d1a786cfa6e2f397.tar.gz", 179 ], 180 ) 181 182 if "rules_cc" not in native.existing_rules(): 183 http_archive( 184 name = "rules_cc", 185 sha256 = "35f2fb4ea0b3e61ad64a369de284e4fbbdcdba71836a5555abb5e194cf119509", 186 strip_prefix = "rules_cc-624b5d59dfb45672d4239422fa1e3de1822ee110", 187 urls = [ 188 #2019-08-15 189 "https://storage.googleapis.com/grpc-bazel-mirror/github.com/bazelbuild/rules_cc/archive/624b5d59dfb45672d4239422fa1e3de1822ee110.tar.gz", 190 "https://github.com/bazelbuild/rules_cc/archive/624b5d59dfb45672d4239422fa1e3de1822ee110.tar.gz", 191 ], 192 ) 193 194 if "com_github_gflags_gflags" not in native.existing_rules(): 195 http_archive( 196 name = "com_github_gflags_gflags", 197 sha256 = "63ae70ea3e05780f7547d03503a53de3a7d2d83ad1caaa443a31cb20aea28654", 198 strip_prefix = "gflags-28f50e0fed19872e0fd50dd23ce2ee8cd759338e", 199 urls = [ 200 "https://storage.googleapis.com/grpc-bazel-mirror/github.com/gflags/gflags/archive/28f50e0fed19872e0fd50dd23ce2ee8cd759338e.tar.gz", 201 "https://github.com/gflags/gflags/archive/28f50e0fed19872e0fd50dd23ce2ee8cd759338e.tar.gz", 202 ], 203 ) 204 205 if "com_github_google_benchmark" not in native.existing_rules(): 206 http_archive( 207 name = "com_github_google_benchmark", 208 sha256 = "f68aec93154d010324c05bcd8c5cc53468b87af88d87acb5ddcfaa1bba044837", 209 strip_prefix = "benchmark-090faecb454fbd6e6e17a75ef8146acb037118d4", 210 urls = [ 211 "https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/benchmark/archive/090faecb454fbd6e6e17a75ef8146acb037118d4.tar.gz", 212 "https://github.com/google/benchmark/archive/090faecb454fbd6e6e17a75ef8146acb037118d4.tar.gz", 213 ], 214 ) 215 216 if "com_github_google_re2" not in native.existing_rules(): 217 http_archive( 218 name = "com_github_google_re2", 219 sha256 = "9f385e146410a8150b6f4cb1a57eab7ec806ced48d427554b1e754877ff26c3e", 220 strip_prefix = "re2-aecba11114cf1fac5497aeb844b6966106de3eb6", 221 urls = [ 222 "https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/re2/archive/aecba11114cf1fac5497aeb844b6966106de3eb6.tar.gz", 223 "https://github.com/google/re2/archive/aecba11114cf1fac5497aeb844b6966106de3eb6.tar.gz", 224 ], 225 ) 226 227 if "com_github_cares_cares" not in native.existing_rules(): 228 http_archive( 229 name = "com_github_cares_cares", 230 build_file = "@com_github_grpc_grpc//third_party:cares/cares.BUILD", 231 sha256 = "e8c2751ddc70fed9dc6f999acd92e232d5846f009ee1674f8aee81f19b2b915a", 232 strip_prefix = "c-ares-e982924acee7f7313b4baa4ee5ec000c5e373c30", 233 urls = [ 234 "https://storage.googleapis.com/grpc-bazel-mirror/github.com/c-ares/c-ares/archive/e982924acee7f7313b4baa4ee5ec000c5e373c30.tar.gz", 235 "https://github.com/c-ares/c-ares/archive/e982924acee7f7313b4baa4ee5ec000c5e373c30.tar.gz", 236 ], 237 ) 238 239 if "com_google_absl" not in native.existing_rules(): 240 http_archive( 241 name = "com_google_absl", 242 sha256 = "f368a8476f4e2e0eccf8a7318b98dafbe30b2600f4e3cf52636e5eb145aba06a", 243 strip_prefix = "abseil-cpp-df3ea785d8c30a9503321a3d35ee7d35808f190d", 244 urls = [ 245 "https://storage.googleapis.com/grpc-bazel-mirror/github.com/abseil/abseil-cpp/archive/df3ea785d8c30a9503321a3d35ee7d35808f190d.tar.gz", 246 "https://github.com/abseil/abseil-cpp/archive/df3ea785d8c30a9503321a3d35ee7d35808f190d.tar.gz", 247 ], 248 ) 249 250 if "bazel_toolchains" not in native.existing_rules(): 251 # list of releases is at https://releases.bazel.build/bazel-toolchains.html 252 http_archive( 253 name = "bazel_toolchains", 254 sha256 = "0b36eef8a66f39c8dbae88e522d5bbbef49d5e66e834a982402c79962281be10", 255 strip_prefix = "bazel-toolchains-1.0.1", 256 urls = [ 257 "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/1.0.1.tar.gz", 258 "https://github.com/bazelbuild/bazel-toolchains/releases/download/1.0.1/bazel-toolchains-1.0.1.tar.gz", 259 ], 260 ) 261 262 if "bazel_skylib" not in native.existing_rules(): 263 http_archive( 264 name = "bazel_skylib", 265 urls = [ 266 "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz", 267 "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz", 268 ], 269 sha256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44", 270 ) 271 272 if "io_opencensus_cpp" not in native.existing_rules(): 273 http_archive( 274 name = "io_opencensus_cpp", 275 sha256 = "90d6fafa8b1a2ea613bf662731d3086e1c2ed286f458a95c81744df2dbae41b1", 276 strip_prefix = "opencensus-cpp-c9a4da319bc669a772928ffc55af4a61be1a1176", 277 urls = [ 278 "https://storage.googleapis.com/grpc-bazel-mirror/github.com/census-instrumentation/opencensus-cpp/archive/c9a4da319bc669a772928ffc55af4a61be1a1176.tar.gz", 279 "https://github.com/census-instrumentation/opencensus-cpp/archive/c9a4da319bc669a772928ffc55af4a61be1a1176.tar.gz", 280 ], 281 ) 282 283 if "upb" not in native.existing_rules(): 284 http_archive( 285 name = "upb", 286 sha256 = "79f7de61203c4ee5e4fcb2f17c5f3338119d6eb94aca8bce05332d2c1cfee108", 287 strip_prefix = "upb-92e63da73328d01b417cf26c2de7b0a27a0f83af", 288 urls = [ 289 "https://storage.googleapis.com/grpc-bazel-mirror/github.com/protocolbuffers/upb/archive/92e63da73328d01b417cf26c2de7b0a27a0f83af.tar.gz", 290 "https://github.com/protocolbuffers/upb/archive/92e63da73328d01b417cf26c2de7b0a27a0f83af.tar.gz", 291 ], 292 ) 293 294 if "envoy_api" not in native.existing_rules(): 295 http_archive( 296 name = "envoy_api", 297 sha256 = "9150f920abd3e710e0e58519cd769822f13d7a56988f2c34c2008815ec8d9c88", 298 strip_prefix = "data-plane-api-8dcc476be69437b505af181a6e8b167fdb101d7e", 299 urls = [ 300 "https://storage.googleapis.com/grpc-bazel-mirror/github.com/envoyproxy/data-plane-api/archive/8dcc476be69437b505af181a6e8b167fdb101d7e.tar.gz", 301 "https://github.com/envoyproxy/data-plane-api/archive/8dcc476be69437b505af181a6e8b167fdb101d7e.tar.gz", 302 ], 303 ) 304 305 if "io_bazel_rules_go" not in native.existing_rules(): 306 http_archive( 307 name = "io_bazel_rules_go", 308 sha256 = "a82a352bffae6bee4e95f68a8d80a70e87f42c4741e6a448bec11998fcc82329", 309 urls = [ 310 "https://storage.googleapis.com/grpc-bazel-mirror/github.com/bazelbuild/rules_go/releases/download/0.18.5/rules_go-0.18.5.tar.gz", 311 "https://github.com/bazelbuild/rules_go/releases/download/0.18.5/rules_go-0.18.5.tar.gz", 312 ], 313 ) 314 315 if "build_bazel_rules_apple" not in native.existing_rules(): 316 http_archive( 317 name = "build_bazel_rules_apple", 318 strip_prefix = "rules_apple-b869b0d3868d78a1d4ffd866ccb304fb68aa12c3", 319 sha256 = "bdc8e66e70b8a75da23b79f1f8c6207356df07d041d96d2189add7ee0780cf4e", 320 urls = [ 321 "https://storage.googleapis.com/grpc-bazel-mirror/github.com/bazelbuild/rules_apple/archive/b869b0d3868d78a1d4ffd866ccb304fb68aa12c3.tar.gz", 322 "https://github.com/bazelbuild/rules_apple/archive/b869b0d3868d78a1d4ffd866ccb304fb68aa12c3.tar.gz", 323 ], 324 ) 325 326 if "build_bazel_apple_support" not in native.existing_rules(): 327 http_archive( 328 name = "build_bazel_apple_support", 329 urls = [ 330 "https://storage.googleapis.com/grpc-bazel-mirror/github.com/bazelbuild/apple_support/releases/download/0.7.1/apple_support.0.7.1.tar.gz", 331 "https://github.com/bazelbuild/apple_support/releases/download/0.7.1/apple_support.0.7.1.tar.gz", 332 ], 333 sha256 = "122ebf7fe7d1c8e938af6aeaee0efe788a3a2449ece5a8d6a428cb18d6f88033", 334 ) 335 336 if "libuv" not in native.existing_rules(): 337 http_archive( 338 name = "libuv", 339 build_file = "@com_github_grpc_grpc//third_party:libuv.BUILD", 340 sha256 = "dfb4fe1ff0b47340978490a14bf253475159ecfcbad46ab2a350c78f9ce3360f", 341 strip_prefix = "libuv-15ae750151ac9341e5945eb38f8982d59fb99201", 342 urls = [ 343 "https://storage.googleapis.com/grpc-bazel-mirror/github.com/libuv/libuv/archive/15ae750151ac9341e5945eb38f8982d59fb99201.tar.gz", 344 "https://github.com/libuv/libuv/archive/15ae750151ac9341e5945eb38f8982d59fb99201.tar.gz", 345 ], 346 ) 347 348 grpc_python_deps() 349 350# TODO: move some dependencies from "grpc_deps" here? 351def grpc_test_only_deps(): 352 """Internal, not intended for use by packages that are consuming grpc. 353 Loads dependencies that are only needed to run grpc library's tests.""" 354 native.bind( 355 name = "twisted", 356 actual = "@com_github_twisted_twisted//:twisted", 357 ) 358 359 native.bind( 360 name = "yaml", 361 actual = "@com_github_yaml_pyyaml//:yaml", 362 ) 363 364 if "com_github_twisted_twisted" not in native.existing_rules(): 365 http_archive( 366 name = "com_github_twisted_twisted", 367 sha256 = "ca17699d0d62eafc5c28daf2c7d0a18e62ae77b4137300b6c7d7868b39b06139", 368 strip_prefix = "twisted-twisted-17.5.0", 369 urls = [ 370 "https://storage.googleapis.com/grpc-bazel-mirror/github.com/twisted/twisted/archive/twisted-17.5.0.zip", 371 "https://github.com/twisted/twisted/archive/twisted-17.5.0.zip", 372 ], 373 build_file = "@com_github_grpc_grpc//third_party:twisted.BUILD", 374 ) 375 376 if "com_github_yaml_pyyaml" not in native.existing_rules(): 377 http_archive( 378 name = "com_github_yaml_pyyaml", 379 sha256 = "6b4314b1b2051ddb9d4fcd1634e1fa9c1bb4012954273c9ff3ef689f6ec6c93e", 380 strip_prefix = "pyyaml-3.12", 381 urls = [ 382 "https://storage.googleapis.com/grpc-bazel-mirror/github.com/yaml/pyyaml/archive/3.12.zip", 383 "https://github.com/yaml/pyyaml/archive/3.12.zip", 384 ], 385 build_file = "@com_github_grpc_grpc//third_party:yaml.BUILD", 386 ) 387 388 if "com_github_twisted_incremental" not in native.existing_rules(): 389 http_archive( 390 name = "com_github_twisted_incremental", 391 sha256 = "f0ca93359ee70243ff7fbf2d904a6291810bd88cb80ed4aca6fa77f318a41a36", 392 strip_prefix = "incremental-incremental-17.5.0", 393 urls = [ 394 "https://storage.googleapis.com/grpc-bazel-mirror/github.com/twisted/incremental/archive/incremental-17.5.0.zip", 395 "https://github.com/twisted/incremental/archive/incremental-17.5.0.zip", 396 ], 397 build_file = "@com_github_grpc_grpc//third_party:incremental.BUILD", 398 ) 399 400 if "com_github_zopefoundation_zope_interface" not in native.existing_rules(): 401 http_archive( 402 name = "com_github_zopefoundation_zope_interface", 403 sha256 = "e9579fc6149294339897be3aa9ecd8a29217c0b013fe6f44fcdae00e3204198a", 404 strip_prefix = "zope.interface-4.4.3", 405 urls = [ 406 "https://storage.googleapis.com/grpc-bazel-mirror/github.com/zopefoundation/zope.interface/archive/4.4.3.zip", 407 "https://github.com/zopefoundation/zope.interface/archive/4.4.3.zip", 408 ], 409 build_file = "@com_github_grpc_grpc//third_party:zope_interface.BUILD", 410 ) 411 412 if "com_github_twisted_constantly" not in native.existing_rules(): 413 http_archive( 414 name = "com_github_twisted_constantly", 415 sha256 = "2702cd322161a579d2c0dbf94af4e57712eedc7bd7bbbdc554a230544f7d346c", 416 strip_prefix = "constantly-15.1.0", 417 urls = [ 418 "https://storage.googleapis.com/grpc-bazel-mirror/github.com/twisted/constantly/archive/15.1.0.zip", 419 "https://github.com/twisted/constantly/archive/15.1.0.zip", 420 ], 421 build_file = "@com_github_grpc_grpc//third_party:constantly.BUILD", 422 ) 423