<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 15, 2014 at 4:07 PM, Tristan Sloughter <span dir="ltr"><<a href="mailto:tristan.sloughter@gmail.com" target="_blank">tristan.sloughter@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">2 questions regarding the new runtime_dependencies option in 17.0 .app<br>
files.<br>
<br>
First, the docs leave a lot to the imagination, if we look at the new<br>
.app file for observer:<br></blockquote><div><br></div><div>The documentation is sparse (on purpose) because this is a format and data that is not really finished<br></div><div>or ready for broad usage yet. It is uesd by the OTP team to keep track of version dependencies between<br>
</div><div>applications in order to know if a certain version of an application can be installed and run together with<br></div><div>other applications on a specific system.<br><br></div><div>Note the big WARNING SIGNS,<br>
</div><div>I would not recommend that you invest a lot of time building tools that use this information if you are not prepared that it can change any time during OTP 17.x.  <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<br>
λ cat lib/observer-2.0/ebin/observer.app<br>
{application, observer,<br>
   [{description, "OBSERVER version 1"},<br>
    {vsn, "2.0"},<br>
    {modules, [....]},<br>
    {registered, []},<br>
    {applications, [kernel, stdlib]},<br>
    {env, []},<br>
    {runtime_dependencies,<br>
    ["wx-1.2","stdlib-2.0","runtime_tools-1.8.14",<br>
                                        "kernel-3.0","inets-5.10","et-1.5",<br>
                                         "erts-6.0"]}]}.<br>
<br>
How is a runtime_dependencies app different from one in the<br>
'applications' key's values? </blockquote><div>what is stated under the 'applications' key is start dependencies to other applications (they must be started before this application). <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Are they only started if they are in<br>
'applications' and if they only exist in runtime_dependencies they<br>
should simply be in the path or should they be loaded? Or is it only to<br>
specify required version? In which case... why another entry and why are<br>
there apps in runtime_dependencies that aren't listed in applications.<br></blockquote><div>the applications listed under the 'runtime_dependencies' are applications that are needed in order to run<br></div><div>
this particular application. I.e they will be called by this application. It is also specifying that a certain version or higher is needed of each application.<br></div><div>Nothing will be loaded or started because of this list.<br>
</div><div><br></div><div>Applications without processes don't need to be started but can still be called.<br><br></div><div>If you try to make a release (a .rel file) where you include observer and forget some of the other applications you will have something incomplete which is likely to fail in runtime. <br>
</div><div>Depending on if you are running in embedded or interactive mode you need the applications in the .rel file (ending up in the start script) or in the code path where they are loaded on demand.<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<br>
Next, will the OTP team work with the community on the format (I know<br>
the type is subject to change, and think that is a good thing... a tuple<br>
like {wx, ">=1.2"} would make more sense in my opinion) and the actual<br>
use of this key's values?<br></blockquote><div>Yes there is room for improvements. We have already discussed solutions like that and they might be added later on.  <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<br>
We are looking to see what to do for relx<br>
(<a href="https://github.com/erlware/relx" target="_blank">https://github.com/erlware/relx</a>) since currently the libs copied for a<br>
release that includes something like observer will not include necessary<br>
dependencies.<br>
<br>
Oh, one more thing, I don't understand what this sentence is saying, "In<br>
the case such optional dependencies exist, these are specified and<br>
documented in the corresponding "App" documentation of the specific<br>
application." (<a href="http://www.erlang.org/doc/man/app.html" target="_blank">http://www.erlang.org/doc/man/app.html</a>)<br></blockquote><div>Today the format does not allow to specify optional runtime_dependencies so these are listed under<br>
</div><div>the runtime_dependencies key but should be commented in the documentation of the application.<br><br></div><div>Example of an optional dependency is for example if application A is dependent on application B only if a certain option or configuration of application A is used.<br>
</div><div>For example SNMP can use tables stored in Mnesia and is by this optionally dependent on Mnesia since<br></div><div>SNMP can very well be used without tables stored in Mnesia and is thus not always dependent on Mnesia it depends on what the user is doing with SNMP. It would be good to have some format to express these kind of dependencies as well.  <br>
<br></div><div>Most of the runtime_dependencies we have in place are generated with xref and then manually inspected<br></div><div>and occasionally a dependency is removed because it is just a debugging or test dependency or a<br>
</div><div>dependency is added because it is a dynamic one (apply) that xref cannot find.<br><br></div><div>There are still many open questions.<br></div><div><br></div><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class=""><font color="#888888">
--<br>
  Tristan Sloughter<br>
  <a href="mailto:tristan.sloughter@gmail.com">tristan.sloughter@gmail.com</a><br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</font></span></blockquote></div><br><div>/Regards Kenneth Erlang/OTP Ericsson<br></div>
<span class=""><font color="#888888"><br></font></span><br></div></div>