Add support for `all_crate_deps` when using bzlmod (#2461)

This adds support for the `all_crate_deps` functionality in repositories
created via bzlmod. An [earlier
update](https://github.com/bazelbuild/rules_rust/pull/1910/files) that
added support for 3rd party crates with bzlmod intentionally left this
functionality out.

Some key things that I think should be reviewed: 

- Is the method of getting `crate_label_template` in `extensions.bzl`
the best approach? It requires a lot of hard-coding, and it seems like
it might be possible to simplify but I'm not familiar enough with the
code base to know how.
- Is the `generate_config_file` method from `crates_vendor.bzl` the
right method to use for generating the cargo-bazel config? It seems like
there are two places with similar logic (here and in
`crates_repositories.bzl` (see
https://github.com/bazelbuild/rules_rust/pull/1832)
12 files changed
tree: 082023e9a6d8c6c02127ed7b3e1f880d7cce9712
  1. .bazelci/
  2. .bcr/
  3. .github/
  4. bindgen/
  5. cargo/
  6. crate_universe/
  7. docs/
  8. examples/
  9. ffi/
  10. nix/
  11. proto/
  12. rust/
  13. test/
  14. tools/
  15. util/
  16. wasm_bindgen/
  17. .bazelignore
  18. .bazelrc
  19. .clang-format
  20. .envrc
  21. .gitattributes
  22. .gitignore
  23. .prettierrc.toml
  24. .rustfmt.toml
  25. ARCHITECTURE.md
  26. AUTHORS
  27. BUILD.bazel
  28. CODEOWNERS
  29. COMPATIBILITY.md
  30. CONTRIBUTING.md
  31. CONTRIBUTORS
  32. LICENSE.txt
  33. MODULE.bazel
  34. README.md
  35. version.bzl
  36. 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.