Search code examples
erlangenvironment-variableschicagoboss

Setup ChicagoBoss with all deps to ERL_LIBS


I try to set up ChicagoBoss with all it's dependencies to ERL_LIBS environment variable. I got ChicagoBoss, compiled it with ./rebar get-deps && ./rebar compile, now i have ChicagoBoss in /home/user/ChicagoBoss directory and it's dependencies in /home/user/ChicagoBoss/deps directory. I want to add it to ERL_LIBS. I put to my .bashrc file following line:

export ERL_LIBS=/home/user/ChicagoBoss/:/home/user/*/deps/*/

But when i try something from ChicagoBoss dependencies, ranch application for example with:

application:start(ranch).

I got error:

{error,{"no such file or directory","ranch.app"}}

Thank you.


Solution

  • The ERL_LIBS environment variable has no notion of wildcards. When you start the erl with an argument like -pa deps/*/ebin, your shell is expanding the wildcard. You need to manually add every library path (the path to the application, not its ebin directory!) to ERL_LIBS.

    To simplify this process we can use Python:

    import glob
    print ':'.join(glob.glob('/home/user/*/deps/*/'))