Open wingyplus opened 2 years ago
This occurs also in Windows 10 with standard command prompt or pwsh For me it's not strictly based on the indenting. e.g I get the error with 2 indent spaces below, but apparently not 3 or more message HelloRequest { string name= 1; } however, with message HelloReply { string name123456789 = 1; } I get the error seemingly with any number of indents including zero. (but name1 name12 etc are all fine, as are longer strings such as name1234567891234..)
error is:
protoc --elixir_out=./lib protos/greeter2.proto ** (Protobuf.DecodeError) cannot decode binary data, unknown wire type: 7 (protobuf 0.11.0) lib/protobuf/decoder.ex:80: Protobuf.Decoder.handle_field/5 (protobuf 0.11.0) lib/protobuf/decoder.ex:17: Protobuf.Decoder.decode/2 (protobuf 0.11.0) lib/protobuf/decoder.ex:231: Protobuf.Decoder.value_for_field/3 (protobuf 0.11.0) lib/protobuf/decoder.ex:382: Protobuf.Decoder.update_in_message/3 (protobuf 0.11.0) lib/protobuf/decoder.ex:176: Protobuf.Decoder.handle_value/6 (protobuf 0.11.0) lib/protobuf/decoder.ex:17: Protobuf.Decoder.decode/2 (protobuf 0.11.0) lib/protobuf/decoder.ex:231: Protobuf.Decoder.value_for_field/3 (protobuf 0.11.0) lib/protobuf/decoder.ex:382: Protobuf.Decoder.update_in_message/3 --elixir_out: protoc-gen-elixir: Plugin failed with status code 1.
I thought I could work around it by adjusting names or spaces here and there - but in any non-trivial file it becomes too hard to debug because multiple lines can be causing the error so it's a real showstopper.
As a workaround for now I'm trying :protox which seems able to compile proto3 files on windows - but there is less info out there on using this library.
From https://github.com/wingyplus/grpc/blob/main/test/support/helloworld.proto. If I change message field by diff below:
The
protoc-gen-elixir
will crash with output:I run it on Windows 11 with PowerShell Core.