fork/rules_rust
git clone https://git.julia.blue/fork/rules_rust
8b8150db
cleanup
1"""A module is used to assist in bootstrapping cargo-bazel""" 2 3load ( "@bazel_tools//tools/build_defs/repo:utils.bzl" , "maybe" ) 4load ( "//cargo:defs.bzl" , "cargo_bootstrap_repository" ) 5load ( "//crate_universe/private:srcs.bzl" , "CARGO_BAZEL_SRCS" ) 6 7# buildifier: disable=bzl-visibility 8load ( "//rust/private:common.bzl" , "rust_common" ) 9 10def cargo_bazel_bootstrap ( name = "cargo_bazel_bootstrap" , rust_version = rust_common . default_version , ** kwargs ): 11"""An optional repository which bootstraps `cargo-bazel` for use with `crates_repository` 12 13Args: 14name (str, optional): The name of the `cargo_bootstrap_repository`. 15rust_version (str, optional): The rust version to use. Defaults to the default of `cargo_bootstrap_repository`. 16**kwargs: kwargs to pass through to cargo_bootstrap_repository. 17""" 18 19maybe ( 20cargo_bootstrap_repository , 21name = name , 22srcs = CARGO_BAZEL_SRCS , 23binary = "cargo-bazel" , 24cargo_lockfile = "@rules_rust//crate_universe:Cargo.lock" , 25cargo_toml = "@rules_rust//crate_universe:Cargo.toml" , 26version = rust_version , 27# The increased timeout helps avoid flakes in CI 28timeout = 900 , 29** kwargs 30)