Skip to content

Unable to build tar with relname different to app name #2814

@leonardb

Description

@leonardb

I'm busy upgrading rebar3 from a much older version.

When building a tar with a --relname different to the application name the building of the tar fails as it's looking at the wrong path.

Config snippet

{relx, [{release, {smd, "3.1.0"},
         [{smd, "3.1.0"}, .....],
         [{overlay_vars, "rel/vars/build_date.config"},
          {overlay, [{template, "rel/files/vm.args", "releases/{{release_version}}/vm.args"},
                     {template, "rel/files/smd.config", "releases/{{release_version}}/sys.config"}]},
          {extended_start_script, true}]},

        {release, {smd_node, "3.1.0"},
         [{smd, "3.1.0"}, .....],
         [{overlay_vars, "rel/vars/build_date.config"},
          {overlay, [{template, "rel/files/vm.args", "releases/{{release_version}}/vm.args"},
                     {template, "rel/files/smd_node.config", "releases/{{release_version}}/sys.config"}]},
          {extended_start_script, true}]}
    ]}.
{profiles, [{local,
             [{relx, [{dev_mode, true}
                     , {include_erts, true}
                     , {overlay_vars, "rel/vars/local.config"} ]}]},
            {local_node,
             [{relx, [{dev_mode, true}
                     , {include_erts, true}
                     , {overlay_vars, "rel/vars/local.config"} ]}]},
            {local_core,
             [{relx, [{dev_mode, true}
                     , {include_erts, true}
                     , {overlay_vars, "rel/vars/local.config"} ]}]},
            {prod_core,
             [{relx, [{overlay_vars, "rel/vars/prod_core.config"}
                     , {include_erts, true}
                     , {include_src, false}
                     , {dev_mode, false}
                     , {debug_info, strip}
                     ]}]},
            {prod_node,
             [{relx, [{overlay_vars, "rel/vars/prod_node.config"}
                     , {include_erts, true}
                     , {include_src, false}
                     , {dev_mode, false}
                     , {debug_info, strip}
                     ]}]}
           ]}.

When running rebar3 as prod_node release -n smd_node works fine and the smd app is built and ends up at _build/prod_node/rel/smd_node

When running

leonard@captmarvel:/opt/smd$ rebar3 as prod_node tar --relname=smd_node
===> Verifying dependencies...
===> Analyzing applications...
===> Compiling smd
===> /opt/smd/_build/prod_node/rel/smd/releases/start_erl.data is missing

It appears this is due to commit 71e497146 where command_args and command_parsed_args are being removed from the state.

I can understand the reasoning, but this makes it impossible to use relname for tars where the application name and the release name do not match.

Would it make sense to not remove relname from the command args?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions