Skip to content

Argument file needs support for multi-char and BOM #7474

@Falco20019

Description

@Falco20019

What version of protobuf and what language are you using?
libprotoc 3.3.0 / Grpc.Tools 2.28.1

What operating system (Linux, Windows, ...) and version?
Windows 10 Build 1803

What did you do?

  1. Create test.rsp containing non-ascii:
--plugin=protoc-gen-grpc=ágrpc_csharp_plugin.exe
--grpc_out=grpc_out
test.proto
  1. Run protoc.exe @test.rsp

What did you expect to see
protoc running and creating the files.

What did you see instead?
UTF-8 without BOM: --grpc_out: protoc-gen-grpc: Das System kann die angegebene Datei nicht finden.
UTF-8 with BOM: You seem to have passed an empty string as one of the arguments to C:\Users\dejhbk0l\.nuget\packages\grpc.tools\2.28.1\tools\windows_x64\protoc.exe. This is actually sort of hard to do. Congrats. Unfortunately it is not valid input so the program is going to die now.

Anything else we should know about your project / environment
https://github.com/protocolbuffers/protobuf/blame/master/src/google/protobuf/compiler/command_line_interface.cc#L1326 uses std::ifstream instead of std::wifstream and therefore does not allow BOM or wide characters.

This is a minimal example. We stumbled over this in grpc/grpc#17995 as we distribute protoc and the protoc-gen-grpc through NuGet and the default for dotnet nuget locals global-packages is %userprofile%\.nuget\packages\. For some of our users, the username includes non-ascii characters which leads to protoc-gen-grpc containing non-ascii characters and the argument file not being parsable.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions