elixir-protobuf / protobuf

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

lib/elixirpb/pb_extension.pb.ex is missing in the package #367

Closed sekiyama58 closed 4 months ago

sekiyama58 commented 8 months ago

lib/elixirpb/pb_extension.pb.ex is missing in the 0.11.0 or 0.12.0 packages. Due to lacking the extension, the decoder fails to read FileOptions from descriptor_set. Instead, it is put into __unknown_fields__ , like:

  %Google.Protobuf.FileDescriptorProto{
    name: "model/test.proto",
...
    options: %Google.Protobuf.FileOptions{
      java_package: nil,
      ...
      uninterpreted_option: [],
      __pb_extensions__: %{},
      __unknown_fields__: [
        {1047, 2, <<10, 16, 72, ...>>}
      ]
    }, ...

Expected result (this is returned if the library is directly loaded from the local repository path checked out from GitHub):

  %Google.Protobuf.FileDescriptorProto{
    name: "model/test.proto",
...
    options: %Google.Protobuf.FileOptions{
      java_package: nil,
      ...
      uninterpreted_option: [],
      __pb_extensions__: %{
        {Elixirpb.PbExtension, :file} => %Elixirpb.FileOptions{
          module_prefix: "TestModulePrefix",
          __unknown_fields__: []
        }
      },
      __unknown_fields__: []
    }, ...