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

Fails when using with protoc-gen-connect-go #171

Open
ghost opened this issue Aug 30, 2024 · 2 comments
Open

Fails when using with protoc-gen-connect-go #171

ghost opened this issue Aug 30, 2024 · 2 comments

Comments

@ghost
Copy link

ghost commented Aug 30, 2024

Enabling debug logging shows the following error:

Parse Go:       helloworldconnect/helloworld.connect.go
Error: unknown package: helloworldconnect
Failure: plugin protoc-gen-go-patch: exit status 1

The connect go generator forces the connect rpc stub generation to be in a sub-package to avoid namespace conflicts which I imagine is why it fails.

@ydnar
Copy link
Contributor

ydnar commented Aug 31, 2024

Can you provide a small reproducible example? I'll take a look.

@ghost
Copy link
Author

ghost commented Sep 2, 2024

Sure

Create example.proto with the following contents:

syntax = "proto3";

option go_package = "example.com/example";

service ExampleService {
  rpc ExampleRPC(ExampleMessage) returns (ExampleMessage);
}

message ExampleMessage {}

Run the following:

$ PROTO_PATCH_DEBUG_LOGGING=true protoc -I . --go-patch_out=plugin=connect-go:. example.proto 

Scan proto:     example.proto
Generating:     example.proto
Go package:     example "example.com/example"

Parse Go:       example.com/example/exampleconnect/example.connect.go
Error: unknown package: exampleconnect
--go-patch_out: protoc-gen-go-patch: Plugin failed with status code 1.

Note of course you will need protoc-gen-connect-go which can be installed with:

go install connectrpc.com/connect/cmd/protoc-gen-connect-go@latest

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

1 participant