1
votes

My erlang application named "myapp1" builds fine using rebar as far as I do not include another erlang application "my_other_app" under its dependencies (deps). Once I add it to my dependencies, and specify it under rebar.config, its build fails in error as such:

> rebar compile
Uncaught error in rebar_core: {'EXIT',
                               {badarg,
                                [{re,run,[0.9,".*",[{capture,none}]],[]},
                                 {rebar_deps,is_app_available,5,
                                  [{file,"src/rebar_deps.erl"},{line,418}]},
                                 {rebar_deps,find_dep_in_dir,3,
                                  [{file,"src/rebar_deps.erl"},{line,380}]},
                                 {rebar_deps,find_dep,3,
                                  [{file,"src/rebar_deps.erl"},{line,362}]},
                                 {rebar_deps,find_deps,4,
                                  [{file,"src/rebar_deps.erl"},{line,345}]},
                                 {rebar_deps,preprocess,2,
                                  [{file,"src/rebar_deps.erl"},{line,63}]},
                                 {rebar_core,acc_modules,5,
                                  [{file,"src/rebar_core.erl"},{line,492}]},
                                 {rebar_core,process_dir1,6,
                                  [{file,"src/rebar_core.erl"},{line,195}]}]}}

The rebar.config is

%%-*- mode: erlang -*-

{deps, [
          {webmachine, "1.10.*", {git, "git://github.com/basho/webmachine", "HEAD"}},
          amqp_client,
          rabbit_common,
          my_other_app
       ]
}.

The tree structure is as such:

myapp1
    -src/...
    -ebin/...
    -rebar.config
    -deps/
        -webmachine
        -mochiweb
        -my_other_app
              -src/...
              -ebin/...
              -include/...

As far as I remove the my_other_app from the rebar.config, everything works (except that the application does not function given the fact I am excluding a required depdency, but at least it compiles after I comment the code that uses that dependency.

I am trying to understand what the "is_app_available" function does in rebar, as my my_other_app is indeed an OTP application, but it is not started at the time I compile with rebar (it will be started by the myapp1 itself once some services start.

2

2 Answers

1
votes

It looks like the version for one of your applications might be an atom, 0.9, rather than the string, "0.9". The re module requires an iodata() for that argument. Try finding out which application that is and changing the atom to a string.

0
votes

Found the issue...

The dependency application had a Vsn (version) to its my_other_app.app.src file that was not a string ( numeric value instead ). This caused rebar to error. Certainly rebar could have a more friendly capture/error message...

Therefore, make sure to verify the {vsn, "1.1"} tag, so it has a string rather than decimal/numeric.

{application, my_other_app, [
    {description, "my other appapplication"},
    {vsn, "1.1"},
    {applications, [kernel, stdlib]},
    {modules, [.........etc.etc.etc......]},
    {registered, [my_other_app]},
    {mod,{ my_other_app, {true} } }
]}.