From 6fe40d0d3435d81c5830f96671ec6789a404c0e4 Mon Sep 17 00:00:00 2001 From: Maxim Fedorov Date: Sat, 14 Mar 2020 21:36:16 -0700 Subject: [PATCH] fix parallel compilation now all sources have at least one edge with 'artifact' label, let's ignore it when choosing whether to compile in parallel or sequentially --- src/rebar_compiler_erl.erl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/rebar_compiler_erl.erl b/src/rebar_compiler_erl.erl index 86d6b4fb..a8016483 100644 --- a/src/rebar_compiler_erl.erl +++ b/src/rebar_compiler_erl.erl @@ -70,7 +70,11 @@ needed_files(Graph, FoundFiles, _, AppInfo) -> %% that none other depend of; the former must be sequentially %% built, the rest is parallelizable. OtherErls = lists:partition( - fun(Erl) -> digraph:in_degree(Graph, Erl) > 0 end, + fun(Erl) -> lists:any( + fun(Edge) -> + {_E, _V1, _V2, Kind} = digraph:edge(Graph, Edge), + Kind =:= artifact + end, digraph:in_edges(Graph, Erl)) end, lists:reverse([Dep || Dep <- DepErlsOrdered, not lists:member(Dep, ErlFirstFiles)]) ),