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
Grpc.Tools causes a build error when .proto file name contains dot #17661
Comments
CC @kkm000 |
Reproduced. Thanks for the report! |
Any workaround for that? I have the same problem using 1.19.1 |
@vctrferreira It seems that the simplest workaround would be to rename you .proto file to not contain a dot |
I think I found the rootcause: There is a mismatch between the file name generated by
Protobuf uses which ends up using which has special handling for '.' in the file name (in this case it get skipped and the next letter is going to be uppercase). |
@jtattermusch, yes, I've seen that. I'm very sorry for sitting too long on the issues. Actually, the root root cause is the difference between protobuf-generated and grpc-plugin-generated filenames, so we end up with I'm tempted to fix grpc codegen's C# filename production to match that of protoc (the dot is an edge case). Do you think it would be too breaking? |
@kkm000 the problem is that the method for generating the output filename is used by all the grpc_*_plugin regardless of the language I believe - so this could potentially break other languages as well. Here's what I propose:
|
@jtattermusch SGTM, I'll do the (1) ASAP. Yes, you are right about which of the two algorithms I implemented, it's the other way round. Here's the dependency file from protoc, actually generated files
So we do generate |
ETA couple hours, done and works locally. I am checking if I can cram fixes to other reported issues into one PR. |
protoc and gRPC codegens differently treat non-ASCII letter characters and symbols other than underscores when constructing their respective output filenames for generated .cs files. This change reproduces their respective behaviors exactly. Fixes #17661
What version of gRPC and what language are you using?
Grpc 1.17.1
Grpc.Core 1.17.1
Grpc.Tools 1.17.1
Language: C#
What operating system (Linux, Windows, …) and version?
Windows 10 Pro 1803 64bit
What runtime / compiler are you using (e.g. python version or version of gcc)
.NET Core SDK 2.1.502
What did you do?
I tried to build .proto which file name contains dot(e.g. hello.world.proto) by Grpc.Tools.
source files: Greeter.zip
What did you expect to see?
Build succeeds.
What did you see instead?
Following build errors:
The text was updated successfully, but these errors were encountered: