Add gen_binaries annotation to control which bins to make target for (#1718)

* Add gen_binaries annotation to control which bins to make target for

Example:

    crates_vendor(
        name = "vendor",
        annotations = {
            "aaa": [crate.annotation(
                # Do not generate `rust_binary` for any of the package's bins.
                # This is the new default behavior.
                gen_binaries = False,
            )],
            "bbb": [crate.annotation(
                # Generate `rust_binary` for all bins. This is the previous
                # default behavior in rules_rust 0.15.0.
                gen_binaries = True,
            )],
            "ccc": [crate.annotation(
                # Generate `rust_binary` for a specific subset of the bins.
                gen_binaries = ["gcc-shim"],
            )],
        },
        cargo_lockfile = ":Cargo.lock",
        manifests = [":Cargo.toml"],
        mode = "remote",
        tags = ["manual"],
        vendor_path = "bazel",
    )

* Make generate_binaries globally configurable

* Document binary dependencies
22 files changed
tree: 46c2fc11273264120f94742c960adc3d559c8dbe
  1. .bazelci/
  2. .github/
  3. bindgen/
  4. cargo/
  5. crate_universe/
  6. docs/
  7. examples/
  8. proto/
  9. rust/
  10. test/
  11. tools/
  12. util/
  13. wasm_bindgen/
  14. .bazelignore
  15. .bazelrc
  16. .clang-format
  17. .gitignore
  18. ARCHITECTURE.md
  19. AUTHORS
  20. BUILD.bazel
  21. CODEOWNERS
  22. COMPATIBILITY.md
  23. CONTRIBUTING.md
  24. CONTRIBUTORS
  25. LICENSE.txt
  26. README.md
  27. version.bzl
  28. WORKSPACE.bazel
README.md

Rust Rules

  • Postsubmit Build status

Overview

This repository provides rules for building Rust projects with Bazel.

Community

General discussions and announcements take place in the GitHub Discussions, but there are additional places where community members gather to discuss rules_rust.

Documentation

Please refer to the full documentation.