ahamez / protox

A fast, easy to use and 100% conformant Elixir library for Google Protocol Buffers (aka protobuf)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unexpected list in typespec: [:high, :low]

MartinElvar opened this issue · comments

Hi,

First of all, thank you for putting effort into this library. :-)

I'm trying to compile the counter strike proto files found here
https://github.com/SteamRE/SteamKit/blob/master/Resources/Protobufs/csgo/cstrike15_usermessages.proto

If i run protoc -I./ --descriptor_set_out=./protox_test.test cstrike15_usermessages.proto i get no errors, and my file is populated.

But when i run

defmodule Demex.UserMessages do
  @external_resource "./lib/protobufs/cstrike15_usermessages.proto"

  use Protox, files: [
    "./lib/protobufs/cstrike15_usermessages.proto",
  ], namespace: Ost
 end

I can't compile my project, getting the following compile error.

⇒  mix compile
Compiling 1 file (.ex)
[libprotobuf WARNING google/protobuf/compiler/parser.cc:546] No syntax specified for the proto file: cstrike15_usermessages.proto. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. (Defaulted to proto2 syntax.)
[libprotobuf WARNING google/protobuf/compiler/parser.cc:546] No syntax specified for the proto file: netmessages.proto. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. (Defaulted to proto2 syntax.)
[libprotobuf WARNING google/protobuf/compiler/parser.cc:546] No syntax specified for the proto file: cstrike15_gcmessages.proto. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. (Defaulted to proto2 syntax.)
[libprotobuf WARNING google/protobuf/compiler/parser.cc:546] No syntax specified for the proto file: steammessages.proto. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. (Defaulted to proto2 syntax.)
cstrike15_usermessages.proto: warning: Import google/protobuf/descriptor.proto but not used.
Compiling lib/user_messages.ex (it's taking more than 15s)

== Compilation error in file lib/user_messages.ex ==
** (CompileError) lib/user_messages.ex:4: unexpected list in typespec: [:high, :low]
    (elixir) lib/kernel/typespec.ex:1171: Kernel.Typespec.compile_error/2
    (elixir) lib/kernel/typespec.ex:1160: Kernel.Typespec.typespec/3
    (elixir) lib/kernel/typespec.ex:1189: Kernel.Typespec.fn_args/5
    (elixir) lib/kernel/typespec.ex:544: Kernel.Typespec.translate_spec/7

I simply don't know where to look, hope someone can help me.

Could i be, that it's trying to parse this.
https://github.com/google/protobuf/blob/master/src/google/protobuf/descriptor.proto#L690

Seems to be different params.

== Compilation error in file lib/user_messages.ex ==
** (CompileError) lib/user_messages.ex:4: unexpected list in typespec: [:is_extension, :name_part]

Even tho. i don't change a thing.

Hello, thanks for the report! It's fixed by 0.16.2, available on hex.pm.

Works like a charm, thx for the quick action.