mirror of
https://github.com/correl/rebar.git
synced 2024-11-23 19:19:54 +00:00
Fix R13B03 build (Reported-by: Sergey Nartimov)
This commit is contained in:
parent
2d62896de0
commit
636c02f0be
19 changed files with 39 additions and 40 deletions
|
@ -1,5 +1,4 @@
|
|||
|
||||
-define(ABORT, rebar_utils:abort()).
|
||||
-define(FAIL, rebar_utils:abort()).
|
||||
-define(ABORT(Str, Args), rebar_utils:abort(Str, Args)).
|
||||
|
||||
-define(CONSOLE(Str, Args), io:format(Str, Args)).
|
||||
|
|
|
@ -90,7 +90,7 @@ compile_abnfc(Source, _Target, Config) ->
|
|||
" https://github.com/nygge/abnfc~n"
|
||||
" and install it into your erlang library dir~n"
|
||||
"===============================================~n~n", []),
|
||||
?ABORT;
|
||||
?FAIL;
|
||||
true ->
|
||||
AbnfcOpts = abnfc_opts(Config),
|
||||
SourceExt = option(source_ext, AbnfcOpts),
|
||||
|
@ -103,6 +103,6 @@ compile_abnfc(Source, _Target, Config) ->
|
|||
Error ->
|
||||
?ERROR("Compiling grammar ~s failed:~n ~p~n",
|
||||
[Source, Error]),
|
||||
?ABORT
|
||||
?FAIL
|
||||
end
|
||||
end.
|
||||
|
|
|
@ -65,7 +65,7 @@ compile_asn1(Source, Target, Config) ->
|
|||
ok
|
||||
end;
|
||||
{error, _Reason} ->
|
||||
?ABORT
|
||||
?FAIL
|
||||
end.
|
||||
|
||||
asn_generated_files(AsnDir, SrcDir, IncDir) ->
|
||||
|
|
|
@ -141,7 +141,7 @@ compile_each([Source | Rest], Config, CompileFn) ->
|
|||
Error ->
|
||||
maybe_report(Error),
|
||||
?DEBUG("Compilation failed: ~p\n", [Error]),
|
||||
?ABORT
|
||||
?FAIL
|
||||
end,
|
||||
compile_each(Rest, Config, CompileFn).
|
||||
|
||||
|
@ -162,7 +162,7 @@ compile_queue(Pids, Targets) ->
|
|||
{fail, Error} ->
|
||||
maybe_report(Error),
|
||||
?DEBUG("Worker compilation failed: ~p\n", [Error]),
|
||||
?ABORT;
|
||||
?FAIL;
|
||||
|
||||
{compiled, Source, Warnings} ->
|
||||
report(Warnings),
|
||||
|
@ -184,7 +184,7 @@ compile_queue(Pids, Targets) ->
|
|||
|
||||
{'DOWN', _Mref, _, _Pid, Info} ->
|
||||
?DEBUG("Worker failed: ~p\n", [Info]),
|
||||
?ABORT
|
||||
?FAIL
|
||||
end.
|
||||
|
||||
compile_worker(QueuePid, Config, CompileFn) ->
|
||||
|
|
|
@ -39,10 +39,10 @@ process_commands([], ParentConfig) ->
|
|||
case {get_operations(ParentConfig), AbortTrapped} of
|
||||
{0, _} ->
|
||||
%% None of the commands had any effect
|
||||
?ABORT;
|
||||
?FAIL;
|
||||
{_, true} ->
|
||||
%% An abort was previously trapped
|
||||
?ABORT;
|
||||
?FAIL;
|
||||
_ ->
|
||||
ok
|
||||
end;
|
||||
|
@ -77,7 +77,7 @@ process_commands([Command | Rest], ParentConfig) ->
|
|||
throw:rebar_abort ->
|
||||
case rebar_config:get_xconf(ParentConfig1, keep_going, false) of
|
||||
false ->
|
||||
?ABORT;
|
||||
?FAIL;
|
||||
true ->
|
||||
?WARN("Continuing on after abort: ~p\n", [Rest]),
|
||||
rebar_config:set_xconf(ParentConfig1,
|
||||
|
@ -339,7 +339,7 @@ execute(Command, Modules, Config, ModuleFile, Env) ->
|
|||
apply_hooks(post_hooks, NewConfig, Command, Env),
|
||||
NewConfig;
|
||||
{error, failed} ->
|
||||
?ABORT;
|
||||
?FAIL;
|
||||
{Module, {error, _} = Other} ->
|
||||
?ABORT("~p failed while processing ~s in module ~s: ~s\n",
|
||||
[Command, Dir, Module,
|
||||
|
|
|
@ -83,7 +83,7 @@ clear_log(RawLog) ->
|
|||
ok = file:write_file(RawLog, LogHeader);
|
||||
{error, Reason} ->
|
||||
?ERROR("Could not create log dir - ~p\n", [Reason]),
|
||||
?ABORT
|
||||
?FAIL
|
||||
end.
|
||||
|
||||
%% calling ct with erl does not return non-zero on failure - have to check
|
||||
|
@ -98,12 +98,12 @@ check_log(Config, RawLog) ->
|
|||
MakeFailed ->
|
||||
show_log(Config, RawLog),
|
||||
?ERROR("Building tests failed\n",[]),
|
||||
?ABORT;
|
||||
?FAIL;
|
||||
|
||||
RunFailed ->
|
||||
show_log(Config, RawLog),
|
||||
?ERROR("One or more tests failed\n",[]),
|
||||
?ABORT;
|
||||
?FAIL;
|
||||
|
||||
true ->
|
||||
?CONSOLE("DONE.\n~s\n", [Msg])
|
||||
|
@ -263,7 +263,7 @@ find_suite_path(Suite, TestDir) ->
|
|||
case filelib:is_regular(Path) of
|
||||
false ->
|
||||
?ERROR("Suite ~s not found\n", [Suite]),
|
||||
?ABORT;
|
||||
?FAIL;
|
||||
true ->
|
||||
Path
|
||||
end.
|
||||
|
|
|
@ -123,7 +123,7 @@ setup_env(Config) ->
|
|||
?CONSOLE("Dependency not available: "
|
||||
"~p-~s (~p)\n", [App, Vsn, Src])
|
||||
end, MissingDeps),
|
||||
?ABORT
|
||||
?FAIL
|
||||
end.
|
||||
|
||||
'get-deps'(Config, _) ->
|
||||
|
|
|
@ -375,7 +375,7 @@ compile_mib(Source, Target, Config) ->
|
|||
rebar_file_utils:mv(Hrl_filename, "include"),
|
||||
ok;
|
||||
{error, compilation_failed} ->
|
||||
?ABORT
|
||||
?FAIL
|
||||
end.
|
||||
|
||||
-spec compile_xrl(Source::file:filename(), Target::file:filename(),
|
||||
|
|
|
@ -120,7 +120,7 @@ compile_dtl(Source, Target, Config) ->
|
|||
" http://code.google.com/p/erlydtl/~n"
|
||||
" and install it into your erlang library dir~n"
|
||||
"===============================================~n~n", []),
|
||||
?ABORT;
|
||||
?FAIL;
|
||||
_ ->
|
||||
case needs_compile(Source, Target, Config) of
|
||||
true ->
|
||||
|
@ -146,7 +146,7 @@ do_compile(Source, Target, Config) ->
|
|||
Reason ->
|
||||
?ERROR("Compiling template ~s failed:~n ~p~n",
|
||||
[Source, Reason]),
|
||||
?ABORT
|
||||
?FAIL
|
||||
end.
|
||||
|
||||
module_name(Target) ->
|
||||
|
|
|
@ -74,12 +74,12 @@ escriptize(Config0, AppFile) ->
|
|||
{error, WriteError} ->
|
||||
?ERROR("Failed to write ~p script: ~p\n",
|
||||
[AppName, WriteError]),
|
||||
?ABORT
|
||||
?FAIL
|
||||
end;
|
||||
{error, ZipError} ->
|
||||
?ERROR("Failed to construct ~p escript: ~p\n",
|
||||
[AppName, ZipError]),
|
||||
?ABORT
|
||||
?FAIL
|
||||
end,
|
||||
|
||||
%% Finally, update executable perms for our script
|
||||
|
|
|
@ -255,7 +255,7 @@ cover_init(true, BeamFiles) ->
|
|||
[] ->
|
||||
%% No modules compiled successfully...fail
|
||||
?ERROR("Cover failed to compile any modules; aborting.~n", []),
|
||||
?ABORT;
|
||||
?FAIL;
|
||||
_ ->
|
||||
%% At least one module compiled successfully
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ delete_each([File | Rest]) ->
|
|||
delete_each(Rest);
|
||||
{error, Reason} ->
|
||||
?ERROR("Failed to delete file ~s: ~p\n", [File, Reason]),
|
||||
?ABORT
|
||||
?FAIL
|
||||
end.
|
||||
|
||||
%% ===================================================================
|
||||
|
|
|
@ -57,7 +57,7 @@ compile_lfe(Source, _Target, Config) ->
|
|||
" {git, \"git://github.com/rvirding/lfe\",~n"
|
||||
" {tag, \"v0.6.1\"}}}~n"
|
||||
"~n", []),
|
||||
?ABORT;
|
||||
?FAIL;
|
||||
_ ->
|
||||
Opts = [{i, "include"}, {outdir, "ebin"}, return]
|
||||
++ rebar_config:get_list(Config, erl_opts, []),
|
||||
|
@ -67,6 +67,6 @@ compile_lfe(Source, _Target, Config) ->
|
|||
{error, Es, Ws} ->
|
||||
rebar_base_compiler:error_tuple(Source, Es, Ws, Opts);
|
||||
_ ->
|
||||
?ABORT
|
||||
?FAIL
|
||||
end
|
||||
end.
|
||||
|
|
|
@ -80,7 +80,7 @@ compile_neo(Source, Target, Config) ->
|
|||
" https://github.com/seancribbs/neotoma~n"
|
||||
" and install it into your erlang library dir~n"
|
||||
"===============================================~n~n", []),
|
||||
?ABORT;
|
||||
?FAIL;
|
||||
_ ->
|
||||
case needs_compile(Source, Target, Config) of
|
||||
true ->
|
||||
|
@ -104,7 +104,7 @@ do_compile(Source, _Target, Config) ->
|
|||
Reason ->
|
||||
?ERROR("Compiling peg ~s failed:~n ~p~n",
|
||||
[Source, Reason]),
|
||||
?ABORT
|
||||
?FAIL
|
||||
end.
|
||||
|
||||
needs_compile(Source, Target, Config) ->
|
||||
|
|
|
@ -146,12 +146,12 @@ validate_name(AppName, File) ->
|
|||
false ->
|
||||
?ERROR("Invalid ~s: name of application (~p) "
|
||||
"must match filename.\n", [File, AppName]),
|
||||
?ABORT
|
||||
?FAIL
|
||||
end.
|
||||
|
||||
validate_modules(AppName, undefined) ->
|
||||
?ERROR("Missing modules declaration in ~p.app~n", [AppName]),
|
||||
?ABORT;
|
||||
?FAIL;
|
||||
|
||||
validate_modules(AppName, Mods) ->
|
||||
%% Construct two sets -- one for the actual .beam files in ebin/
|
||||
|
@ -169,7 +169,7 @@ validate_modules(AppName, Mods) ->
|
|||
M <- MissingBeams]),
|
||||
?ERROR("One or more modules listed in ~p.app are not "
|
||||
"present in ebin/*.beam:\n~s", [AppName, Msg1]),
|
||||
?ABORT
|
||||
?FAIL
|
||||
end,
|
||||
|
||||
%% Identify .beam files NOT list in the .app, but present in ebin/
|
||||
|
@ -181,7 +181,7 @@ validate_modules(AppName, Mods) ->
|
|||
M <- MissingMods]),
|
||||
?ERROR("One or more .beam files exist that are not "
|
||||
"listed in ~p.app:\n~s", [AppName, Msg2]),
|
||||
?ABORT
|
||||
?FAIL
|
||||
end.
|
||||
|
||||
ebin_modules() ->
|
||||
|
|
|
@ -209,7 +209,7 @@ exec_compiler(Source, Cmd, ShOpts) ->
|
|||
Error = re:replace(RawError, Source, AbsSource,
|
||||
[{return, list}, global]),
|
||||
?CONSOLE("~s", [Error]),
|
||||
?ABORT;
|
||||
?FAIL;
|
||||
{ok, Output} ->
|
||||
?CONSOLE("Compiling ~s\n", [Source]),
|
||||
?CONSOLE("~s", [Output])
|
||||
|
|
|
@ -53,7 +53,7 @@ compile(_Config, _AppFile) ->
|
|||
false ->
|
||||
?ERROR("Protobuffs library not present in code path!\n",
|
||||
[]),
|
||||
?ABORT
|
||||
?FAIL
|
||||
end
|
||||
end.
|
||||
|
||||
|
@ -115,7 +115,7 @@ compile_each([{Proto, Beam, Hrl} | Rest]) ->
|
|||
Other ->
|
||||
?ERROR("Protobuff compile of ~s failed: ~p\n",
|
||||
[Proto, Other]),
|
||||
?ABORT
|
||||
?FAIL
|
||||
end;
|
||||
false ->
|
||||
ok
|
||||
|
|
|
@ -58,10 +58,10 @@ generate(Config0, ReltoolFile) ->
|
|||
ok ->
|
||||
{ok, Config};
|
||||
{error, failed} ->
|
||||
?ABORT;
|
||||
?FAIL;
|
||||
Other2 ->
|
||||
?ERROR("Unexpected error: ~p\n", [Other2]),
|
||||
?ABORT
|
||||
?FAIL
|
||||
end.
|
||||
|
||||
overlay(Config, ReltoolFile) ->
|
||||
|
@ -238,12 +238,12 @@ mk_target_dir(Config, TargetDir) ->
|
|||
_ ->
|
||||
?ERROR("Release target directory ~p already exists!\n",
|
||||
[TargetDir]),
|
||||
?ABORT
|
||||
?FAIL
|
||||
end;
|
||||
{error, Reason} ->
|
||||
?ERROR("Failed to make target dir ~p: ~s\n",
|
||||
[TargetDir, file:format_error(Reason)]),
|
||||
?ABORT
|
||||
?FAIL
|
||||
end.
|
||||
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ xref(Config, _) ->
|
|||
|
||||
case lists:member(false, [ExportsNoWarn, UndefNoWarn, QueryNoWarn]) of
|
||||
true ->
|
||||
?ABORT;
|
||||
?FAIL;
|
||||
false ->
|
||||
ok
|
||||
end.
|
||||
|
|
Loading…
Reference in a new issue