yarpc-go icon indicating copy to clipboard operation
yarpc-go copied to clipboard

protoc-gen-yarpc-go does not support implement full paths in go_package

Open robbertvanginkel opened this issue 7 years ago • 3 comments
trafficstars

protoc-gen-go supports having import paths in the go_package, which influences what directory the generated code is outputted to. See https://github.com/golang/protobuf/issues/139 for more details.

The protoc-gen-yarpc-go plugin currently does not support this, which results in having generated code that should be in the same package/path end up in different paths when calling the protoc with the same command but a different plugin. This can be worked around by not using the same output path, but we should probably implement the proposal to have the plugin behave similarly to the default go plugin.

robbertvanginkel avatar Aug 15 '18 18:08 robbertvanginkel

I would not support this personally - I outlawed this in Prototool for a reason, basically long-form go_package values really mess with generated code and enforce the creation of sub-directories you may not want. If anything, I would error in yarpc-go if there is a long-form go_package value.

bufdev avatar Aug 15 '18 18:08 bufdev

Unfortunately, we don't author all the Proto files that we need to generate YARPC code for. This came up when trying to generate YARPC code for gRPC's health check service.

akshayjshah avatar Aug 16 '18 22:08 akshayjshah

You can modify go packages using gogoreplace in gogo/protobuf or just sed, a lot of projects do this including etcd. Long-form packages will cause a lot of issues down the road if you support them at the company

bufdev avatar Aug 16 '18 22:08 bufdev