- 
                Notifications
    
You must be signed in to change notification settings  - Fork 3.5k
 
Description
Environment
- Elixir & Erlang/OTP versions (elixir --version): Elixir 1.10.0-dev (2a3a38e)
 - Operating system: *
 
Current behavior
Adding an application's dependency to the included_applications list raises an error when calling mix release.
** (Mix) :{dependency} is listed both as a regular application and as an included application
Expected behavior
Adding applications to included_applications should not raise an error when building the release.
Here is a sample project to use for reference: https://github.com/fhunleth/included_apps_release_question
In this example, a depends on b and c, but the application a wants b and c to be loaded, but not started. Therefore, b and c are added to the included_applications list of a.
If we were to compile a and call mix run we can see that b and c are loaded, but not started.
iex(1)> Application.loaded_applications
[
  {:mix, 'mix', '1.10.0-dev'},
  {:a, 'a', '0.1.0'},
  {:c, 'c', '0.1.0'},
  {:compiler, 'ERTS  CXC 138 10', '7.4.9'},
  {:b, 'b', '0.1.0'},
  {:kernel, 'ERTS  CXC 138 10', '6.5'},
  {:elixir, 'elixir', '1.10.0-dev'},
  {:logger, 'logger', '1.10.0-dev'},
  {:stdlib, 'ERTS  CXC 138 10', '3.10'},
  {:iex, 'iex', '1.10.0-dev'}
]
iex(2)> Application.started_applications
[
  {:a, 'a', '0.1.0'},
  {:logger, 'logger', '1.10.0-dev'},
  {:mix, 'mix', '1.10.0-dev'},
  {:iex, 'iex', '1.10.0-dev'},
  {:elixir, 'elixir', '1.10.0-dev'},
  {:compiler, 'ERTS  CXC 138 10', '7.4.9'},
  {:stdlib, 'ERTS  CXC 138 10', '3.10'},
  {:kernel, 'ERTS  CXC 138 10', '6.5'}
]This would be the behavior that I expect from the release runtime. I've commented out this check and always called the put_in and it worked as expected. The question is why the choice was made to raise on this case?