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

incorrect appup file getting generated #45

Open
the-prksh opened this issue Mar 6, 2018 · 10 comments
Open

incorrect appup file getting generated #45

the-prksh opened this issue Mar 6, 2018 · 10 comments
Labels
blocked due to some external dependency

Comments

@the-prksh
Copy link

the-prksh commented Mar 6, 2018

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

@lrascao
Copy link
Owner

lrascao commented Mar 6, 2018

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?

@the-prksh
Copy link
Author

the-prksh commented Mar 6, 2018

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

@lrascao
Copy link
Owner

lrascao commented Mar 6, 2018

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

@the-prksh
Copy link
Author

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.

@lrascao
Copy link
Owner

lrascao commented Mar 6, 2018

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

@the-prksh
Copy link
Author

Is it related to this pull request : #22

@lrascao
Copy link
Owner

lrascao commented Mar 7, 2018

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

@the-prksh
Copy link
Author

the-prksh commented Mar 8, 2018

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

@the-prksh
Copy link
Author

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?

@lrascao
Copy link
Owner

lrascao commented Mar 10, 2018

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 lrascao added the blocked due to some external dependency label Oct 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked due to some external dependency
Projects
None yet
Development

No branches or pull requests

2 participants