summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2014-12-06 23:18:35 +0000
committerFred Hebert <mononcqc@ferd.ca>2014-12-06 23:18:35 +0000
commit63003c3986ca20e2f733e79453315fa0b7076bd9 (patch)
tree861c4fa2ee74936a5360a09e22c5133e3255c7db /src
parent6cfe28c954dc12f847a15a78b5fcf65154f0407a (diff)
Return cycles in deps solver
Diffstat (limited to 'src')
-rw-r--r--src/rebar_digraph.erl10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/rebar_digraph.erl b/src/rebar_digraph.erl
index bb031cb..dbcf649 100644
--- a/src/rebar_digraph.erl
+++ b/src/rebar_digraph.erl
@@ -18,7 +18,15 @@ compile_order(Apps) ->
end, Apps),
case digraph_utils:topsort(Graph) of
false ->
- {error, no_sort};
+ case digraph_utils:is_acyclic(Graph) of
+ true ->
+ {error, no_sort};
+ false ->
+ Cycles = lists:sort(
+ [lists:sort(Comp) || Comp <- digraph_utils:strong_components(Graph),
+ length(Comp)>1]),
+ {error, {cycles, Cycles}}
+ end;
V ->
{ok, names_to_apps(lists:reverse(V), Apps)}
end.