0

I am following this link https://crates.io/crates/protoc-gen-prost-crate to generate crate for rust code.

Below part generates mod.rs file

version: v1
plugins:
  - name: prost-crate
    out: gen
    strategy: all
    opt:
      - no_features

Afaik below part generates rust code

When using the gen_crate option, later Rust generators should generate into the src directory which will be created by this plugin:

version: v1
plugins:
  - name: prost
    out: gen/src
    opt:
      - bytes=.
      - file_descriptor_set
  - name: prost-crate
    out: gen
    strategy: all
    opt:
      - gen_crate

but i am getting error Failure: plugin prost: distp.bizlogic.common.v1.rs: does not exist

my_repo/distp/bizlogic/comom/v1/common.proto

generated mod.rs file

//generated
... 
pub mod common {
            // @@protoc_insertion_point(attribute:distp.datatier.common.v1)
            pub mod v1 {
                include!("distp.datatier.common.v1.rs");
                // @@protoc_insertion_point(distp.datatier.common.v1)
            }
        }

...

buf generate is giving below error

Failure: plugin prost: distp.bizlogic.common.v1.rs: does not exist

Please help me how to resolve this error

punam
  • 1
  • 1
  • I'm unfamiliar with `protoc-gen-prost-crate` but, the error (`distp.bizlogic.common.v1.rs`) and the `mod.rs` module suggest a contradiction. What is the `package` name in `common.proto`? I think it is `distp.bizlogic.common.v1`. You should (!?) have `src/gen` containing `distp.bizlogic.common.v1.rs` to reflect the proto `package` name and `mod.rs` should contain modules `distp` containing `bizlogic` containing `common` containing `v1` but it's only generating the inner 2 modules (`common` and `v1`). – DazWilkin May 08 '23 at 23:18

0 Answers0