Home | History | Annotate | Download | only in bazel
      1 """Load dependencies needed to compile and test the grpc library as a 3rd-party consumer."""
      2 
      3 def grpc_deps():
      4     """Loads dependencies need to compile and test the grpc library."""
      5 
      6     native.bind(
      7         name = "nanopb",
      8         actual = "@com_github_nanopb_nanopb//:nanopb",
      9     )
     10 
     11     native.bind(
     12         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(
     22         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 
     76     native.bind(
     77         name = "grpc_cpp_plugin",
     78         actual = "@com_github_grpc_grpc//:grpc_cpp_plugin",
     79     )
     80 
     81     native.bind(
     82         name = "grpc++_codegen_proto",
     83         actual = "@com_github_grpc_grpc//:grpc++_codegen_proto",
     84     )
     85 
     86     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 
    101     if "boringssl" not in native.existing_rules():
    102         native.http_archive(
    103             name = "boringssl",
    104             # on the chromium-stable-with-bazel branch
    105             url = "https://boringssl.googlesource.com/boringssl/+archive/dcd3e6e6ecddf059adb48fca45bc7346a108bdd9.tar.gz",
    106         )
    107 
    108     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         )
    115 
    116     if "com_google_protobuf" not in native.existing_rules():
    117         native.http_archive(
    118             name = "com_google_protobuf",
    119             strip_prefix = "protobuf-48cb18e5c419ddd23d9badcfe4e9df7bde1979b2",
    120             url = "https://github.com/google/protobuf/archive/48cb18e5c419ddd23d9badcfe4e9df7bde1979b2.tar.gz",
    121         )
    122 
    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",
    129         )
    130 
    131     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         )
    138 
    139     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         )
    145 
    146     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",
    150             strip_prefix = "benchmark-9913418d323e64a0111ca0da81388260c2bbe1e9",
    151             url = "https://github.com/google/benchmark/archive/9913418d323e64a0111ca0da81388260c2bbe1e9.tar.gz",
    152         )
    153 
    154     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         )
    161 
    162     if "com_google_absl" not in native.existing_rules():
    163         native.http_archive(
    164             name = "com_google_absl",
    165             strip_prefix = "abseil-cpp-cd95e71df6eaf8f2a282b1da556c2cf1c9b09207",
    166             url = "https://github.com/abseil/abseil-cpp/archive/cd95e71df6eaf8f2a282b1da556c2cf1c9b09207.tar.gz",
    167         )
    168 
    169     if "com_github_bazelbuild_bazeltoolchains" not in native.existing_rules():
    170         native.http_archive(
    171             name = "com_github_bazelbuild_bazeltoolchains",
    172             strip_prefix = "bazel-toolchains-cdea5b8675914d0a354d89f108de5d28e54e0edc",
    173             urls = [
    174                 "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/cdea5b8675914d0a354d89f108de5d28e54e0edc.tar.gz",
    175                 "https://github.com/bazelbuild/bazel-toolchains/archive/cdea5b8675914d0a354d89f108de5d28e54e0edc.tar.gz",
    176             ],
    177             sha256 = "cefb6ccf86ca592baaa029bcef04148593c0efe8f734542f10293ea58f170715",
    178         )
    179 
    180     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 
    188 # TODO: move some dependencies from "grpc_deps" here?
    189 def 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         )
    241