-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Using same package across multiple proto files fails when multiple services are present #168
Comments
The simplest stop-gap I've found for this is to move all service definitions into a single "services.proto" file per package. This is definitely sub-par but can at least unblock the issue. |
Hi! Thanks for reporting, I believe this is a duplicate of #38? |
Ah, I didn't read far enough into it. The observation in #38 (comment) is definitely the same issue. Is #38 multiple issues with codegen or am I missing something? If it is, should it be split up into one issue per specific user-visible behavior? |
I think it relates to the same issue as having multiple services in the same proto package that gets compiled together. Not sure what to really break it up into though :/ |
I believe this should be fixed by #173, feel free to reopen is it doesnt! |
I have this issue when we have /auth folder for protos and then a session.proto with just type definitions. Another file service.proto. Both in the same Anyone find a solution to this? |
Bug Report
Version
$ cargo tree | grep tonic
foobar v0.1.0 (/Users/akesling/Devel/rust/tonic-break/foobar)
└── tonic v0.1.0-alpha.6
└── tonic-build v0.1.0-alpha.6
Platform
$ uname -a
Darwin notloh.lan 19.0.0 Darwin Kernel Version 19.0.0: Thu Oct 17 16:17:15 PDT 2019; root:xnu-6153.41.3~29/RELEASE_X86_64 x86_64
Description
I've created an example project demonstrating the failure I'm seeing: https://github.com/akesling/tonic-break
When multiple proto files are provided, if they A) are in the same proto package and B) contain a service in more than one file, then compilation fails. Here's an example failure output: https://gist.github.com/akesling/4f1e026d17aa6376ce3213e79c8902b3
The issue seems to be that tonic-build is outputting multiple "pub mod client" stanzas. Everything works if only one file includes services.
Would it be possible to aggregate service definitions before codegen output to prevent stanza duplication like this?
The text was updated successfully, but these errors were encountered: