Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile protobuf files with duplicate imports. #69

Closed
wants to merge 3 commits into from

Conversation

UglyTroLL
Copy link

For example, a.proto imports 'b.proto' and 'c.proto' and b.proto imports 'c.proto' as well, which is a valid case. But when try to compile a.proto, the compiler will complain about something like '{32,erl_lint,{redefine_record,c}}' and '{26,erl_lint,{duplicated_export,{decode_c,1}}}' followed by compilation failure.

e.g.

  • a.proto
import "b.proto";
import "c.proto";

message A {
  optional int32 aa = 1;
}
  • b.proto
import "c.proto";

message B {
  optional int32 bb = 1;
}
  • c.proto
message C {
  optional int32 cc = 1;
}

could not be compiled with error message:

=INFO REPORT==== 13-Aug-2014::18:16:02 ===
Writing header file to "a_pb.hrl"
** exception error: no match of right hand side value {error,[{"src/a_pb.erl",
                                                               [{32,erl_lint,{redefine_record,c}},
                                                                {32,erl_lint,{redefine_record,cc}},
                                                                {42,erl_lint,{redefine_function,{encode_c,1}}},
                                                                {42,erl_lint,{redefine_function,{encode_cc,1}}},
                                                                {110,erl_lint,{redefine_function,{decode_c,1}}},
                                                                {110,erl_lint,{redefine_function,{decode_cc,1}}},
                                                                {113,erl_lint,{redefine_function,{delimited_decode_c,1}}},
                                                                {113,erl_lint,
                                                                 {redefine_function,{delimited_decode_cc,1}}}]}],
                                                             [{"src/a_pb.erl",
                                                               [{26,erl_lint,{duplicated_export,{decode_c,1}}},
                                                                {26,erl_lint,{duplicated_export,{decode_cc,1}}},
                                                                {26,erl_lint,{duplicated_export,{delimited_decode_c,1}}},
                                                                {26,erl_lint,{duplicated_export,{delimited_decode_cc,1}}},
                                                                {26,erl_lint,{duplicated_export,{encode_c,1}}},
                                                                {26,erl_lint,{duplicated_export,{encode_cc,1}}}]}]}
     in function  protobuffs_compile:output/4 (src/protobuffs_compile.erl, line 155)

For example, a.proto imports 'b.proto' and 'c.proto' and b.proto imports 'c.proto' as well, which is a valid case. But when try to compile a.proto, the compiler will complain about something like '{32,erl_lint,{redefine_record,c}}' and '{26,erl_lint,{duplicated_export,{decode_c,1}}}' followed by compilation failure.
@UglyTroLL
Copy link
Author

Any thoughts on this?

@lrascao
Copy link

lrascao commented Aug 15, 2014

i think the project is stagnant, no replies for some time now
you can look into another protobuf erlang implementation here on github:
gpb, much better code quality (no pikachus)

On Friday, August 15, 2014, UglyTroLL notifications@github.com wrote:

Any thoughts on this?


Reply to this email directly or view it on GitHub
#69 (comment)
.

@seancribbs
Copy link
Contributor

We have intentionally left this repository at a stable spot. It does not implement all features, nor does it do all the implemented features correctly in all circumstances.

I (not speaking for Basho here) have intentions to do a rewrite, and a prototype is already underway, but it is not super-high on the priority list.

@lukebakken
Copy link
Contributor

@UglyTroLL - I am reviewing PRs and issues in this repository. I can't accept this PR without a test case. Please provide one if you'd like to see this PR merged. Thanks! 😄

@UglyTroLL
Copy link
Author

@lukebakken The unit test was added

@lukebakken
Copy link
Contributor

FYI, this project (erlang_protobuffs) is no longer actively maintained. Please use gpb instead. gpb has erlang_protobuffs compatibility and is actively maintained by @tomas-abrahamsson

russelldb pushed a commit that referenced this pull request Apr 23, 2018
Upgrade java protobuf version from 2.4.1 to 2.5.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants