rebar3_appup_plugin icon indicating copy to clipboard operation
rebar3_appup_plugin copied to clipboard

incorrect appup file getting generated

Open the-prksh opened this issue 6 years ago • 10 comments

I'm generating appup file for my svn hosted project. I have two branches names rel_v0_1_0 and rel_v0_2_0. Both are identical except application version I have changed. Here is output of svn diff :

user@TH1574U:~/svn/erl_experiment/branches/rel_v0_2_0$ svn diff -r18 Index: lib/erl_experiment/src/erl_experiment.app.src =================================================================== --- lib/erl_experiment/src/erl_experiment.app.src (.../rel_v0_1_0) (revision 18) +++ lib/erl_experiment/src/erl_experiment.app.src (.../rel_v0_2_0) (working copy) @@ -1,6 +1,6 @@ {application, erl_experiment, [{description, "An OTP application"},

  • {vsn, "0.1.0"},
  • {vsn, "0.2.0"}, {registered, []}, {mod, { erl_experiment_app, []}}, {applications, Index: rebar.config =================================================================== --- rebar.config (.../rel_v0_1_0) (revision 18) +++ rebar.config (.../rel_v0_2_0) (working copy) @@ -5,7 +5,7 @@ { base_dir, "../_build"}. { out_dir, "../_build/default/lib/"}.

-{relx, [{release, {erl_experiment, "0.1.0"}, [ erl_experiment, kernel, stdlib, sasl ]}, +{relx, [{release, {erl_experiment, "0.2.0"}, [ erl_experiment, kernel, stdlib, sasl ]},

{dev_mode, false}, {include_erts, true},

To Generate appup file, I'm doing : [in branch rel_v0_1_0 ]

user@TH1574U:~/svn/erl_experiment/branches/rel_v0_1_0$ ./rebar3 release
user@TH1574U:~/svn/erl_experiment/branches/rel_v0_1_0$ ./rebar3 tar

[in branch rel_v0_2_0 ]

user@TH1574U:~/svn/erl_experiment/branches/rel_v0_2_0$ ./rebar3 release
user@TH1574U:~/svn/erl_experiment/branches/rel_v0_2_0$ ./rebar3 appup generate --previous_version 0.1.0 --previous /home/user/svn/erl_experiment/branches/_build/default/rel/erl_experiment/

Appup file is getting generated successfully and here it is, (unfortunately its wrong.)

%% appup generated for erl_experiment by rebar3_appup_plugin (2018/03/06 17:02:57)
{ "0.2.0",
    [{ "0.1.0",
        [{load_module,erl_experiment_app,brutal_purge,brutal_purge,
                      [erl_experiment_sup]},
         {update,erl_experiment_sup,supervisor},
         {update,mynew_server,{advanced,[]},brutal_purge,brutal_purge,[]}] }],
    [{ "0.1.0",
        [{update,mynew_server,{advanced,[]},brutal_purge,brutal_purge,[]},
         {update,erl_experiment_sup,supervisor},
         {load_module,erl_experiment_app,brutal_purge,brutal_purge,
                      [erl_experiment_sup]}] }]
}.

The appup file shows changes in mynew_server module. But that module is not modified.

Can anyone clerify why ?

SVN Repo : erl_experiment Log : appup_generate.log

the-prksh avatar Mar 06 '18 11:03 the-prksh

for some reason beam_lib is seeing all beam files as changed from one version to the other, can you check the output dir of both versions?

lrascao avatar Mar 06 '18 11:03 lrascao

Output Directory is common for both versions. What you want me to check exactly?

the-prksh avatar Mar 06 '18 11:03 the-prksh

what are the svn commands you issue to switch between branches?

lrascao avatar Mar 06 '18 12:03 lrascao

SVN does not have remote and local copy structure..... so all the branches we have would be inside 'branches' directory under project. So it is just change directory... cd we use generally.

the-prksh avatar Mar 06 '18 12:03 the-prksh

the abstract code chunk of any one of those beams is different between versions, still trying to figure out why though

lrascao avatar Mar 06 '18 23:03 lrascao

Is it related to this pull request : https://github.com/lrascao/rebar3_appup_plugin/pull/22

the-prksh avatar Mar 07 '18 12:03 the-prksh

i don't think so, i'm not seeing the encrypt_debug_info erl opt anywhere in your test project

lrascao avatar Mar 07 '18 12:03 lrascao

No, it's not there. I'm just guessing. Have you found any solution Or reason for such behavior?

the-prksh avatar Mar 08 '18 04:03 the-prksh

In OTP-20 new chunks has been introduced. "AtU8" and "Dbgi". Digging further with this issue I found that "Dbgi" chunk is different in both versions of mynew_server.beam file.

Do you that what exactly "Dbgi" chunk contains? Is it feasible to ignore it?

the-prksh avatar Mar 09 '18 05:03 the-prksh

Looks like the reason is the inclusion of the source filename as an attribute of the "Abst" chunk, i guess the only way out of this is not to rely on beam_lib, either that or request a change to OTP so it doesn't take the file attribute into account when performing the comparison.

5> {ok, {_, [{abstract_code, AbstractCodeV1}]}} = beam_lib:chunks("_build/default/rel/erl_experiment/lib/erl_experiment-0.1.0/ebin/erl_experiment_app.beam", [abstract_code]).
{ok,{erl_experiment_app,[{abstract_code,{raw_abstract_v1,[{attribute,1,
                                                                     file,
                                                                     {"/Users/luis.rascao/Projects/erl_experiment/branches/rel_v0_1_0/../_build/default/lib/erl_experiment/src/erl_experiment_app.erl"

6> {ok, {_, [{abstract_code, AbstractCodeV2}]}} = beam_lib:chunks("_build/default/rel/erl_experiment/lib/erl_experiment-0.2.0/ebin/erl_experiment_app.beam", [abstract_code]).
{ok,{erl_experiment_app,[{abstract_code,{raw_abstract_v1,[{attribute,1,
                                                                     file,
                                                                     {"/Users/luis.rascao/Projects/erl_experiment/branches/rel_v0_2_0/../_build/default/lib/erl_experiment/src/erl_exp
eriment_app.erl",

lrascao avatar Mar 10 '18 23:03 lrascao