elixir-protobuf / protobuf

A pure Elixir implementation of Google Protobuf.
https://hexdocs.pm/protobuf/readme.html
MIT License
823 stars 143 forks source link

DecodeError on windows #38

Closed Xiaobin0860 closed 5 years ago

Xiaobin0860 commented 6 years ago
syntax = "proto3";
//012345678901
message Test
{
}
elixir --version
Erlang/OTP 20 [erts-9.3] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10]
Elixir 1.7.2 (compiled with Erlang/OTP 19)

protoc.exe --version
libprotoc 3.6.1
%Google.Protobuf.SourceCodeInfo.Location{leading_comments: "0123456789", leading_detached_comments: [], path: [0, 4], span: [1, 4, 0, 2], trailing_comments: nil}
48 6 0
** (Protobuf.DecodeError) Google.Protobuf.SourceCodeInfo.Location: wrong wire_type for leading_detached_comments: got 0, want 2
    lib/protobuf/decoder.ex:36: Protobuf.Decoder.do_decode/3
    lib/protobuf/decoder.ex:74: Protobuf.Decoder.put_field/5
    lib/protobuf/decoder.ex:31: Protobuf.Decoder.do_decode/3
    lib/protobuf/decoder.ex:74: Protobuf.Decoder.put_field/5
    lib/protobuf/decoder.ex:31: Protobuf.Decoder.do_decode/3
    lib/protobuf/decoder.ex:74: Protobuf.Decoder.put_field/5
    lib/protobuf/decoder.ex:31: Protobuf.Decoder.do_decode/3
    lib/protobuf/protoc/cli.ex:8: Protobuf.Protoc.CLI.main/1
--elixir_out: protoc-gen-elixir: Plugin failed with status code 1.
tony612 commented 5 years ago

It seems a bug. Thank you for reporting!

tony612 commented 5 years ago

It seems not a bug in protobuf-elixir. The error shows what Elixir gets is wrong.