-
Notifications
You must be signed in to change notification settings - Fork 29
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
Generating for other languages #25
Comments
Protobuild is really only for managing protobuf generation in Go environment. Much of the configuration is around resolving includes ( For another language, you'd have to build a tool that would be focused on that. For example, a javascript version might look at using node_modules to resolve the files. You can craft the includes manually, which might be enough for your approach. For example, the error on Now, it would be cool to have Protobuild support other languages, but I am not sure I have the bandwidth or expertise to support. However, I can help you to get them compiling in another language. Let me know how you'd like to proceed. |
Thanks for the answer. That makes sense and I don't think Protobuild needs to know how to build for other languages but it would be nice if it could help the user somehow. Protobuf/grpc is widely used for systems where you have multiple languages/stack involved, so it's not a rare occurrence. In this case, I was trying to build containard proto definitions in Rust, so that I could call the GRPC API using Rust. Technically, all I needed was for Protobuild to output the import paths that it was generating so that I could plug that into my protoc command. For example, I was able to build successfully with the following snippet, which required a lot of digging to figure out how Protobuild works internally:
If Protobuild could simply output those parameters, or allow the user to specify additional parameters when invoking protoc, then it would make things a lot easier. |
Sorry for the late response here. What if we added the ability to dump the import paths?
Let me think about this a bit. This might be useful for debugging environment issues, as well. |
@stevvooe that would be good enough and would solve the problem. |
@divoxx did you manage to solve this? I also just tried to create bindings for containerd using tonic. Found this in a python repo: https://github.com/siemens/pycontainerd/blob/master/script/genpb2.sh But still wasn't able to make it work. |
I understand that this tool has a focus on Go applications but in general, a GRPC or protobuf definition is shared by other languages in order to generate the client code necessary to talk to those services.
Is there any guide or recommendation on how to do that? Currently protoc throws errors such as (Example taken from containerd):
Is there any simple/recommended way to make those imports resolve when generating for other languages? Or any way to tell protobuild to run
protoc
with a specific plugin, i.e.--rust_out
or--ruby_out
, etc?The text was updated successfully, but these errors were encountered: