Skip to content

gen_rust_project does not add prost and tonic deps to rust_proto_library #3189

Closed
@hauserx

Description

@hauserx

Example from examples/proto after running bazel run @rules_rust//tools/rust_analyzer:gen_rust_project. Note that rust-analyzer shows a number of diagnostics, for example in grpc_client/src/main.rs:

Image

The generated rust-project.json has missing deps:

  "crates": [
    {
      "display_name": "proto_bindings",
      "root_module": "(...)/execroot/_main/bazel-out/k8-fastbuild/bin/proto_bindings/proto_bindings.lib.rs",
      "edition": "2021",
      "deps": [],

Adding below dependencies manually fixes the issue:

  "crates": [
    {
      "display_name": "proto_bindings",
      "root_module": "(...)/execroot/_main/bazel-out/k8-fastbuild/bin/proto_bindings/proto_bindings.lib.rs",
      "edition": "2021",
      "deps": [
        {
          "crate": 75,
          "name": "prost"
        },
        {
          "crate": 80,
          "name": "tonic"
        }
      ],

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions