[prost] includes prost crate infos in rust_analyzer_aspect (#2232)

The change is fairly straightforward, but I did need to move prost
providers up to `prost/providers.bzl` and out of `private/prost.bzl` to
avoid a cyclic dependency.

What we do is:
* change `rust_prost_library` to return the `rust_proto_info` provider
* in the `rust-analyzer` aspect we iterate over transitive dep infos and
  generate the appropriate `RustAnalyzerInfo`
* lastly, we use the `crate_info` from `ProstProtoInfo` if we're
  processing a prost target as the "root" `crate_info`

There are a couple of things I'm not sure are correct:
1. For every prost dep I set `deps` to `[]` - I think that's correct but
   I'm not sure-sure.
2. Similarly I set `proc_macro_dylib_path` to always `None` - again I
   think that's correct, but not sure-sure.

Fixes #2121.

---------

Co-authored-by: UebelAndre <github@uebelandre.com>
5 files changed
tree: b6785e78ab167ebe7efdda2555321af031bbc7f3
  1. .bazelci/
  2. .github/
  3. bindgen/
  4. cargo/
  5. crate_universe/
  6. docs/
  7. examples/
  8. ffi/
  9. proto/
  10. rust/
  11. test/
  12. tools/
  13. util/
  14. wasm_bindgen/
  15. .bazelignore
  16. .bazelrc
  17. .clang-format
  18. .gitattributes
  19. .gitignore
  20. .rustfmt.toml
  21. ARCHITECTURE.md
  22. AUTHORS
  23. BUILD.bazel
  24. CODEOWNERS
  25. COMPATIBILITY.md
  26. CONTRIBUTING.md
  27. CONTRIBUTORS
  28. LICENSE.txt
  29. MODULE.bazel
  30. README.md
  31. version.bzl
  32. 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.