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

properly support top level app erl_opts from REBAR_CONFIG os var #1889

Merged
merged 1 commit into from
Sep 21, 2018

Conversation

tsloughter
Copy link
Collaborator

Fix for #1860

When REBAR_CONFIG was set it would not effect the top level app's configuration because app_discover was rereading the top level rebar.config which ignored REBAR_CONFIG. Instead this patch has it use the existing configuration from REBAR_CONFIG.

I think it looks like more changes than it really is... The main change is to not reload the rebar.config for a top level application from disk. The related opts for a top level app are already read in and parsed into the State.

When REBAR_CONFIG was set it would not effect the top level app's
configuration because app_discover was rereading the top level
rebar.config which ignored REBAR_CONFIG. Instead this patch has
it use the existing configuration from REBAR_CONFIG.
AppInfo1 = case ec_file:real_dir_path(rebar_dir:root_dir(State)) of
AppDir ->
Opts = rebar_state:opts(State),
rebar_app_info:default(rebar_app_info:opts(AppInfo, Opts), Opts);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alright I guess this is the killer bit -- if the app's path is the same as the project root, use the pre-loaded state, otherwise consult. Am I reading this correctly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. And note that this function is only called for project apps. So it isn't like it has to do this for dependencies.

@tsloughter tsloughter merged commit 2dfba20 into erlang:master Sep 21, 2018
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