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

gRPC example's proto regeneration command doesn't work #249

Closed
2rs2ts opened this issue Apr 10, 2023 · 1 comment · Fixed by #286
Closed

gRPC example's proto regeneration command doesn't work #249

2rs2ts opened this issue Apr 10, 2023 · 1 comment · Fixed by #286

Comments

@2rs2ts
Copy link

2rs2ts commented Apr 10, 2023

Hi there, forgive me for any ignorance, as I'm a total newb with gRPC, but I tried the gRPC example to see if it would work (specifically, if generating Golang code from the provided .proto file would result in the same or similar results as what's already checked in to this repo) because I'm planning to use this repo's plugin system in my company's project and I want to make sure that I can reference the examples to make sure I'm on the right track. However, when I follow the instructions from the README, I get the following error:

% protoc -I proto/ proto/kv.proto --go_out=plugins=grpc:proto/
protoc-gen-go: unable to determine Go import path for "kv.proto"

Please specify either:
        • a "go_package" option in the .proto source file, or
        • a "M" argument on the command line.

See https://developers.google.com/protocol-buffers/docs/reference/go-generated#package for more information.

--go_out: protoc-gen-go: Plugin failed with status code 1.

Here's my version of protoc in case it matters:

% protoc --version
libprotoc 3.15.8

I did notice that the README hasn't been updated in 6 years, so my guess is that either there's something that changed with protoc since then, or maybe there's some unspoken assumption about the development environment that I'm supposed to have met before I started on this, but I did check to make sure that the example compiled and worked as-is without changing anything about my development environment, and since it does, I feel like it's not PEBKAC in this case. Regardless, it would be nice to get an update to the instructions either way: if it's a matter of something about protoc changing in the past 6 years, then the code/instructions should change accordingly, and if it's a matter of me just not meeting some base assumptions about the development environment, then having those assumptions mentioned, if not spelled out, would be really useful. It would probably also be good to mention which version of protoc was used to generate the Golang code.

Thank you for taking the time to read this!

2rs2ts added a commit to 2rs2ts/go-plugin that referenced this issue Apr 11, 2023
This was done using the latest release of protoc as of this authoring,
3.15.8. Whatever very old version of protoc was used before was not
stated, so in order to ensure that the example instructions still
worked, we wanted to use the latest available now. Updating the grpc and
protobuf dependencies was required, as well as adding the `go_package`
option to the .proto file.

This fixes hashicorp#249.

Co-authored-by: crashdummy101 <129228667+crashdummy101@users.noreply.github.com>
Co-authored-by: czavieh <czavieh@users.noreply.github.com>
@tomhjp tomhjp linked a pull request Oct 16, 2023 that will close this issue
@tomhjp
Copy link
Contributor

tomhjp commented Oct 16, 2023

Thanks for reporting with all the details, you're absolutely right. #286 is going to switch over to using buf (https://buf.build/docs/installation) and update the instructions, and it pins the plugin versions used to prevent confusion like this in future.

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