diff options
-rw-r--r-- | include/relx.hrl | 4 | ||||
-rw-r--r-- | rebar.config | 2 | ||||
-rw-r--r-- | src/relx.erl | 26 | ||||
-rw-r--r-- | src/rlx_app_discovery.erl | 38 | ||||
-rw-r--r-- | src/rlx_depsolver.erl | 4 | ||||
-rw-r--r-- | src/rlx_prv_archive.erl | 8 | ||||
-rw-r--r-- | src/rlx_prv_assembler.erl | 24 | ||||
-rw-r--r-- | src/rlx_prv_discover.erl | 6 | ||||
-rw-r--r-- | src/rlx_prv_overlay.erl | 54 | ||||
-rw-r--r-- | src/rlx_prv_release.erl | 21 | ||||
-rw-r--r-- | src/rlx_prv_relup.erl | 16 | ||||
-rw-r--r-- | src/rlx_release.erl | 14 | ||||
-rw-r--r-- | src/rlx_state.erl | 1 | ||||
-rw-r--r-- | src/rlx_topo.erl | 6 |
14 files changed, 114 insertions, 110 deletions
diff --git a/include/relx.hrl b/include/relx.hrl index 3194873..cccd7bb 100644 --- a/include/relx.hrl +++ b/include/relx.hrl @@ -16,6 +16,7 @@ %% -include_lib("erlware_commons/include/ec_cmd_log.hrl"). +-include_lib("providers/include/providers.hrl"). -define(RLX_ERROR, ?EC_ERROR). -define(RLX_WARN, ?EC_WARN). @@ -26,5 +27,4 @@ %% system. It is expected that everything that returns an error use %% this and that they all expose a format_error/1 message that returns %% an iolist. --define(RLX_ERROR(Reason), - {error, {?MODULE, Reason}}). +-define(RLX_ERROR(Reason), ?PRV_ERROR(Reason)). diff --git a/rebar.config b/rebar.config index ca9894b..9c1de86 100644 --- a/rebar.config +++ b/rebar.config @@ -10,7 +10,7 @@ {branch, "master"}}}, {providers, ".*", {git, "https://github.com/tsloughter/providers.git", - {branch, "master"}}}, + {branch, "format_error"}}}, {erlydtl, ".*", {git, "https://github.com/erlydtl/erlydtl.git", {tag, "0.9.0"}}}, diff --git a/src/relx.erl b/src/relx.erl index 433e0a5..25f3220 100644 --- a/src/relx.erl +++ b/src/relx.erl @@ -26,7 +26,7 @@ do/7, do/8, do/9, - format_error/1, + format_error/2, opt_spec_list/0]). -export_type([error/0]). @@ -216,18 +216,18 @@ opt_spec_list() -> {version, undefined, "version", undefined, "Print relx version"}, {root_dir, $r, "root", string, "The project root directory"}]. --spec format_error(Reason::term()) -> string(). -format_error({invalid_return_value, Provider, Value}) -> +-spec format_error(Reason::term(), rlx_state:t()) -> string(). +format_error({invalid_return_value, Provider, Value}, _) -> io_lib:format(lists:flatten([providers:format(Provider), " returned an invalid value ", - io_lib:format("~p", [Value])]), []); -format_error({opt_parse, {invalid_option, Opt}}) -> + io_lib:format("~p", [Value])]), []); +format_error({opt_parse, {invalid_option, Opt}}, _) -> io_lib:format("invalid option ~s~n", [Opt]); -format_error({opt_parse, Arg}) -> +format_error({opt_parse, Arg}, _) -> io_lib:format("~p~n", [Arg]); -format_error({error, {relx, Reason}}) -> - format_error(Reason); -format_error({error, {Module, Reason}}) -> - io_lib:format("~s~n", [Module:format_error(Reason)]). +format_error({error, {relx, Reason}}, State) -> + format_error(Reason, State); +format_error({error, {Module, Reason}}, State) -> + io_lib:format("~s~n", [Module:format_error(Reason, State)]). %%============================================================================ %% internal api @@ -304,13 +304,13 @@ usage() -> report_error(State, Error) -> case Error of {error, {relx, {opt_parse, _}}} -> - io:format(standard_error, format_error(Error), []), + io:format(standard_error, format_error(Error, State), []), usage(); {error, {rlx_cmd_args, _}} -> - io:format(standard_error, format_error(Error), []), + io:format(standard_error, format_error(Error, State), []), usage(); _ -> - io:format(standard_error, format_error(Error), []) + io:format(standard_error, format_error(Error, State), []) end, case rlx_state:caller(State) of command_line -> diff --git a/src/rlx_app_discovery.erl b/src/rlx_app_discovery.erl index 6ac8d11..2c5714b 100644 --- a/src/rlx_app_discovery.erl +++ b/src/rlx_app_discovery.erl @@ -25,7 +25,7 @@ -module(rlx_app_discovery). -export([do/2, - format_error/1]). + format_error/2]). -include("relx.hrl"). @@ -44,10 +44,10 @@ do(State, LibDirs) -> end), resolve_app_metadata(State, LibDirs). --spec format_error([ErrorDetail::term()]) -> iolist(). -format_error(ErrorDetails) +-spec format_error([ErrorDetail::term()], rlx_state:t()) -> iolist(). +format_error(ErrorDetails, State) when erlang:is_list(ErrorDetails) -> - [[format_detail(ErrorDetail), "\n"] || ErrorDetail <- ErrorDetails]. + [[format_detail(ErrorDetail, State), "\n"] || ErrorDetail <- ErrorDetails]. %%%=================================================================== %%% Internal Functions @@ -85,10 +85,10 @@ get_app_metadata(State, LibDirs) -> {ok, _} = AppMeta -> [AppMeta|Acc]; {warning, W} -> - ec_cmd_log:warn(rlx_state:log(State), format_detail(W)), + ec_cmd_log:warn(rlx_state:log(State), format_detail(W, State)), Acc; {error, E} -> - ec_cmd_log:error(rlx_state:log(State), format_detail(E)), + ec_cmd_log:error(rlx_state:log(State), format_detail(E, State)), Acc; _ -> Acc @@ -111,7 +111,7 @@ resolve_app_metadata(State, LibDirs) -> {error, _} -> true; {warning, W} -> - ec_cmd_log:warn(rlx_state:log(State), format_detail(W)), + ec_cmd_log:warn(rlx_state:log(State), format_detail(W, State)), false; _ -> false @@ -155,30 +155,30 @@ resolve_override(AppName, FileName0) -> {ok, rlx_app_info:link(App, true)} end. --spec format_detail(ErrorDetail::term()) -> iolist(). -format_detail({missing_beam_file, Module, BeamFile}) -> +-spec format_detail(ErrorDetail::term(), rlx_state:t()) -> iolist(). +format_detail({missing_beam_file, Module, BeamFile}, _) -> io_lib:format("Missing beam file ~p ~p", [Module, BeamFile]); -format_detail({error, {invalid_override, AppName, FileName}}) -> +format_detail({error, {invalid_override, AppName, FileName}}, _) -> io_lib:format("Override {~p, ~p} is not a valid OTP App. Perhaps you forgot to build it?", [AppName, FileName]); -format_detail({accessing, File, eaccess}) -> +format_detail({accessing, File, eaccess}, _) -> io_lib:format("permission denied accessing file ~s", [File]); -format_detail({accessing, File, Type}) -> +format_detail({accessing, File, Type}, _) -> io_lib:format("error (~p) accessing file ~s", [Type, File]); -format_detail({no_beam_files, EbinDir}) -> +format_detail({no_beam_files, EbinDir}, _) -> io_lib:format("no beam files found in directory ~s", [EbinDir]); -format_detail({not_a_directory, EbinDir}) -> +format_detail({not_a_directory, EbinDir}, _) -> io_lib:format("~s is not a directory when it should be a directory", [EbinDir]); -format_detail({unable_to_load_app, AppDir, _}) -> +format_detail({unable_to_load_app, AppDir, _}, _) -> io_lib:format("Unable to load the application metadata from ~s", [AppDir]); -format_detail({invalid_app_file, File}) -> +format_detail({invalid_app_file, File}, _) -> io_lib:format("Application metadata file exists but is malformed: ~s", [File]); -format_detail({unversioned_app, AppDir, _AppName}) -> +format_detail({unversioned_app, AppDir, _AppName}, _) -> io_lib:format("Application metadata exists but version is not available: ~s", [AppDir]); -format_detail({app_info_error, {Module, Detail}}) -> - Module:format_error(Detail). +format_detail({app_info_error, {Module, Detail}}, State) -> + Module:format_error(Detail, State). -spec discover_dir([file:name()], directory | file) -> {ok, rlx_app_info:t()} | {error, Reason::term()}. diff --git a/src/rlx_depsolver.erl b/src/rlx_depsolver.erl index f9dc73d..fd26145 100644 --- a/src/rlx_depsolver.erl +++ b/src/rlx_depsolver.erl @@ -269,7 +269,7 @@ parse_version(RawVsn) erlang:is_binary(RawVsn) -> ec_semver:parse(RawVsn); parse_version(Vsn) - when erlang:is_tuple(Vsn) -> + when erlang:is_tuple(Vsn) ; erlang:is_atom(Vsn) -> Vsn. %% @doc check that a specified constraint is a valid constraint. @@ -351,6 +351,8 @@ format_culprits(Culprits) -> %% @doc A formatted version tuple -spec format_version(vsn()) -> iolist(). +format_version('NO_VSN') -> + ""; format_version(Version) -> rlx_depsolver_culprit:format_version(Version). diff --git a/src/rlx_prv_archive.erl b/src/rlx_prv_archive.erl index 8370659..261a63e 100644 --- a/src/rlx_prv_archive.erl +++ b/src/rlx_prv_archive.erl @@ -26,7 +26,7 @@ -export([init/1, do/1, - format_error/1]). + format_error/2]). -include("relx.hrl"). @@ -57,13 +57,13 @@ do(State) -> OutputDir = rlx_state:output_dir(State), make_tar(State, Release, OutputDir). -format_error({tar_unknown_generation_error, Module, Vsn}) -> +format_error({tar_unknown_generation_error, Module, Vsn}, _) -> io_lib:format("Tarball generation error of ~s ~s", [Module, Vsn]); -format_error({tar_generation_warn, Module, Warnings}) -> +format_error({tar_generation_warn, Module, Warnings}, _) -> io_lib:format("Tarball generation warnings for ~p : ~p", [Module, Warnings]); -format_error({tar_generation_error, Module, Errors}) -> +format_error({tar_generation_error, Module, Errors}, _) -> io_lib:format("Tarball generation error for ~p reason ~p", [Module, Errors]). diff --git a/src/rlx_prv_assembler.erl b/src/rlx_prv_assembler.erl index 8a25cdd..c535485 100644 --- a/src/rlx_prv_assembler.erl +++ b/src/rlx_prv_assembler.erl @@ -26,7 +26,7 @@ -export([init/1, do/1, - format_error/1]). + format_error/2]). -include("relx.hrl"). @@ -68,31 +68,31 @@ do(State) -> Error end. --spec format_error(ErrorDetail::term()) -> iolist(). -format_error({unresolved_release, RelName, RelVsn}) -> +-spec format_error(ErrorDetail::term(), rlx_state:t()) -> iolist(). +format_error({unresolved_release, RelName, RelVsn}, _) -> io_lib:format("The release has not been resolved ~p-~s", [RelName, RelVsn]); -format_error({ec_file_error, AppDir, TargetDir, E}) -> +format_error({ec_file_error, AppDir, TargetDir, E}, _) -> io_lib:format("Unable to copy OTP App from ~s to ~s due to ~p", [AppDir, TargetDir, E]); -format_error({config_does_not_exist, Path}) -> +format_error({config_does_not_exist, Path}, _) -> io_lib:format("The config file specified for this release (~s) does not exist!", [Path]); -format_error({specified_erts_does_not_exist, ErtsVersion}) -> +format_error({specified_erts_does_not_exist, ErtsVersion}, _) -> io_lib:format("Specified version of erts (~s) does not exist", [ErtsVersion]); -format_error({release_script_generation_error, RelFile}) -> +format_error({release_script_generation_error, RelFile}, _) -> io_lib:format("Unknown internal release error generating the release file to ~s", [RelFile]); -format_error({release_script_generation_warning, Module, Warnings}) -> +format_error({release_script_generation_warning, Module, Warnings}, _) -> ["Warnings generating release \s", rlx_util:indent(2), Module:format_warning(Warnings)]; -format_error({unable_to_create_output_dir, OutputDir}) -> +format_error({unable_to_create_output_dir, OutputDir}, _) -> io_lib:format("Unable to create output directory (possible permissions issue): ~s", [OutputDir]); -format_error({release_script_generation_error, Module, Errors}) -> +format_error({release_script_generation_error, Module, Errors}, State) -> ["Errors generating release \n", - rlx_util:indent(2), Module:format_error(Errors)]; -format_error({unable_to_make_symlink, AppDir, TargetDir, Reason}) -> + rlx_util:indent(2), Module:format_error(Errors, State)]; +format_error({unable_to_make_symlink, AppDir, TargetDir, Reason}, _) -> io_lib:format("Unable to symlink directory ~s to ~s because \n~s~s", [AppDir, TargetDir, rlx_util:indent(2), file:format_error(Reason)]). diff --git a/src/rlx_prv_discover.erl b/src/rlx_prv_discover.erl index 520cf15..41e3993 100644 --- a/src/rlx_prv_discover.erl +++ b/src/rlx_prv_discover.erl @@ -27,7 +27,7 @@ -export([init/1, do/1, - format_error/1]). + format_error/2]). -include("relx.hrl"). @@ -72,8 +72,8 @@ do(State0) -> %% @doc this is here to comply with the signature. However, we do not actually %% produce any errors and so simply return an empty string. --spec format_error(any()) -> iolist(). -format_error(_) -> +-spec format_error(any(), rlx_state:t()) -> iolist(). +format_error(_, _) -> "". %%%=================================================================== diff --git a/src/rlx_prv_overlay.erl b/src/rlx_prv_overlay.erl index f7e2be8..6df142b 100644 --- a/src/rlx_prv_overlay.erl +++ b/src/rlx_prv_overlay.erl @@ -26,7 +26,7 @@ -export([init/1, do/1, - format_error/1]). + format_error/2]). -define(DIRECTORY_RE, ".*(\/|\\\\)$"). @@ -66,40 +66,40 @@ do(State) -> ?RLX_ERROR({unresolved_release, RelName, RelVsn}) end. --spec format_error(ErrorDetail::term()) -> iolist(). -format_error({unresolved_release, RelName, RelVsn}) -> +-spec format_error(ErrorDetail::term(), rlx_state:t()) -> iolist(). +format_error({unresolved_release, RelName, RelVsn}, _) -> io_lib:format("The release has not been resolved ~p-~s", [RelName, RelVsn]); -format_error({ec_file_error, AppDir, TargetDir, E}) -> +format_error({ec_file_error, AppDir, TargetDir, E}, _) -> io_lib:format("Unable to copy OTP App from ~s to ~s due to ~p", [AppDir, TargetDir, E]); -format_error({unable_to_read_varsfile, FileName, Reason}) -> +format_error({unable_to_read_varsfile, FileName, Reason}, _) -> io_lib:format("Unable to read vars file (~s) for overlay due to: ~p", [FileName, Reason]); -format_error({overlay_failed, Errors}) -> - [[format_error(rlx_util:error_reason(Error)), "\n"] || Error <- Errors]; -format_error({dir_render_failed, Dir, Error}) -> +format_error({overlay_failed, Errors}, State) -> + [[format_error(rlx_util:error_reason(Error), State), "\n"] || Error <- Errors]; +format_error({dir_render_failed, Dir, Error}, _) -> io_lib:format("rendering mkdir path failed ~s with ~p", [Dir, Error]); -format_error({unable_to_make_symlink, AppDir, TargetDir, Reason}) -> +format_error({unable_to_make_symlink, AppDir, TargetDir, Reason}, _) -> io_lib:format("Unable to symlink directory ~s to ~s because \n~s~s", [AppDir, TargetDir, rlx_util:indent(2), file:format_error(Reason)]); -format_error({copy_failed, FromFile, ToFile, Err}) -> +format_error({copy_failed, FromFile, ToFile, Err}, _) -> io_lib:format("Unable to copy from ~s to ~s because of ~p", [FromFile, ToFile, Err]); -format_error({unable_to_write, ToFile, Reason}) -> +format_error({unable_to_write, ToFile, Reason}, _) -> io_lib:format("Unable to write to ~s because ~p", [ToFile, Reason]); -format_error({unable_to_enclosing_dir, ToFile, Reason}) -> +format_error({unable_to_enclosing_dir, ToFile, Reason}, _) -> io_lib:format("Unable to create enclosing directory for ~s because ~p", [ToFile, Reason]); -format_error({unable_to_render_template, FromFile, Reason}) -> +format_error({unable_to_render_template, FromFile, Reason}, _) -> io_lib:format("Unable to render template ~s because ~p", [FromFile, Reason]); -format_error({unable_to_compile_template, FromFile, Reason}) -> +format_error({unable_to_compile_template, FromFile, Reason}, State) -> io_lib:format("Unable to compile template ~s because \n~s", - [FromFile, [format_errors(F, Es) || {F, Es} <- Reason]]); -format_error({unable_to_make_dir, Absolute, Error}) -> + [FromFile, [format_errors(F, Es, State) || {F, Es} <- Reason]]); +format_error({unable_to_make_dir, Absolute, Error}, _) -> io_lib:format("Unable to make directory ~s because ~p", [Absolute, Error]). @@ -107,22 +107,22 @@ format_error({unable_to_make_dir, Absolute, Error}) -> %%% Internal Functions %%%=================================================================== -format_errors(File, [{none, Mod, E}|Es]) -> +format_errors(File, [{none, Mod, E}|Es], State) -> [io_lib:format("~s~s: ~ts~n", [rlx_util:indent(2), File, - Mod:format_error(E)]) - |format_errors(File, Es)]; -format_errors(File, [{{Line, Col}, Mod, E}|Es]) -> + Mod:format_error(E, State)]) + |format_errors(File, Es, State)]; +format_errors(File, [{{Line, Col}, Mod, E}|Es], State) -> [io_lib:format("~s~s:~w:~w: ~ts~n", [rlx_util:indent(2), File, Line, Col, - Mod:format_error(E)]) - |format_errors(File, Es)]; -format_errors(File, [{Line, Mod, E}|Es]) -> + Mod:format_error(E, State)]) + |format_errors(File, Es, State)]; +format_errors(File, [{Line, Mod, E}|Es], State) -> [io_lib:format("~s~s:~w: ~ts~n", [rlx_util:indent(2), File, Line, - Mod:format_error(E)]) - |format_errors(File, Es)]; -format_errors(_, []) -> []. + Mod:format_error(E, State)]) + |format_errors(File, Es, State)]; +format_errors(_, [], _State) -> []. -spec generate_overlay_vars(rlx_state:t(), rlx_release:t()) -> @@ -168,7 +168,7 @@ merge_overlay_vars(State, FileNames) -> lists:ukeymerge(1, lists:ukeysort(1, Terms), Acc); {error, Reason} -> ec_cmd_log:warn(rlx_state:log(State), - format_error({unable_to_read_varsfile, FileName, Reason})), + format_error({unable_to_read_varsfile, FileName, Reason}, State)), Acc end end, [], FileNames). diff --git a/src/rlx_prv_release.erl b/src/rlx_prv_release.erl index d579291..bd5acc4 100644 --- a/src/rlx_prv_release.erl +++ b/src/rlx_prv_release.erl @@ -28,7 +28,7 @@ -export([init/1, do/1, - format_error/1]). + format_error/2]). -include("relx.hrl"). @@ -58,26 +58,27 @@ do(State) -> DepGraph = create_dep_graph(State), find_default_release(State, DepGraph). --spec format_error(ErrorDetail::term()) -> iolist(). -format_error(no_goals_specified) -> +-spec format_error(ErrorDetail::term(), rlx_state:t()) -> iolist(). +format_error(no_goals_specified, _) -> "No goals specified for this release ~n"; -format_error({no_release_name, Vsn}) -> +format_error({no_release_name, Vsn}, _) -> io_lib:format("A target release version was specified (~s) but no name", [Vsn]); -format_error({invalid_release_info, Info}) -> +format_error({invalid_release_info, Info}, _) -> io_lib:format("Target release information is in an invalid format ~p", [Info]); -format_error({multiple_release_names, RelA, RelB}) -> +format_error({multiple_release_names, RelA, RelB}, _) -> io_lib:format("No default release name was specified and there are multiple " "releases in the config: ~s, ~s", [RelA, RelB]); -format_error(no_releases_in_system) -> +format_error(no_releases_in_system, _) -> "No releases have been specified in the system!"; -format_error({no_releases_for, RelName}) -> +format_error({no_releases_for, RelName}, _) -> io_lib:format("No releases exist in the system for ~s!", [RelName]); -format_error({release_not_found, {RelName, RelVsn}}) -> +format_error({release_not_found, {RelName, RelVsn}}, _) -> io_lib:format("No releases exist in the system for ~p:~s!", [RelName, RelVsn]); -format_error({failed_solve, Error}) -> +format_error({failed_solve, Error}, _) -> io_lib:format("Failed to solve release:\n ~s", [rlx_depsolver:format_error({error, Error})]). + %%%=================================================================== %%% Internal Functions %%%=================================================================== diff --git a/src/rlx_prv_relup.erl b/src/rlx_prv_relup.erl index bc86304..df6f831 100644 --- a/src/rlx_prv_relup.erl +++ b/src/rlx_prv_relup.erl @@ -26,7 +26,7 @@ -export([init/1, do/1, - format_error/1]). + format_error/2]). -include("relx.hrl"). @@ -55,24 +55,24 @@ do(State) -> Release0 = rlx_state:get_realized_release(State, RelName, RelVsn), make_relup(State, Release0). -format_error({relup_generation_error, CurrentName, UpFromName}) -> +format_error({relup_generation_error, CurrentName, UpFromName}, _) -> io_lib:format("Unknown internal release error generating the relup from ~s to ~s", [UpFromName, CurrentName]); -format_error({relup_generation_warning, Module, Warnings}) -> +format_error({relup_generation_warning, Module, Warnings}, _) -> ["Warnings generating relup \s", rlx_util:indent(2), Module:format_warning(Warnings)]; -format_error({no_upfrom_release_found, undefined}) -> +format_error({no_upfrom_release_found, undefined}, _) -> io_lib:format("No earlier release for relup found", []); -format_error({no_upfrom_release_found, Vsn}) -> +format_error({no_upfrom_release_found, Vsn}, _) -> io_lib:format("Upfrom release version (~s) for relup not found", [Vsn]); format_error({relup_script_generation_error, {relup_script_generation_error, systools_relup, - {missing_sasl, _}}}) -> + {missing_sasl, _}}}, _) -> "Unfortunately, due to requirements in systools, you need to have the sasl application " "in both the current release and the release to upgrade from."; -format_error({relup_script_generation_error, Module, Errors}) -> +format_error({relup_script_generation_error, Module, Errors}, State) -> ["Errors generating relup \n", - rlx_util:indent(2), Module:format_error(Errors)]. + rlx_util:indent(2), Module:format_error(Errors, State)]. make_relup(State, Release) -> Vsn = rlx_state:upfrom(State), diff --git a/src/rlx_release.erl b/src/rlx_release.erl index 1d333bf..7b82119 100644 --- a/src/rlx_release.erl +++ b/src/rlx_release.erl @@ -41,7 +41,7 @@ canonical_name/1, format/1, format/2, - format_error/1]). + format_error/2]). -export_type([t/0, name/0, @@ -217,14 +217,14 @@ format_goal({Constraint, AppType, AppInc}) -> format_goal(Constraint) -> rlx_depsolver:format_constraint(Constraint). --spec format_error(Reason::term()) -> iolist(). -format_error({topo_error, E}) -> - rlx_topo:format_error(E); -format_error({failed_to_parse, Con}) -> +-spec format_error(Reason::term(), rlx_state:t()) -> iolist(). +format_error({topo_error, E}, State) -> + rlx_topo:format_error(E, State); +format_error({failed_to_parse, Con}, _) -> io_lib:format("Failed to parse constraint ~p", [Con]); -format_error({invalid_constraint, _, Con}) -> +format_error({invalid_constraint, _, Con}, _) -> io_lib:format("Invalid constraint specified ~p", [Con]); -format_error({not_realized, Name, Vsn}) -> +format_error({not_realized, Name, Vsn}, _) -> io_lib:format("Unable to produce metadata release: ~p-~s has not been realized", [Name, Vsn]). diff --git a/src/rlx_state.erl b/src/rlx_state.erl index a25c60f..550a44a 100644 --- a/src/rlx_state.erl +++ b/src/rlx_state.erl @@ -126,6 +126,7 @@ %%============================================================================ %% API %%============================================================================ + -spec new(string(), undefined | [atom()]) -> t() | relx:error(). new(Config, Targets) -> new(Config, [], Targets). diff --git a/src/rlx_topo.erl b/src/rlx_topo.erl index d24f227..1d5de7e 100644 --- a/src/rlx_topo.erl +++ b/src/rlx_topo.erl @@ -34,7 +34,7 @@ -export([sort/1, sort_apps/1, - format_error/1]). + format_error/2]). -include("relx.hrl"). @@ -72,8 +72,8 @@ sort(Pairs) -> iterate(Pairs, [], all(Pairs)). %% @doc nicely format the error from the sort. --spec format_error(Reason::term()) -> iolist(). -format_error({cycle, Pairs}) -> +-spec format_error(Reason::term(), rlx_state:t()) -> iolist(). +format_error({cycle, Pairs}, _) -> ["Cycle detected in dependency graph, this must be resolved " "before we can continue:\n", case Pairs of |