rebar3 release add extra directories

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

rebar3 release add extra directories

Mattsson, Tommy

Hello.

I am trying to build a release using rebar3. The release is supposed to include nitrogen which has some extra directories that needs to be included. For example the dependency simple_bridge has a directory named "etc" that needs to end up in the release. 

When using reltool for creatiing the release it is possible to to add this in the a config file

{app, simple_bridge,                    [{incl_cond, include},
{mod, yaws_simple_bridge_sup, [{incl_cond, exclude}]},
{incl_app_filters, ["^include", "^priv", "^ebin", "^etc"]},
But when using rebar3 and relx I can't find any options for relx that acts in a similar way as the incl_app_filters option does for reltool.
Am I missing something or does the functionality just not exist for relx? If it doesn't exist, does anyone have an idea of if and/or when it will be added?


Best regards,

Tommy


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: rebar3 release add extra directories

Tristan Sloughter-4
Hi Tommy, there is not support for include filters per application in relx.

I don't have a good answer for how to make this work at this time besides a hack overlay that involves hard coding versions like:

{copy, "_build/default/simple_bridge/etc", "lib/simple_bridge-X.Y.Z/etc"}

We want to have feature parity with reltool but have never prioritized it as a whole, instead only adding such features as they are requested.

But I also find this to be a questionable feature since it means application authors can expect the user to have to use this feature to properly use their app in a release when they should just put the additional files in the priv directory.

Though I suppose it is possible that you'd have multiple directories under priv and want to exclude specific ones in a release, so I take it back on being questionable, but it might be best as a way to only limit what in priv is kept.

I also just took a look at what is in simple_bridge/etc and it is a .config file. Is the application loading this file at run time? How is the user expected to modify the values if that is the case? Defaults should be kept in simple_bridge.app's env list and the user building the release can override them with their own sys.config.

Tristan


On Mon, Apr 8, 2019, at 08:56, Mattsson, Tommy wrote:

Hello.

I am trying to build a release using rebar3. The release is supposed to include nitrogen which has some extra directories that needs to be included. For example the dependency simple_bridge has a directory named "etc" that needs to end up in the release. 

When using reltool for creatiing the release it is possible to to add this in the a config file

{app, simple_bridge, [{incl_cond, include},
{mod, yaws_simple_bridge_sup, [{incl_cond, exclude}]},
{incl_app_filters, ["^include", "^priv", "^ebin", "^etc"]},
But when using rebar3 and relx I can't find any options for relx that acts in a similar way as the incl_app_filters option does for reltool.
Am I missing something or does the functionality just not exist for relx? If it doesn't exist, does anyone have an idea of if and/or when it will be added?



Best regards,

Tommy

_______________________________________________
erlang-questions mailing list
http://erlang.org/mailman/listinfo/erlang-questions



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: rebar3 release add extra directories

Mattsson, Tommy

Hello Tristan,


Thanks for the reply!
I looked into overlays but it seemed to be quite tedious to do what I wanted to do. It seems that I managed to modify the third party stuff to ensure that the directories are using the priv directory instead. 


I can understand the perspective of forcing a specific structure, but maybe it isn't flexible enough for "the real world".. The project I am working on uses the correct structure, but not all projects do, so trouble arises forcing either modification of those third party projects or to not be able to use them.


Thanks for your input and pointers! Much appreciated! 😊

/Tommy


From: [hidden email] <[hidden email]> on behalf of Tristan Sloughter <[hidden email]>
Sent: Monday, April 8, 2019 5:13:17 PM
To: Erlang Questions
Subject: Re: [erlang-questions] rebar3 release add extra directories
 
Hi Tommy, there is not support for include filters per application in relx.

I don't have a good answer for how to make this work at this time besides a hack overlay that involves hard coding versions like:

{copy, "_build/default/simple_bridge/etc", "lib/simple_bridge-X.Y.Z/etc"}

We want to have feature parity with reltool but have never prioritized it as a whole, instead only adding such features as they are requested.

But I also find this to be a questionable feature since it means application authors can expect the user to have to use this feature to properly use their app in a release when they should just put the additional files in the priv directory.

Though I suppose it is possible that you'd have multiple directories under priv and want to exclude specific ones in a release, so I take it back on being questionable, but it might be best as a way to only limit what in priv is kept.

I also just took a look at what is in simple_bridge/etc and it is a .config file. Is the application loading this file at run time? How is the user expected to modify the values if that is the case? Defaults should be kept in simple_bridge.app's env list and the user building the release can override them with their own sys.config.

Tristan


On Mon, Apr 8, 2019, at 08:56, Mattsson, Tommy wrote:

Hello.

I am trying to build a release using rebar3. The release is supposed to include nitrogen which has some extra directories that needs to be included. For example the dependency simple_bridge has a directory named "etc" that needs to end up in the release. 

When using reltool for creatiing the release it is possible to to add this in the a config file

{app, simple_bridge, [{incl_cond, include},
{mod, yaws_simple_bridge_sup, [{incl_cond, exclude}]},
{incl_app_filters, ["^include", "^priv", "^ebin", "^etc"]},
But when using rebar3 and relx I can't find any options for relx that acts in a similar way as the incl_app_filters option does for reltool.
Am I missing something or does the functionality just not exist for relx? If it doesn't exist, does anyone have an idea of if and/or when it will be added?



Best regards,

Tommy

_______________________________________________
erlang-questions mailing list
http://erlang.org/mailman/listinfo/erlang-questions



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions