1"""A module defining dependencies of the `cargo-bazel` Rust target""" 2 3load("@rules_rust//rust:defs.bzl", "rust_common") 4load("//crate_universe:deps_bootstrap.bzl", "cargo_bazel_bootstrap") 5load("//crate_universe/3rdparty:third_party_deps.bzl", "third_party_deps") 6load("//crate_universe/3rdparty/crates:crates.bzl", _vendor_crate_repositories = "crate_repositories") 7load("//crate_universe/private:vendor_utils.bzl", "crates_vendor_deps") 8 9def crate_universe_dependencies(rust_version = rust_common.default_version, bootstrap = False, **kwargs): 10 """Define dependencies of the `cargo-bazel` Rust target 11 12 Args: 13 rust_version (str, optional): The version of rust to use when generating dependencies. 14 bootstrap (bool, optional): If true, a `cargo_bootstrap_repository` target will be generated. 15 **kwargs: Arguments to pass through to cargo_bazel_bootstrap. 16 17 Returns: 18 list[struct(repo=str, is_dev_dep=bool)]: A list of the repositories 19 defined by this macro. 20 """ 21 third_party_deps() 22 23 if bootstrap: 24 cargo_bazel_bootstrap(rust_version = rust_version, **kwargs) 25 26 direct_deps = _vendor_crate_repositories() 27 direct_deps.extend(crates_vendor_deps()) 28 return direct_deps 29