cargo_toml_env_vars: rule for generating env vars from a Cargo.toml file (#2772)

This allows people to set all of the compile-time variables that would
be set by Cargo.

This doesn't currently wire up crate_universe to generate and depend on
these targets for third-party crates, but I can add that if this PR
looks good - it should just be a matter of a small addition to the
generation templates (one new target, and setting `rustc_env_files` to
point at the new target).

Work towards #2677
82 files changed
tree: 73a69d1abae876cd3d01a0acfcf1973f59cedda9
  1. .bazelci/
  2. .bcr/
  3. .github/
  4. cargo/
  5. crate_universe/
  6. docs/
  7. examples/
  8. extensions/
  9. ffi/
  10. nix/
  11. rust/
  12. test/
  13. tools/
  14. util/
  15. .bazelignore
  16. .bazelrc
  17. .clang-format
  18. .clippy.toml
  19. .envrc
  20. .gitattributes
  21. .gitignore
  22. .prettierrc.toml
  23. .rustfmt.toml
  24. ARCHITECTURE.md
  25. AUTHORS
  26. BUILD.bazel
  27. CODEOWNERS
  28. COMPATIBILITY.md
  29. CONTRIBUTING.md
  30. CONTRIBUTORS
  31. LICENSE.txt
  32. MODULE.bazel
  33. README.md
  34. version.bzl
  35. WORKSPACE.bazel
  36. WORKSPACE.bzlmod
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.