Warn on cyclic modules dependencies

This commit is contained in:
Evgeniy Khramtsov 2016-07-07 11:34:17 +03:00
parent 12c0d888b1
commit c718cbbd9f
1 changed files with 8 additions and 1 deletions

View File

@ -111,7 +111,14 @@ sort_modules(Host, ModOpts) ->
[DepMod, Mod]);
{DepMod, DepOpts} ->
digraph:add_vertex(G, DepMod, DepOpts),
digraph:add_edge(G, DepMod, Mod)
case digraph:add_edge(G, DepMod, Mod) of
{error, {bad_edge, Path}} ->
?WARNING_MSG("cyclic dependency detected "
"between modules: ~p",
[Path]);
_ ->
ok
end
end
end, Deps)
end, ModOpts),