Fix R13B03 build (Reported-by: Sergey Nartimov)

This commit is contained in:
Tuncer Ayaz 2012-07-28 19:51:57 +02:00
parent 2d62896de0
commit 636c02f0be
19 changed files with 39 additions and 40 deletions

View file

@ -1,5 +1,4 @@
-define(FAIL, rebar_utils:abort()).
-define(ABORT, rebar_utils:abort()).
-define(ABORT(Str, Args), rebar_utils:abort(Str, Args)). -define(ABORT(Str, Args), rebar_utils:abort(Str, Args)).
-define(CONSOLE(Str, Args), io:format(Str, Args)). -define(CONSOLE(Str, Args), io:format(Str, Args)).

View file

@ -90,7 +90,7 @@ compile_abnfc(Source, _Target, Config) ->
" https://github.com/nygge/abnfc~n" " https://github.com/nygge/abnfc~n"
" and install it into your erlang library dir~n" " and install it into your erlang library dir~n"
"===============================================~n~n", []), "===============================================~n~n", []),
?ABORT; ?FAIL;
true -> true ->
AbnfcOpts = abnfc_opts(Config), AbnfcOpts = abnfc_opts(Config),
SourceExt = option(source_ext, AbnfcOpts), SourceExt = option(source_ext, AbnfcOpts),
@ -103,6 +103,6 @@ compile_abnfc(Source, _Target, Config) ->
Error -> Error ->
?ERROR("Compiling grammar ~s failed:~n ~p~n", ?ERROR("Compiling grammar ~s failed:~n ~p~n",
[Source, Error]), [Source, Error]),
?ABORT ?FAIL
end end
end. end.

View file

@ -65,7 +65,7 @@ compile_asn1(Source, Target, Config) ->
ok ok
end; end;
{error, _Reason} -> {error, _Reason} ->
?ABORT ?FAIL
end. end.
asn_generated_files(AsnDir, SrcDir, IncDir) -> asn_generated_files(AsnDir, SrcDir, IncDir) ->

View file

@ -141,7 +141,7 @@ compile_each([Source | Rest], Config, CompileFn) ->
Error -> Error ->
maybe_report(Error), maybe_report(Error),
?DEBUG("Compilation failed: ~p\n", [Error]), ?DEBUG("Compilation failed: ~p\n", [Error]),
?ABORT ?FAIL
end, end,
compile_each(Rest, Config, CompileFn). compile_each(Rest, Config, CompileFn).
@ -162,7 +162,7 @@ compile_queue(Pids, Targets) ->
{fail, Error} -> {fail, Error} ->
maybe_report(Error), maybe_report(Error),
?DEBUG("Worker compilation failed: ~p\n", [Error]), ?DEBUG("Worker compilation failed: ~p\n", [Error]),
?ABORT; ?FAIL;
{compiled, Source, Warnings} -> {compiled, Source, Warnings} ->
report(Warnings), report(Warnings),
@ -184,7 +184,7 @@ compile_queue(Pids, Targets) ->
{'DOWN', _Mref, _, _Pid, Info} -> {'DOWN', _Mref, _, _Pid, Info} ->
?DEBUG("Worker failed: ~p\n", [Info]), ?DEBUG("Worker failed: ~p\n", [Info]),
?ABORT ?FAIL
end. end.
compile_worker(QueuePid, Config, CompileFn) -> compile_worker(QueuePid, Config, CompileFn) ->

View file

@ -39,10 +39,10 @@ process_commands([], ParentConfig) ->
case {get_operations(ParentConfig), AbortTrapped} of case {get_operations(ParentConfig), AbortTrapped} of
{0, _} -> {0, _} ->
%% None of the commands had any effect %% None of the commands had any effect
?ABORT; ?FAIL;
{_, true} -> {_, true} ->
%% An abort was previously trapped %% An abort was previously trapped
?ABORT; ?FAIL;
_ -> _ ->
ok ok
end; end;
@ -77,7 +77,7 @@ process_commands([Command | Rest], ParentConfig) ->
throw:rebar_abort -> throw:rebar_abort ->
case rebar_config:get_xconf(ParentConfig1, keep_going, false) of case rebar_config:get_xconf(ParentConfig1, keep_going, false) of
false -> false ->
?ABORT; ?FAIL;
true -> true ->
?WARN("Continuing on after abort: ~p\n", [Rest]), ?WARN("Continuing on after abort: ~p\n", [Rest]),
rebar_config:set_xconf(ParentConfig1, rebar_config:set_xconf(ParentConfig1,
@ -339,7 +339,7 @@ execute(Command, Modules, Config, ModuleFile, Env) ->
apply_hooks(post_hooks, NewConfig, Command, Env), apply_hooks(post_hooks, NewConfig, Command, Env),
NewConfig; NewConfig;
{error, failed} -> {error, failed} ->
?ABORT; ?FAIL;
{Module, {error, _} = Other} -> {Module, {error, _} = Other} ->
?ABORT("~p failed while processing ~s in module ~s: ~s\n", ?ABORT("~p failed while processing ~s in module ~s: ~s\n",
[Command, Dir, Module, [Command, Dir, Module,

View file

@ -83,7 +83,7 @@ clear_log(RawLog) ->
ok = file:write_file(RawLog, LogHeader); ok = file:write_file(RawLog, LogHeader);
{error, Reason} -> {error, Reason} ->
?ERROR("Could not create log dir - ~p\n", [Reason]), ?ERROR("Could not create log dir - ~p\n", [Reason]),
?ABORT ?FAIL
end. end.
%% calling ct with erl does not return non-zero on failure - have to check %% calling ct with erl does not return non-zero on failure - have to check
@ -98,12 +98,12 @@ check_log(Config, RawLog) ->
MakeFailed -> MakeFailed ->
show_log(Config, RawLog), show_log(Config, RawLog),
?ERROR("Building tests failed\n",[]), ?ERROR("Building tests failed\n",[]),
?ABORT; ?FAIL;
RunFailed -> RunFailed ->
show_log(Config, RawLog), show_log(Config, RawLog),
?ERROR("One or more tests failed\n",[]), ?ERROR("One or more tests failed\n",[]),
?ABORT; ?FAIL;
true -> true ->
?CONSOLE("DONE.\n~s\n", [Msg]) ?CONSOLE("DONE.\n~s\n", [Msg])
@ -263,7 +263,7 @@ find_suite_path(Suite, TestDir) ->
case filelib:is_regular(Path) of case filelib:is_regular(Path) of
false -> false ->
?ERROR("Suite ~s not found\n", [Suite]), ?ERROR("Suite ~s not found\n", [Suite]),
?ABORT; ?FAIL;
true -> true ->
Path Path
end. end.

View file

@ -123,7 +123,7 @@ setup_env(Config) ->
?CONSOLE("Dependency not available: " ?CONSOLE("Dependency not available: "
"~p-~s (~p)\n", [App, Vsn, Src]) "~p-~s (~p)\n", [App, Vsn, Src])
end, MissingDeps), end, MissingDeps),
?ABORT ?FAIL
end. end.
'get-deps'(Config, _) -> 'get-deps'(Config, _) ->

View file

@ -375,7 +375,7 @@ compile_mib(Source, Target, Config) ->
rebar_file_utils:mv(Hrl_filename, "include"), rebar_file_utils:mv(Hrl_filename, "include"),
ok; ok;
{error, compilation_failed} -> {error, compilation_failed} ->
?ABORT ?FAIL
end. end.
-spec compile_xrl(Source::file:filename(), Target::file:filename(), -spec compile_xrl(Source::file:filename(), Target::file:filename(),

View file

@ -120,7 +120,7 @@ compile_dtl(Source, Target, Config) ->
" http://code.google.com/p/erlydtl/~n" " http://code.google.com/p/erlydtl/~n"
" and install it into your erlang library dir~n" " and install it into your erlang library dir~n"
"===============================================~n~n", []), "===============================================~n~n", []),
?ABORT; ?FAIL;
_ -> _ ->
case needs_compile(Source, Target, Config) of case needs_compile(Source, Target, Config) of
true -> true ->
@ -146,7 +146,7 @@ do_compile(Source, Target, Config) ->
Reason -> Reason ->
?ERROR("Compiling template ~s failed:~n ~p~n", ?ERROR("Compiling template ~s failed:~n ~p~n",
[Source, Reason]), [Source, Reason]),
?ABORT ?FAIL
end. end.
module_name(Target) -> module_name(Target) ->

View file

@ -74,12 +74,12 @@ escriptize(Config0, AppFile) ->
{error, WriteError} -> {error, WriteError} ->
?ERROR("Failed to write ~p script: ~p\n", ?ERROR("Failed to write ~p script: ~p\n",
[AppName, WriteError]), [AppName, WriteError]),
?ABORT ?FAIL
end; end;
{error, ZipError} -> {error, ZipError} ->
?ERROR("Failed to construct ~p escript: ~p\n", ?ERROR("Failed to construct ~p escript: ~p\n",
[AppName, ZipError]), [AppName, ZipError]),
?ABORT ?FAIL
end, end,
%% Finally, update executable perms for our script %% Finally, update executable perms for our script

View file

@ -255,7 +255,7 @@ cover_init(true, BeamFiles) ->
[] -> [] ->
%% No modules compiled successfully...fail %% No modules compiled successfully...fail
?ERROR("Cover failed to compile any modules; aborting.~n", []), ?ERROR("Cover failed to compile any modules; aborting.~n", []),
?ABORT; ?FAIL;
_ -> _ ->
%% At least one module compiled successfully %% At least one module compiled successfully

View file

@ -108,7 +108,7 @@ delete_each([File | Rest]) ->
delete_each(Rest); delete_each(Rest);
{error, Reason} -> {error, Reason} ->
?ERROR("Failed to delete file ~s: ~p\n", [File, Reason]), ?ERROR("Failed to delete file ~s: ~p\n", [File, Reason]),
?ABORT ?FAIL
end. end.
%% =================================================================== %% ===================================================================

View file

@ -57,7 +57,7 @@ compile_lfe(Source, _Target, Config) ->
" {git, \"git://github.com/rvirding/lfe\",~n" " {git, \"git://github.com/rvirding/lfe\",~n"
" {tag, \"v0.6.1\"}}}~n" " {tag, \"v0.6.1\"}}}~n"
"~n", []), "~n", []),
?ABORT; ?FAIL;
_ -> _ ->
Opts = [{i, "include"}, {outdir, "ebin"}, return] Opts = [{i, "include"}, {outdir, "ebin"}, return]
++ rebar_config:get_list(Config, erl_opts, []), ++ rebar_config:get_list(Config, erl_opts, []),
@ -67,6 +67,6 @@ compile_lfe(Source, _Target, Config) ->
{error, Es, Ws} -> {error, Es, Ws} ->
rebar_base_compiler:error_tuple(Source, Es, Ws, Opts); rebar_base_compiler:error_tuple(Source, Es, Ws, Opts);
_ -> _ ->
?ABORT ?FAIL
end end
end. end.

View file

@ -80,7 +80,7 @@ compile_neo(Source, Target, Config) ->
" https://github.com/seancribbs/neotoma~n" " https://github.com/seancribbs/neotoma~n"
" and install it into your erlang library dir~n" " and install it into your erlang library dir~n"
"===============================================~n~n", []), "===============================================~n~n", []),
?ABORT; ?FAIL;
_ -> _ ->
case needs_compile(Source, Target, Config) of case needs_compile(Source, Target, Config) of
true -> true ->
@ -104,7 +104,7 @@ do_compile(Source, _Target, Config) ->
Reason -> Reason ->
?ERROR("Compiling peg ~s failed:~n ~p~n", ?ERROR("Compiling peg ~s failed:~n ~p~n",
[Source, Reason]), [Source, Reason]),
?ABORT ?FAIL
end. end.
needs_compile(Source, Target, Config) -> needs_compile(Source, Target, Config) ->

View file

@ -146,12 +146,12 @@ validate_name(AppName, File) ->
false -> false ->
?ERROR("Invalid ~s: name of application (~p) " ?ERROR("Invalid ~s: name of application (~p) "
"must match filename.\n", [File, AppName]), "must match filename.\n", [File, AppName]),
?ABORT ?FAIL
end. end.
validate_modules(AppName, undefined) -> validate_modules(AppName, undefined) ->
?ERROR("Missing modules declaration in ~p.app~n", [AppName]), ?ERROR("Missing modules declaration in ~p.app~n", [AppName]),
?ABORT; ?FAIL;
validate_modules(AppName, Mods) -> validate_modules(AppName, Mods) ->
%% Construct two sets -- one for the actual .beam files in ebin/ %% Construct two sets -- one for the actual .beam files in ebin/
@ -169,7 +169,7 @@ validate_modules(AppName, Mods) ->
M <- MissingBeams]), M <- MissingBeams]),
?ERROR("One or more modules listed in ~p.app are not " ?ERROR("One or more modules listed in ~p.app are not "
"present in ebin/*.beam:\n~s", [AppName, Msg1]), "present in ebin/*.beam:\n~s", [AppName, Msg1]),
?ABORT ?FAIL
end, end,
%% Identify .beam files NOT list in the .app, but present in ebin/ %% Identify .beam files NOT list in the .app, but present in ebin/
@ -181,7 +181,7 @@ validate_modules(AppName, Mods) ->
M <- MissingMods]), M <- MissingMods]),
?ERROR("One or more .beam files exist that are not " ?ERROR("One or more .beam files exist that are not "
"listed in ~p.app:\n~s", [AppName, Msg2]), "listed in ~p.app:\n~s", [AppName, Msg2]),
?ABORT ?FAIL
end. end.
ebin_modules() -> ebin_modules() ->

View file

@ -209,7 +209,7 @@ exec_compiler(Source, Cmd, ShOpts) ->
Error = re:replace(RawError, Source, AbsSource, Error = re:replace(RawError, Source, AbsSource,
[{return, list}, global]), [{return, list}, global]),
?CONSOLE("~s", [Error]), ?CONSOLE("~s", [Error]),
?ABORT; ?FAIL;
{ok, Output} -> {ok, Output} ->
?CONSOLE("Compiling ~s\n", [Source]), ?CONSOLE("Compiling ~s\n", [Source]),
?CONSOLE("~s", [Output]) ?CONSOLE("~s", [Output])

View file

@ -53,7 +53,7 @@ compile(_Config, _AppFile) ->
false -> false ->
?ERROR("Protobuffs library not present in code path!\n", ?ERROR("Protobuffs library not present in code path!\n",
[]), []),
?ABORT ?FAIL
end end
end. end.
@ -115,7 +115,7 @@ compile_each([{Proto, Beam, Hrl} | Rest]) ->
Other -> Other ->
?ERROR("Protobuff compile of ~s failed: ~p\n", ?ERROR("Protobuff compile of ~s failed: ~p\n",
[Proto, Other]), [Proto, Other]),
?ABORT ?FAIL
end; end;
false -> false ->
ok ok

View file

@ -58,10 +58,10 @@ generate(Config0, ReltoolFile) ->
ok -> ok ->
{ok, Config}; {ok, Config};
{error, failed} -> {error, failed} ->
?ABORT; ?FAIL;
Other2 -> Other2 ->
?ERROR("Unexpected error: ~p\n", [Other2]), ?ERROR("Unexpected error: ~p\n", [Other2]),
?ABORT ?FAIL
end. end.
overlay(Config, ReltoolFile) -> overlay(Config, ReltoolFile) ->
@ -238,12 +238,12 @@ mk_target_dir(Config, TargetDir) ->
_ -> _ ->
?ERROR("Release target directory ~p already exists!\n", ?ERROR("Release target directory ~p already exists!\n",
[TargetDir]), [TargetDir]),
?ABORT ?FAIL
end; end;
{error, Reason} -> {error, Reason} ->
?ERROR("Failed to make target dir ~p: ~s\n", ?ERROR("Failed to make target dir ~p: ~s\n",
[TargetDir, file:format_error(Reason)]), [TargetDir, file:format_error(Reason)]),
?ABORT ?FAIL
end. end.

View file

@ -90,7 +90,7 @@ xref(Config, _) ->
case lists:member(false, [ExportsNoWarn, UndefNoWarn, QueryNoWarn]) of case lists:member(false, [ExportsNoWarn, UndefNoWarn, QueryNoWarn]) of
true -> true ->
?ABORT; ?FAIL;
false -> false ->
ok ok
end. end.