klacke/yaws — Issue #77: rebar generate crashes when yaws built as a dep
Author: efine
Created: 2012-01-07 22:33:41+00:00
State: open

When running rebar generate on a parent project, I get a crash:

{"init terminating in do_boot","Illegal library /tmp/test_yaws_as_dep/deps/yaws/rel/../fake_lib_dir: no such file or directory"}

### Environment
CentOS 5.7 x86_64, Erlang R15B, latest rebar and yaws master as of today.

### To reproduce
I wrote a little script to reproduce the issue. It creates a dummy project that includes yaws as a dep to show the issue.

## ./create_yaws_deps_test_case.sh
``` bash
#!/bin/bash
TMP_DIR=$(mktemp -t -d rebar_build_XXXXXXXX)
APP=test_yaws_as_dep
APP_DIR="${TMP_DIR}/${APP}"

die() {
echo $* >&2; exit 1;
}

mkdir -p ${APP_DIR} || die "Cannot make ${APP_DIR}"
cd ${APP_DIR} && rebar create-app appid=${APP} && mkdir rel
[[ $(pwd) == ${APP_DIR} ]] || die "$(pwd) /= ${APP_DIR}!"
cat > rebar.config <<"END"
{lib_dirs, ["deps"]}.
{sub_dirs, ["rel"]}.

{deps, [
{'yaws', ".*", {git, "git://github.com/klacke/yaws.git", {branch, "master"}}}
]}.
END

rebar --version
rebar get-deps
cd deps/yaws > /dev/null && git describe && cd - > /dev/null
rebar compile generate
```

### Script output

[build@vsfcctpavd12 tmp]$ ./create_yaws_deps_test_case.sh
==> test_yaws_as_dep (create-app)
Writing src/test_yaws_as_dep.app.src
Writing src/test_yaws_as_dep_app.erl
Writing src/test_yaws_as_dep_sup.erl
rebar version: 2 date: 20120107_204935 vcs: git 7b95bc4
==> rel (get-deps)
==> test_yaws_as_dep (get-deps)
Pulling yaws from {git,"git://github.com/klacke/yaws.git",{branch,"master"}}
Cloning into yaws...
==> rel (get-deps)
==> yaws (get-deps)
yaws-1.92-7-g990bf47
==> rel (compile)
==> yaws (compile)
--- Installing local config file at /tmp/rebar_build_drUU8534/test_yaws_as_dep/deps/yaws/etc/yaws/yaws.conf
Compiled src/yaws_logger.erl
... snip ...
Compiling c_src/yaws_sendfile_drv.c
==> rel (compile)
==> test_yaws_as_dep (compile)
Compiled src/test_yaws_as_dep_app.erl
Compiled src/test_yaws_as_dep_sup.erl
==> rel (generate)
{"init terminating in do_boot","Illegal library /tmp/rebar_build_drUU8534/test_yaws_as_dep/deps/yaws/rel/../fake_lib_dir: no such file or directory"}

Crash dump was written to: erl_crash.dump
init terminating in do_boot (Illegal library /tmp/rebar_build_drUU8534/test_yaws_as_dep/deps/yaws/rel/../fake_lib_dir: no such file or directory)