lrascao / rebar3_gpb_plugin

A rebar3 plugin for automatically compiling .proto files using the gpb protobuf compiler
MIT License
54 stars 37 forks source link

Issu with rebar3 and last version of gpb plugin #147

Open loudferret opened 3 years ago

loudferret commented 3 years ago

With version 2.20.2 I have problems using umbrella project and rebar.config as in example

rebar3_gpb_plugin/doc/samples/sample_release/

rebar 3.16.1 on Erlang/OTP 24 Erts 12.0.1 error:

===> Uncaught error in rebar_core. Run with DIAGNOSTIC=1 to see stacktrace or consult rebar3.crashdump
===> Uncaught error: undef

Output in rebar3.crashdump:

Error: undef
[{gpb_compile,list_io,
              ["/devel/apps/datamsgs/proto/cml.proto",
               [{i,"/devel/apps/datamsgs/proto"},
                {module_name_suffix,"_pb"},
                {o_erl,"/devel/_build/default/lib/datamsgs/src"},
                {o_hrl,"/devel/_build/default/lib/datamsgs/include"},
                {strings_as_binaries,true},
                type_specs,
                {i,"/devel/apps/datamsgs/proto"}]],
              []},
 {rebar3_gpb_compiler,get_target,2,
                      [{file,"/devel/_build/default/plugins/rebar3_gpb_plugin/src/rebar3_gpb_compiler.erl"},
                       {line,142}]},
 {rebar3_gpb_compiler,compile,4,
                      [{file,"/devel/_build/default/plugins/rebar3_gpb_plugin/src/rebar3_gpb_compiler.erl"},
                       {line,111}]},
 {lists,foreach,2,[{file,"lists.erl"},{line,1342}]},
 {rebar3_gpb_prv_compile,do,1,
                         [{file,"/devel/_build/default/plugins/rebar3_gpb_plugin/src/rebar3_gpb_prv_compile.erl"},
                          {line,47}]},
 {rebar_core,do,2,
             [{file,"/devel/rebar3/src/rebar_core.erl"},{line,155}]},
 {rebar_hooks,run_provider_hooks_,6,
              [{file,"/devel/rebar3/src/rebar_hooks.erl"},{line,70}]},
 {rebar_hooks,run_all_hooks,6,
              [{file,"/devel/rebar3/src/rebar_hooks.erl"},{line,18}]}]

using any (older) version 2.19.1, 2.20.0 and/or 2.20.1 solved the issue. I stayed with 2.20.1.

If you need any more info, let me know to investigate more. Thank you.

tsloughter commented 2 years ago

We made changes to compilation that may have broken this.

@ferd do you know a good example of a plugin that got updated from old to new that's diff can be used as a guide?

ferd commented 2 years ago

@tsloughter I would have expected that one of the newer releases would be fixed? This is an issue from a year ago. Is it still active on 3.18 or even main?

tsloughter commented 2 years ago

Oh, my bad, I am probably mixing things up. I thought all plugins had to be updated at one point, but this does look different.