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

Do not discard parameters --system_libs and --include-erts when duplicate values exist #2695

Merged
merged 1 commit into from
Apr 4, 2022

Conversation

hommeabeil
Copy link
Contributor

When merging #2503 it was not taken for account that include_erts and the other variables can be present multiple time in the RelxConfig. This can occurs when a variable is define in a profile. Following is an rebar.config file example and the result before this fix.

{relx, [{release, {tt, "0.1.0"},
         [tt,
          sasl]},

        {sys_config, "./config/sys.config"},
        {vm_args, "./config/vm.args"},
	{include_erts, false}
]}.

{profiles, [{prod, [{relx,
                     [
			{include_erts, true}
                     ]
            }]}]}.
[{mode,prod},
                     {output_dir,"/home/jbouchard/ws/erl/tt/_build/prod/rel"},
                     {overlay_vars_values,[{profile_string,"prod"}]},
                     {overlay_vars,
                         [{base_dir,"/home/jbouchard/ws/erl/tt/_build/prod"}]},
                     {overlay,[]},
                     {include_erts,"/usr/lib/er"},
                     {include_erts,true},
                     {release,{tt,"0.1.0"},[tt,sasl]},
                     {sys_config,"./config/sys.config"},
                     {vm_args,"./config/vm.args"}]

The solution propose is to replace all the occurrence before sending them to rlx_config:to_state. The reason the problem exist is because the rlx_config:to_state use list:foldl so the last occurence take preceence.

@ferd ferd changed the title fix the argument preceence fix the argument precedence Apr 4, 2022
@ferd ferd changed the title fix the argument precedence Do not discard parameters --system_libs and --include-erts when duplicate values exist Apr 4, 2022
@ferd ferd merged commit 63c98e2 into erlang:main Apr 4, 2022
@hommeabeil hommeabeil deleted the fix-args branch April 5, 2022 17:03
ferd added a commit that referenced this pull request Jun 18, 2022
New features:

- [Add --offline option and REBAR_OFFLINE environment variable](#2643)
- [Add support for project-local plugins](#2697)
- [Add eunit --test flag](#2684)

Experimental features for which we promise no backwards compatibility in
the near future:

- [Experimental vendoring provider](#2689)
  - [Support plugins in experimental vendor provider](#2702)

Other changes:

- [Support OTP 23..25 inclusively](#2706)
- [Bump Relx to 4.7.0](#2718)
  - [Use `erlexec` directly in relx helper functions](erlware/relx#902)
  - [Make rlx_util:parse_vsn parse integer versions](erlware/relx#913)
  - [fix awk script check_name() in extended_bin](erlware/relx#915)
  - [avoid crash when overlay is malformed](erlware/relx#916)
  - [keep attributes when stripping beams](erlware/relx#906)
  - [Fix {include_erts,true} in Windows releases](erlware/relx#914)
  - [ensure the erl file is writable before copying dyn_erl to it](erlware/relx#903)
  - Various tests added
- [Properly carry overlay_vars settings for files in relx](#2711)
- [Track mib compilation artifacts](#2709)
- [Attempt to find apps in git subdirs (sparse checkouts)](#2687)
- [Do not discard parameters --system_libs and --include-erts when duplicate values exist](#2695)
- [Use default `depth` parameter for SSL](#2690)
- [Fix global cache config overriding](#2683)
- [Error out on unknown templates in 'new' command](#2676)
- [Fix a typo](#2674)
- [Bump certifi to 2.9.0](#2673)
- [add a debug message in internal dependency fetching code](#2672)
- [Use SPDX id for license in template and test](#2668)
- [Use default branch for git and git_subdir resources with no revision](#2663)

Signed-off-by: Fred Hebert <mononcqc@ferd.ca>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants