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

main
946 B34 linesraw
1load("@bazel_skylib//rules:build_test.bzl", "build_test")
2load("@rules_proto//proto:defs.bzl", "proto_library")
3load("@rules_rust_protobuf//:defs.bzl", "rust_proto_library")
4
5proto_library(
6    name = "a_proto",
7    srcs = ["a.proto"],
8    strip_import_prefix = "",
9)
10
11proto_library(
12    name = "b_proto",
13    srcs = ["b.proto"],
14    strip_import_prefix = "",
15    deps = [":a_proto"],
16)
17
18rust_proto_library(
19    name = "b_rust",
20    # In Rust nightly (2023-04-20), this target fails due to the following issue:
21    # https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/builtin/static.AMBIGUOUS_GLOB_REEXPORTS.html
22    tags = ["no-clippy"],
23    # The protobuf rules don't currently work on Windows.
24    target_compatible_with = select({
25        "@platforms//os:windows": ["@platforms//:incompatible"],
26        "//conditions:default": [],
27    }),
28    deps = [":b_proto"],
29)
30
31build_test(
32    name = "build_test",
33    targets = [":b_rust"],
34)