fork/rules_rust

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

freeformstuConsolidate rust_prost_library and fix extension-only proto generation. (#2047)7f751cdd

patching
902 B32 linesraw
1"""Rules for building proto libraries in Rust."""
2
3load(
4    "//proto/prost/private:prost.bzl",
5    _rust_prost_library = "rust_prost_library",
6    _rust_prost_toolchain = "rust_prost_toolchain",
7)
8
9def rust_prost_library(name, **kwargs):
10    """A rule for generating a Rust library using Prost.
11
12    Args:
13        name (str): The name of the target.
14        **kwargs (dict): Additional keyword arguments for the underlying
15            `rust_prost_library` rule.
16    """
17
18    # Clippy and Rustfmt will attempt to run on these targets.
19    # This is not correct and likely a bug in target detection.
20    tags = kwargs.pop("tags", [])
21    if "no-clippy" not in tags:
22        tags.append("no-clippy")
23    if "no-rustfmt" not in tags:
24        tags.append("no-rustfmt")
25
26    _rust_prost_library(
27        name = name,
28        tags = tags,
29        **kwargs
30    )
31
32rust_prost_toolchain = _rust_prost_toolchain