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

escriptize dependency handling is broken #1139

Closed
kaharlichenko opened this issue Mar 25, 2016 · 2 comments
Closed

escriptize dependency handling is broken #1139

kaharlichenko opened this issue Mar 25, 2016 · 2 comments
Labels
bug enhancement new behaviour or additional functionality

Comments

@kaharlichenko
Copy link

This includes two cases:

  1. the package dependencies which are not listed in {applications, ...} in app.src, but are listed in {deps, [...]} in rebar.config get included in the resulting escript even though the should not;
  2. the source dependencies which are listed in {applications, ...} in app.src don't get included in the resulting escript even though they should.

Discovered while discussing #1137.

Attaching minimal project that reproduces both cases: rebar-1139.tar.gz.

@kaharlichenko
Copy link
Author

According to @ferd

The rebar3 deps are instructions to fetch dependencies, not necessarily to represent which app depends on them.

Looks like this is not the case with escriptize:

  1. in rebar_prv_escriptize:escriptize it can be seen here that the list of all the package dependencies is passed to escript:create;
  2. all_deps fetches the package dependencies from the State here;
  3. the State is populated with the list of all the package dependencies in rebar_prv_install_deps.erl;
  4. rebar_prv_install_deps:do seems to be called before rebar_prv_escriptize:do due to plugin dependency chain: escript -> compile -> lock -> install_deps.

This way all the {deps, [...]} specified in rebar.config (be it top-level or application-level one) get unconditionally included into the final escript instead of relying on {applications, ...} property of app.src.

@ferd ferd added bug enhancement new behaviour or additional functionality labels Mar 26, 2016
@ferd
Copy link
Collaborator

ferd commented Jun 27, 2016

@madkinder please see #1249 -- it may fix your issues there.

@ferd ferd closed this as completed Jul 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug enhancement new behaviour or additional functionality
Projects
None yet
Development

No branches or pull requests

2 participants