[erlang-questions] relx extended deps

Tristan Sloughter t@REDACTED
Tue Jan 27 15:33:42 CET 2015

Sorry, I don't think we'll accept this :). 

Ranch needs to depend on ssl for this to work. 

I'll also note that it isn't only relx that reserves the right to
reorder your apps, systools does as well. So even if this currently
works for you it may not for others and may break in the future.

  Tristan Sloughter

On Mon, Jan 26, 2015, at 07:15 PM, e@REDACTED wrote:
> Hi, all.
> in order to solve the ranch's problem with ssl during shutdown
> (https://github.com/ninenines/ranch/issues/90)
> I have created the following fix to relx
> (do not laugh, it is strongly related to the issue)
> http://file.bestmx.net/ee/software/relx-extended-deps/
> it is a proof-of-concept module, which solves the problem in isolation 
> of relx.
> a concatenation of multiple .app.src files (that represent a 
> hypothetical release with its deps)
> a linear sequence of applications that satisfies each and every 
> individual dep described in the given input.
> (OR crash if the given deps contain a loop.)
> this tiny module assumes one elegant extension to the .app.src syntax:
> the option 'sequence'
> adding this option to _your_ .app.src you can instruct relx to arrange 
> some of your deps to an arbitrary position in the startup sequence 
> (anywhere between deps of deps of deps).
> for example:
> {application, my_app, [
> 	{applications, [
> 		kernel,
> 		stdlib,
> 		cowboy,
> 		ssl
> 	]},
> 	{sequence, [[ssl,ranch]]}	
> ]}.
> instructs my dependency resolver to start ssl BEFORE ranch, regardless 
> any other circumstances.
> {'sequence', Sequences}
> Sequences = [ Seq ]
> Seq = [ atom() ]
> A Seq is a requirement to run some (two or more) application in the 
> given order. You may specify multiple independent Seqs.
>  From the relx's perspective sequence is not a dep, it actually reads: 
> IF the app A will be started as a dep of any other app in our deps-tree 
> THEN it should be started before the app B.
> Thus, if relx developers accept this fix, then you shall add:
> "{sequence, [[ssl,ranch]]}"
> to the ranch's .app file and the proper sequence will be ensured,
> BUT ranch will not have a redundant dependency.
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

More information about the erlang-questions mailing list