-
Notifications
You must be signed in to change notification settings - Fork 997
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
namespacing issues with services when not using prost-types for well-known protobuf types #521
Comments
I also assume that a |
I wrote an initial attempt to solve in #522. It still needs guidance though. |
I'm running into this exact same issue. Thanks for reporting/fixing! |
I'll have to check since I haven't had a chance to get back to the original issue that prompted me to need that functionality. pantsbuild/pants#11411 I'll be able to get to it later this week. |
@tdyas any updates? |
I have a branch on Pants where I tried to use it with My main remaining issue is how to retain the default mapping of
Commenting out that line fails as expected at every site using Any advice? |
https://github.com/tdyas/pants/tree/use_bytes_for_any is the branch in question. |
#734 fixes the error when trying to convert |
@tdyas what is left for this issue? or can we close it? |
Bug Report
Version
tonic
v0.3.1tonic-build
v0.3.1prost
at danburkert/prost@a1cccbc (v0.6.x at the commit withBytes
support)Platform
macOS 10.15.7
Crates
tonic-build
Description
I am using Prost pinned to
master
at danburkert/prost@a1cccbc (which includes the use ofBytes
for binary fields).I would like to have Prost compile the well-known types (instead of using
prost-types
) so thatAny
fields useBytes
. However, when I enable that mode viaconfig.compile_well_known_types()
inbuild.rs
, generated grpc service stubs fail to compile because they are in a_client
submodule and are missing an extrasuper
reference necessary to get the identifier path out of that submodule.For example, when compiling the Google Operations API protos, errors like the following occur:
This code was within an
operations_client
submodule. The reference needs to besuper::super::protobuf::Empty
in this case, notsuper::protobuf::Empty
. (The service in this example returns agoogle.protobuf.Empty
.)I assume the issue is the special casing of identifiers in
google.protobuf
performed in the service generator attonic/tonic-build/src/prost.rs
Line 96 in 3c2a4a2
tonic/tonic-build/src/prost.rs
Line 106 in 3c2a4a2
proto_path
togoogle.protobuf
types but implicitly assumes that they will be found inprost-types
, which is not the case if they are being compiled by Prost.I am willing to contribute a fix, but would need some basic guidance on what the right fix is. I assume the fix be as simple as just taking the
else
branch when well-known types are being compiled?The text was updated successfully, but these errors were encountered: