<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div>Right, relx generated shell scripts start the release in embedded mode, so we'll need to either lay the burden on the user to list deps of apps like observer or use runtime_dependencies. This isn't an issue with library deps listed in applications since they don't have starts.<br></div>
<div> </div>
<div>So having runtime_dependencies that aren't library apps but you can list as deps and know they will only be in the path (or loaded in the case of our relx generated releases that are run in embedded mode) is useful.<br></div>
<div> </div>
<div>This is something that can be useful, which is why I hope it is open to use cases and feedback outside of the OTP team's use.<br></div>
<div> </div>
<div id="sig19305637"><div class="signature">-- <br></div>
<div class="signature"> Tristan Sloughter<br></div>
<div class="signature"> tristan.sloughter@gmail.com<br></div>
<div class="signature"> </div>
</div>
<div> </div>
<div> </div>
<div>On Tue, Apr 15, 2014, at 08:23 AM, Kenneth Lundin wrote:<br></div>
<blockquote type="cite"><div dir="ltr"><div> </div>
<div><div> </div>
<div> </div>
<div><div>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></div>
<div> </div>
<blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>2 questions regarding the new runtime_dependencies option in 17.0 .app<br></div>
<div>
files.<br></div>
<div> </div>
<div>
First, the docs leave a lot to the imagination, if we look at the new<br></div>
<div>
.app file for observer:<br></div>
</blockquote><div> </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></div>
<div> </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 style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div> </div>
<div>
λ cat lib/observer-2.0/ebin/observer.app<br></div>
<div>
{application, observer,<br></div>
<div>
[{description, "OBSERVER version 1"},<br></div>
<div>
{vsn, "2.0"},<br></div>
<div>
{modules, [....]},<br></div>
<div>
{registered, []},<br></div>
<div>
{applications, [kernel, stdlib]},<br></div>
<div>
{env, []},<br></div>
<div>
{runtime_dependencies,<br></div>
<div>
["wx-1.2","stdlib-2.0","runtime_tools-1.8.14",<br></div>
<div>
"kernel-3.0","inets-5.10","et-1.5",<br></div>
<div>
"erts-6.0"]}]}.<br></div>
<div> </div>
<div>
How is a runtime_dependencies app different from one in the<br></div>
<div>
'applications' key's values? <br></div>
</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 style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
Are they only started if they are in<br></div>
<div>
'applications' and if they only exist in runtime_dependencies they<br></div>
<div>
should simply be in the path or should they be loaded? Or is it only to<br></div>
<div>
specify required version? In which case... why another entry and why are<br></div>
<div>
there apps in runtime_dependencies that aren't listed in applications.<br></div>
</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> </div>
<div>Applications without processes don't need to be started but can still be called.<br></div>
<div> </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 style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div> </div>
<div>
Next, will the OTP team work with the community on the format (I know<br></div>
<div>
the type is subject to change, and think that is a good thing... a tuple<br></div>
<div>
like {wx, ">=1.2"} would make more sense in my opinion) and the actual<br></div>
<div>
use of this key's values?<br></div>
</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 style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div> </div>
<div>
We are looking to see what to do for relx<br></div>
<div>
(<a href="https://github.com/erlware/relx" target="_blank">https://github.com/erlware/relx</a>) since currently the libs copied for a<br></div>
<div>
release that includes something like observer will not include necessary<br></div>
<div>
dependencies.<br></div>
<div> </div>
<div>
Oh, one more thing, I don't understand what this sentence is saying, "In<br></div>
<div>
the case such optional dependencies exist, these are specified and<br></div>
<div>
documented in the corresponding "App" documentation of the specific<br></div>
<div>
application." (<a href="http://www.erlang.org/doc/man/app.html" target="_blank">http://www.erlang.org/doc/man/app.html</a>)<br></div>
</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></div>
<div> </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></div>
<div> </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></div>
<div> </div>
<div>There are still many open questions.<br></div>
<div> </div>
<div> </div>
<blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
<span class=""><span style="color:rgb(136, 136, 136)" class="colour">
--</span></span><br></div>
<div><span class=""><span style="color:rgb(136, 136, 136)" class="colour">
Tristan Sloughter</span></span><br></div>
<div><span class=""><span style="color:rgb(136, 136, 136)" class="colour">
<a href="mailto:tristan.sloughter@gmail.com">tristan.sloughter@gmail.com</a></span></span><br></div>
<div><span class=""><span style="color:rgb(136, 136, 136)" class="colour">
_______________________________________________</span></span><br></div>
<div><span class=""><span style="color:rgb(136, 136, 136)" class="colour">
erlang-questions mailing list</span></span><br></div>
<div><span class=""><span style="color:rgb(136, 136, 136)" class="colour">
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a></span></span><br></div>
<div><span class=""><span style="color:rgb(136, 136, 136)" class="colour">
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</span></span></div>
</blockquote></div>
<div> </div>
<div>/Regards Kenneth Erlang/OTP Ericsson<br></div>
<div> </div>
<div> </div>
</div>
</div>
</blockquote></body>
</html>