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

{mode, ...} overrides variables explicitly set in the profile #2853

Open
brigadier opened this issue Dec 23, 2023 · 0 comments
Open

{mode, ...} overrides variables explicitly set in the profile #2853

brigadier opened this issue Dec 23, 2023 · 0 comments
Labels
dependency issue resides in a rebar3 dependency

Comments

@brigadier
Copy link
Contributor

Example of the profile:

{profiles, [
    {prod, [{relx, [
                    {mode, prod},
                    {include_erts, "/path/to/erlang/26.2.1/"},
                    {sys_config, "./config/prod.config"}
    ]}]
    },
    {dev, [{relx, [{dev_mode, true},
                   {extended_start_script, true},               
                   {sys_config, "./config/dev.config"}
    ]}]
    }
]
}.

or

...
{include_erts, "/path/to/erlang"}
{mode, prod},
...

Regardless of the order of declaration and of everything else the include_erts is set to true because {mode, ...} always follows the {include_erts, ...} in the Config variable in the rlx_config:to_state/1.

This behaviour contradicts documentation

You can override options that the modes expand to by including explicit setting them. For example, if you wanted to keep the debug info in the BEAM modules you can use a configuration like:

[
  {mode, prod},
  {debug_info, keep}
]
@ferd ferd added the dependency issue resides in a rebar3 dependency label Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency issue resides in a rebar3 dependency
Projects
None yet
Development

No branches or pull requests

2 participants