fork/rules_rust

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

UebelAndreMoved rust extension rules into a separate `rules_rust_ext` workspace. (#3007)2bad96d9

cleanup
1.9 KiB71 linesraw
1load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
2load("@rules_rust//crate_universe:defs.bzl", "crate", "crates_vendor")
3load("//:repositories.bzl", "BINDGEN_VERSION")
4
5_BINDGEN_CLI_PACKAGES = {
6    "clap": crate.spec(
7        version = "4.3.3",
8    ),
9    "clap_complete": crate.spec(
10        version = "4.3.1",
11    ),
12    "env_logger": crate.spec(
13        version = "0.10.0",
14    ),
15}
16
17crates_vendor(
18    name = "crates_vendor",
19    annotations = {
20        "bindgen": [crate.annotation(
21            gen_build_script = True,
22        )],
23        "clang-sys": [crate.annotation(
24            gen_build_script = True,
25        )],
26        "libc": [crate.annotation(
27            gen_build_script = True,
28        )],
29        "winapi": [crate.annotation(
30            gen_build_script = True,
31        )],
32    },
33    cargo_lockfile = "Cargo.Bazel.lock",
34    generate_build_scripts = False,
35    mode = "remote",
36    packages = dict({
37        "bindgen": crate.spec(
38            default_features = False,
39            features = ["runtime"],
40            version = BINDGEN_VERSION,
41        ),
42        "bindgen-cli": crate.spec(
43            default_features = False,
44            features = ["runtime"],
45            version = BINDGEN_VERSION,
46        ),
47        "clang-sys": crate.spec(
48            # Should match the version of llvm-project being used.
49            features = ["clang_14_0"],
50            version = "1.6.1",
51        ),
52    }.items() + _BINDGEN_CLI_PACKAGES.items()),
53    repository_name = "rules_rust_bindgen_deps",
54    tags = ["manual"],
55)
56
57alias(
58    name = "bindgen",
59    actual = "@rules_rust_bindgen__bindgen-cli-{}//:bindgen-cli".format(BINDGEN_VERSION),
60    tags = ["manual"],
61    visibility = ["//visibility:public"],
62)
63
64bzl_library(
65    name = "bzl_lib",
66    srcs = [
67        "//3rdparty/crates:crates.bzl",
68        "//3rdparty/crates:defs.bzl",
69    ],
70    visibility = ["//:__pkg__"],
71)