Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin prost-crate: The system couldn't find the given file. (os error 2) #56

Closed
teamplayer3 opened this issue Mar 2, 2023 · 5 comments

Comments

@teamplayer3
Copy link

teamplayer3 commented Mar 2, 2023

My directory structure:

- root
  - api-crate
    - src
    | Cargo.toml
  - proto
    | buf.yaml
  | buf.gen.yaml
  | buf.work.yaml 

protoc-gen-prost-crate version v0.3.1

Now I run buf generate in the root directory, and it exits with error:

plugin prost-crate: The system couldn't find the given file. (os error 2)

buf.gen.yaml:

version: v1
plugins:
  - remote: buf.build/prost/plugins/prost:v0.2.1-1
    out: api-crate/src/gen
    opt:
      - compile_well_known_types
      - extern_path=.google.protobuf=::pbjson_types
      - file_descriptor_set
  - remote: buf.build/prost/plugins/serde:v0.2.1-1
    out: api-crate/src/gen
  - remote: buf.build/prost/plugins/tonic:v0.2.1-1
    out: api-crate/src/gen
    opt:
      - compile_well_known_types
      - extern_path=.google.protobuf=::pbjson_types
  - name: prost-crate
    out: api-crate
    strategy: all
    opt:
      - include_file=api-crate/src/gen/mod.rs
      - gen_crate
@drivasperez
Copy link

We ran into this issue as well after upgrading to v0.2.2; for now we're getting around it by reverting to v0.2.1, as it seems like something broke in the latest release.

@teamplayer3
Copy link
Author

We ran into this issue as well after upgrading to v0.2.2; for now we're getting around it by reverting to v0.2.1, as it seems like something broke in the latest release.

@drivasperez Which crate did you revert to v0.2.1? My protoc-gen-prost-crate crate is at v0.3.1

@drivasperez
Copy link

@drivasperez Which crate did you revert to v0.2.1? My protoc-gen-prost-crate crate is at v0.3.1

Apologies for the ambiguity:

protoc-gen-prost: 0.2.1

protoc-gen-prost-crate: 0.3.1

@teamplayer3
Copy link
Author

@drivasperez Ok, but as I can see the newest version of protoc-gen-prost-crate is 0.3.1 or am I wrong. I get this error with 0.3.1.

@teamplayer3
Copy link
Author

I found my problem. I have to specify the path to the Cargo.toml in opt like gen_crate=./api-crate/Cargo.toml. As default, it uses only Cargo.toml as a path. Somehow, this is not based on the out option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants