24fa9550be
The previous version does not mark the `toolchain_type` as public, meaning that users of a CC toolchain using `@rules_cc//cc:toolchain_type` will get build errors along the lines of ``` ERROR: .../local_config_cc_toolchains/BUILD.bazel:18:1: in toolchain rule @local_config_cc_toolchains//:cc-toolchain-armeabi-v7a: alias '@rules_cc//cc:toolchain_type' referring to target '@bazel_tools//tools/cpp:toolchain_type' is not visible from target '@local_config_cc_toolchains//:cc-toolchain-armeabi-v7a'. Check the visibility declaration of the former target if you think the dependency is legitimate ```
66 lines
3.0 KiB
Python
66 lines
3.0 KiB
Python
"""Load dependencies needed to compile the protobuf library as a 3rd-party consumer."""
|
|
|
|
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
|
|
|
def protobuf_deps():
|
|
"""Loads common dependencies needed to compile the protobuf library."""
|
|
|
|
if not native.existing_rule("bazel_skylib"):
|
|
http_archive(
|
|
name = "bazel_skylib",
|
|
sha256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44",
|
|
urls = [
|
|
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz",
|
|
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz",
|
|
],
|
|
)
|
|
|
|
if not native.existing_rule("zlib"):
|
|
http_archive(
|
|
name = "zlib",
|
|
build_file = "@com_google_protobuf//:third_party/zlib.BUILD",
|
|
sha256 = "629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff",
|
|
strip_prefix = "zlib-1.2.11",
|
|
urls = ["https://github.com/madler/zlib/archive/v1.2.11.tar.gz"],
|
|
)
|
|
|
|
if not native.existing_rule("six"):
|
|
http_archive(
|
|
name = "six",
|
|
build_file = "@com_google_protobuf//:third_party/six.BUILD",
|
|
sha256 = "d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73",
|
|
urls = ["https://pypi.python.org/packages/source/s/six/six-1.12.0.tar.gz"],
|
|
)
|
|
|
|
if not native.existing_rule("rules_cc"):
|
|
http_archive(
|
|
name = "rules_cc",
|
|
sha256 = "9d48151ea71b3e225adfb6867e6d2c7d0dce46cbdc8710d9a9a628574dfd40a0",
|
|
strip_prefix = "rules_cc-818289e5613731ae410efb54218a4077fb9dbb03",
|
|
urls = ["https://github.com/bazelbuild/rules_cc/archive/818289e5613731ae410efb54218a4077fb9dbb03.tar.gz"],
|
|
)
|
|
|
|
if not native.existing_rule("rules_java"):
|
|
http_archive(
|
|
name = "rules_java",
|
|
sha256 = "f5a3e477e579231fca27bf202bb0e8fbe4fc6339d63b38ccb87c2760b533d1c3",
|
|
strip_prefix = "rules_java-981f06c3d2bd10225e85209904090eb7b5fb26bd",
|
|
urls = ["https://github.com/bazelbuild/rules_java/archive/981f06c3d2bd10225e85209904090eb7b5fb26bd.tar.gz"],
|
|
)
|
|
|
|
if not native.existing_rule("rules_proto"):
|
|
http_archive(
|
|
name = "rules_proto",
|
|
sha256 = "602e7161d9195e50246177e7c55b2f39950a9cf7366f74ed5f22fd45750cd208",
|
|
strip_prefix = "rules_proto-97d8af4dc474595af3900dd85cb3a29ad28cc313",
|
|
urls = ["https://github.com/bazelbuild/rules_proto/archive/97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz"],
|
|
)
|
|
|
|
if not native.existing_rule("rules_python"):
|
|
http_archive(
|
|
name = "rules_python",
|
|
sha256 = "e5470e92a18aa51830db99a4d9c492cc613761d5bdb7131c04bd92b9834380f6",
|
|
strip_prefix = "rules_python-4b84ad270387a7c439ebdccfd530e2339601ef27",
|
|
urls = ["https://github.com/bazelbuild/rules_python/archive/4b84ad270387a7c439ebdccfd530e2339601ef27.tar.gz"],
|
|
)
|