Merge deps of related crates in Rust Analyzer support (#781)

It can happen a single source file is present in multiple crates - there can
  be a `rust_library` with a `lib.rs` file, and a `rust_test` for the `test`
  module in that file. Tests can declare more dependencies than what library
  had. Therefore we had to collect all `RustAnalyzerInfo`s for a given crate
  and take deps from all of them.

  There's one exception - if the dependency is the same crate name as the
  the crate being processed, we don't add it as a dependency to itself. This is
  common and expected - `rust_test.crate` pointing to the `rust_library`.
18 files changed
tree: aecbbdcdc749d3735e458bae8b00abe16ae3635c
  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. .gitignore
  17. ARCHITECTURE.md
  18. AUTHORS
  19. BUILD.bazel
  20. CODEOWNERS
  21. CONTRIBUTING.md
  22. CONTRIBUTORS
  23. LICENSE.txt
  24. README.md
  25. WORKSPACE.bazel
  26. workspace.bzl
README.md

Rust Rules

  • Postsubmit Build status
  • Postsubmit + Current Bazel Incompatible Flags Build status

Overview

This repository provides rules for building Rust projects with Bazel.

Community

Please refer to the full documentation.