Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

rebar generate crashes when yaws built as a dep #77

Closed
efine opened this Issue Jan 7, 2012 · 2 comments

Comments

Projects
None yet
2 participants

efine commented Jan 7, 2012

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

#!/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)

efine commented Jan 7, 2012

It looks as if the Yaws rebar plugin, rebar_reltool_link, is not being found (I ran rebar -v generate on the test base project):

DEBUG: Entering /tmp/rebar_build_cKnl9191/test_yaws_as_dep/deps/yaws
DEBUG: Consult config file "/tmp/rebar_build_cKnl9191/test_yaws_as_dep/deps/yaws/rebar.config"
DEBUG: Available deps: []
DEBUG: Missing deps  : []
WARN:  Missing plugins: [rebar_reltool_link]
DEBUG: Predirs: ["/tmp/rebar_build_cKnl9191/test_yaws_as_dep/deps/yaws/rel"]
DEBUG: Entering /tmp/rebar_build_cKnl9191/test_yaws_as_dep/deps/yaws/rel
DEBUG: Consult config file "/tmp/rebar_build_cKnl9191/test_yaws_as_dep/deps/yaws/rel/rebar.config"
DEBUG: Available deps: []
DEBUG: Missing deps  : []
WARN:  Missing plugins: [rebar_reltool_link]
DEBUG: Predirs: []
==> rel (generate)
INFO:  sh info:
    cwd: "/tmp/rebar_build_cKnl9191/test_yaws_as_dep/deps/yaws/rel"
    cmd: sed -ne '1,/^YAWS_VSN=/s/^YAWS_VSN=//p' ../vsn.mk 2>/dev/null
    opts: [{cd,"/tmp/rebar_build_cKnl9191/test_yaws_as_dep/deps/yaws/rel"},
               {use_stdout,false}]
DEBUG: vcs_vsn: Unknown VCS atom in vsn field: []

efine commented Jan 7, 2012

Here is a solution to this issue, but I am not sure if it has other side-effects:

mkdir plugins
mv rebar_reltool_link.erl plugins/

@efine efine pushed a commit to efine/yaws that referenced this issue Jan 7, 2012

Edwin Fine Fixes issue #77, plugin not found when Yaws is a dep c99e536

@klacke klacke closed this Jan 17, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment