fork/rules_rust
git clone https://git.julia.blue/fork/rules_rust
ffe8eff0
patching
1"""Dependencies for Rust prost rules""" 2 3load ( "@bazel_tools//tools/build_defs/repo:http.bzl" , "http_archive" ) 4load ( "@bazel_tools//tools/build_defs/repo:utils.bzl" , "maybe" ) 5load ( "//proto/prost/private/3rdparty/crates:crates.bzl" , "crate_repositories" ) 6 7def rust_prost_dependencies ( bzlmod = False ): 8"""Declares repositories needed for prost. 9 10Args: 11bzlmod (bool): Whether bzlmod is enabled. 12 13Returns: 14list[struct(repo=str, is_dev_dep=bool)]: A list of the repositories 15defined by this macro. 16""" 17 18direct_deps = [ 19struct ( repo = "rules_rust_prost__heck" , is_dev_dep = False ), 20] 21if bzlmod : 22# Without bzlmod, this function is normally called by the 23# rust_prost_dependencies function in the private directory. 24# However, the private directory is inaccessible, plus there's no 25# reason to keep two rust_prost_dependencies functions with bzlmod. 26direct_deps . extend ( crate_repositories ()) 27else : 28maybe ( 29http_archive , 30name = "rules_proto" , 31sha256 = "6fb6767d1bef535310547e03247f7518b03487740c11b6c6adb7952033fe1295" , 32strip_prefix = "rules_proto-6.0.2" , 33url = "https://github.com/bazelbuild/rules_proto/releases/download/6.0.2/rules_proto-6.0.2.tar.gz" , 34) 35 36maybe ( 37http_archive , 38name = "com_google_protobuf" , 39sha256 = "52b6160ae9266630adb5e96a9fc645215336371a740e87d411bfb63ea2f268a0" , 40strip_prefix = "protobuf-3.18.0" , 41urls = [ "https://github.com/protocolbuffers/protobuf/releases/download/v3.18.0/protobuf-all-3.18.0.tar.gz" ], 42) 43 44maybe ( 45http_archive , 46name = "rules_rust_prost__heck" , 47sha256 = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" , 48type = "tar.gz" , 49urls = [ "https://static.crates.io/crates/heck/heck-0.4.1.crate" ], 50strip_prefix = "heck-0.4.1" , 51build_file = Label ( "@rules_rust//proto/prost/private/3rdparty/crates:BUILD.heck-0.4.1.bazel" ), 52) 53return direct_deps