fork/rules_rust

git clone https://git.julia.blue/fork/rules_rust

UebelAndreReplaced `crates_universe` rule with `crates_repository` (#1158)59fab4e7

0.8.1
1.0 KiB25 linesraw
1"""A module is used to assist in bootstrapping cargo-bazel"""
2
3load("//cargo:defs.bzl", "cargo_bootstrap_repository")
4load("//crate_universe/private:srcs.bzl", "CARGO_BAZEL_SRCS")
5
6# buildifier: disable=bzl-visibility
7load("//rust/private:common.bzl", "rust_common")
8
9def cargo_bazel_bootstrap(name = "cargo_bazel_bootstrap", rust_version = rust_common.default_version):
10    """An optional repository which bootstraps `cargo-bazel` for use with `crates_repository`
11
12    Args:
13        name (str, optional): The name of the `cargo_bootstrap_repository`.
14        rust_version (str, optional): The rust version to use. Defaults to the default of `cargo_bootstrap_repository`.
15    """
16    cargo_bootstrap_repository(
17        name = name,
18        srcs = CARGO_BAZEL_SRCS,
19        binary = "cargo-bazel",
20        cargo_lockfile = "@rules_rust//crate_universe:Cargo.lock",
21        cargo_toml = "@rules_rust//crate_universe:Cargo.toml",
22        version = rust_version,
23        # The increased timeout helps avoid flakes in CI
24        timeout = 900,
25    )