[erlang-questions] rebar and R16A was: Rebar issues

Tuncer Ayaz tuncer.ayaz@REDACTED
Thu Mar 14 22:18:04 CET 2013


On 14 Mar 2013, at 20:54, Lee Sylvester wrote:

> Thank you very much :-)
>
> Lee
>
>
> On 14 Mar 2013, at 19:43, Zsolt Czinkos <> wrote:
>
>> Hi Lee,
>>
>> I've upgraded erlang/otp from R16A to R16B and everything works
>> fine without modifying rebar.config.
>>
>> zsolt
>>
>> On Thu, Mar 14, 2013 at 4:26 PM, Zsolt Czinkos <> wrote:
>>> Hi,
>>>
>>> I've found the source of this issue.
>>>
>>> In 'rebar_escripter.erl' 'filelib:wildcard/2' fuction is used.
>>> This function cannot handle the pattern and current dir given in
>>> rebar.config. In the rebar.config (of rebar) change
>>> escript_incl_extra parameter like this:
>>>
>>> {escript_incl_extra, [{"*", "priv/templates"}]}.
>>>
>>> ( {"priv/templates/*", "."} pattern won't match. It isn't clear for me why.)
>>>
>>> Run bootsrap, and the result:
>>>
>>> $ ./rebar version
>>> rebar 2.1.0-pre R16A 20130314_145125 git 2.1.0-pre-64-g720d71e-dirty
>>> $ ./rebar list-templates
>>> ==> tmp (list-templates)
>>>  * simplesrv: simplesrv.template (escript) (variables: "srvid")
>>>  * simplenode: simplenode.template (escript) (variables: "nodeid")
>>>  * simplemod: simplemod.template (escript) (variables: "modid")
>>>  * simplefsm: simplefsm.template (escript) (variables: "fsmid")
>>>  * simpleapp: simpleapp.template (escript) (variables: "appid")
>>>  * ctsuite: ctsuite.template (escript) (variables: "testmod")
>>>  * basicnif: basicnif.template (escript) (variables: "module")
>>>
>>>
>>> Best,
>>>
>>> Zsolt

Thanks Zsolt and Lee.

R16A's filelib:wildcard has a regression[1] which was fixed in
856f165d0[2] (included in R16B).

Also, the second element in the escript_incl_extra tuple is not a
wildcard, only the first is, and the 2nd is a directory. This is used
to construct a proper dir structure in the escript archive and not put
everything in the root dir. To be clear, escript_incl_extra is rebar
internal and that's why it's not documented in rebar.config.sample or
'rebar help escriptize'. Don't be misled by its use in rebar.git's own
rebar.config.

$ rebar list-templates
==> foo_project (list-templates)
* simplesrv: priv/templates/simplesrv.template (escript) (variables: "srvid")
* simplenode: priv/templates/simplenode.template (escript) (variables: "nodeid")
* simplemod: priv/templates/simplemod.template (escript) (variables: "modid")
* simplefsm: priv/templates/simplefsm.template (escript) (variables: "fsmid")
* simpleapp: priv/templates/simpleapp.template (escript) (variables: "appid")
* ctsuite: priv/templates/ctsuite.template (escript) (variables: "testmod")
* basicnif: priv/templates/basicnif.template (escript) (variables: "module")

[1] http://erlang.org/pipermail/erlang-bugs/2013-February/003399.html
[2] https://github.com/erlang/otp/commit/856f165d0



More information about the erlang-questions mailing list