rebar3_appup_plugin
rebar3_appup_plugin copied to clipboard
badmatch error when calling rebar3 appup generate
I'm not able to call appup generate and to upgrade a release.
Steps to reproduce: erlang/otp: 27.0.1 rebar3 version: 3.23.0 rebar3_appup_plugin version: 2.4.6
- Create a project.
rebar3 new release mytest
- Add rebar3_appup_plguin and provider_hooks to rebar.config
{plugins, [rebar3_appup_plugin]}.
{provider_hooks, [
{pre, [
{tar, {appup, tar}}
]},
{post, [
{compile, {appup, compile}},
{clean, {appup, clean}}
]}
]}.
- Generate first release.
rebar3 as prod release
- Change release in rebar.config and vsn in app.src to
0.2.0 - Create second release and upgrade.
rebar3 as prod release
rebar3 as prod appup generate
rebar3 as prod relup
rebar3 as prod tar
When running rebar3 as prod appup generate I'm getting this error:
Error: {badmatch,
{'EXIT',
{{badmatch,
{ok,{mytest_app,[{abstract_code,no_abstract_code}]}}},
[{rebar3_appup_generate,read_file,1,
[{file,
"/home/me/temp/test/mytest/_build/default/plugins/rebar3_appup_plugin/src/rebar3_appup_generate.erl"},
{line,1028}]},
{rebar3_appup_generate,cmp_files,2,
[{file,
"/home/me/temp/test/mytest/_build/default/plugins/rebar3_appup_plugin/src/rebar3_appup_generate.erl"},
{line,1020}]},
{rebar3_appup_generate,compare_files,3,
[{file,
"/home/me/temp/test/mytest/_build/default/plugins/rebar3_appup_plugin/src/rebar3_appup_generate.erl"},
{line,1007}]},
{rebar3_appup_generate,compare_dirs,2,
[{file,
"/home/me/temp/test/mytest/_build/default/plugins/rebar3_appup_plugin/src/rebar3_appup_generate.erl"},
{line,977}]},
{rebar3_appup_generate,cmp_dirs,2,
[{file,
"/home/me/temp/test/mytest/_build/default/plugins/rebar3_appup_plugin/src/rebar3_appup_generate.erl"},
{line,960}]},
{rebar3_appup_generate,generate_appup_files,6,
[{file,
"/home/me/temp/test/mytest/_build/default/plugins/rebar3_appup_plugin/src/rebar3_appup_generate.erl"},
{line,315}]},
{lists,foreach_1,2,[{file,"lists.erl"},{line,2310}]},
{rebar3_appup_generate,do,1,
[{file,
"/home/me/temp/test/mytest/_build/default/plugins/rebar3_appup_plugin/src/rebar3_appup_generate.erl"},
{line,162}]}]}}}
[{rebar3_appup_generate,generate_appup_files,6,
[{file,"/home/me/temp/test/mytest/_build/default/plugins/rebar3_appup_plugin/src/rebar3_appup_generate.erl"},
{line,315}]},
{lists,foreach_1,2,[{file,"lists.erl"},{line,2310}]},
{rebar3_appup_generate,do,1,
[{file,"/home/me/temp/test/mytest/_build/default/plugins/rebar3_appup_plugin/src/rebar3_appup_generate.erl"},
{line,162}]},
{rebar_core,do,2,
[{file,"/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_core.erl"},
{line,155}]},
{rebar_prv_do,do_task,5,
[{file,"/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_prv_do.erl"},
{line,87}]},
{rebar_core,do,2,
[{file,"/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_core.erl"},
{line,155}]},
{rebar_prv_do,do_task,5,
[{file,"/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_prv_do.erl"},
{line,87}]},
{rebar_core,do,2,
[{file,"/home/runner/work/rebar3/rebar3/apps/rebar/src/rebar_core.erl"},
{line,155}]}]
I get the same error. The code that is crashing is the first line of this function:
read_file(File) ->
{ok,{_,[{abstract_code,{_,AC}}]}} = beam_lib:chunks(File,[abstract_code]),
filter_ac(AC).
read_file is expecting {abstract_code,{_,AC}} but what is returned is {abstract_code,no_abstract_code}
I am on ubuntu noble using rebar 3.19.0 on Erlang/OTP 25 Erts 13.2.2.5 and rebar3_appup_plugin (2.4.6)
should be a simple fix then i imagine, looking forward to reviewing those PRs