From 9ee8ed91812f22e6e84887ba006f3a5c37457fcc Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Tue, 15 Feb 2011 01:51:35 +0100 Subject: Give an absolute path to code:add_path/1 If an app uses -include_lib for its own included files, compilation fails if the app directory isn't in $ERL_LIBS because code:lib_dir/1 will return an error. An absolute path needs to be added to code path instead of just "ebin". --- src/rebar_erlc_compiler.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl index 7f02e89..df9e1c0 100644 --- a/src/rebar_erlc_compiler.erl +++ b/src/rebar_erlc_compiler.erl @@ -152,7 +152,7 @@ doterl_compile(Config, OutDir, MoreSources) -> %% Make sure that ebin/ exists and is on the path ok = filelib:ensure_dir(filename:join("ebin", "dummy.beam")), CurrPath = code:get_path(), - true = code:add_path("ebin"), + true = code:add_path(filename:absname("ebin")), rebar_base_compiler:run(Config, NewFirstErls, OtherErls, fun(S, C) -> internal_erl_compile(S, C, OutDir, ErlOpts) -- cgit v1.1