lrascao / rebar3_gpb_plugin

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

Issue with latest rebar3 #143

Open phani35 opened 3 years ago

phani35 commented 3 years ago

I am observing below issue with latest rebar3 version 3.14.4. any idea how to solve this problem?

===>    {post_hooks, [{compile,
                                  "escript build/prepend_edoc_autogenerated src/gpb_scan_old.erl        src/gpb_scan_old.xrl"},
                              {compile,"escript build/compile_descriptor"}]}.
Compiling descriptor.proto...
escript: exception error: undefined function gpb_compile:file/2
===> Hook for compile failed!
lrascao commented 3 years ago

did you find a way around this? is there a simple example that shows this behaviour?

phani35 commented 3 years ago

did you find a way around this? is there a simple example that shows this behaviour?

No. as of now I rollbacked to rebar3 3.13.0 and it is working fine there.

phani35 commented 3 years ago

Can you look into this problem, you can reproduce the problem just by running "rebar3 compile" in topdir of rebar3_gpb_plugin.

rebar3_gpb_plugin]$ rebar3 compile ===> Verifying dependencies... ===> App gpb is a checkout dependency and cannot be locked. ===> Analyzing applications... ===> Compiling gpb Compiling descriptor.proto... escript: exception error: undefined function gpb_compile:file/2 ===> Hook for compile failed!

lrascao commented 3 years ago

OTP23 with rebar 3.16.1, all good

10d [luis:~/Projects/rebar3_gpb_plugin] develop* 12s ± erl
Erlang/OTP 23 [erts-11.0.3] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [hipe] [dtrace]

Eshell V11.0.3  (abort with ^G)
1>
BREAK: (a)bort (A)bort with dump (c)ontinue (p)roc info (i)nfo
       (l)oaded (v)ersion (k)ill (D)b-tables (d)istribution
^C%                                                                                                                                                                                                                                                                                                                                                                          10d [luis:~/Projects/rebar3_gpb_plugin] develop* ± ./rebar3 --version
rebar 3.16.1 on Erlang/OTP 23 Erts 11.0.3
10d [luis:~/Projects/rebar3_gpb_plugin] develop* ± ./rebar3 compile
10d [luis:~/Projects/rebar3_gpb_plugin] develop* 130 ± rm -rf _build; ./rebar3 compile
===> Verifying dependencies...
===> Fetching gpb v4.17.1
===> Analyzing applications...
===> Compiling gpb
Compiling descriptor.proto...
Compiling gpb_descriptor.erl...
Compiling gpb_compile_descr.proto...
===> Analyzing applications...
===> Compiling rebar3_gpb_plugin
10d [luis:~/Projects/rebar3_gpb_plugin] develop* 12s ±
phani35 commented 3 years ago

Can you try the same by keeping gpb in _checkouts folder, it seems the problem persists when dependencies are managed in _checkouts folder.

If I mention gpb dependency path as below , it is not taking the defined path from rebar.config during compile stage . It is always trying to fetch from hex.pm

{deps, [ { gpb, {git, "https://github/localgitrepopath/gpb.git", {tag, "4.17.3"}}} ]}.

Thank you very much for quick response.

lrascao commented 3 years ago

are you running rebar3 upgrade gpb after changing rebar.config?

phani35 commented 3 years ago

Yes, the upgrade is run after rebar.configis changed.