This commit is contained in:
Todd Gamblin 2023-01-16 01:18:02 -08:00
parent d92b653f0b
commit b0e67d3411
No known key found for this signature in database
GPG Key ID: C16729F1AACF66C6

View File

@ -1117,13 +1117,14 @@ build_priority(Package, build_prio) :- attr("node", Package), not optimize_for_r
% Calculate min depth of nodes in the DAG % Calculate min depth of nodes in the DAG
% We use this to optimize nodes closer to roots with higher precedence. % We use this to optimize nodes closer to roots with higher precedence.
%----------------------------------------------------------------------------- %-----------------------------------------------------------------------------
#const max_depth = 10. #const max_depth = 4.
% roots have depth 0. % roots have depth 0.
depth(Package, 0) :- attr("root", Package). depth(Package, 0) :- attr("root", Package).
depth(Package, D+1) :- depth(Dependent, D), depends_on(Dependent, Package), D < max_depth.
%depth(Package, D+1) :- depth(Dependent, D), depends_on(Dependent, Package), D < max_depth.
%parent_depth(Package, D) :- %parent_depth(Package, D) :-
% depends_on(Dependent, Package), % depends_on(Dependent, Package),
% depth(Dependent, D), % depth(Dependent, D),
@ -1134,15 +1135,15 @@ depth(Package, D+1) :- depth(Dependent, D), depends_on(Dependent, Package), D <
% attr("node", Package). % attr("node", Package).
% other nodes' depth is the minimum depth of any dependent plus one. % other nodes' depth is the minimum depth of any dependent plus one.
%depth(Package, N + 1) :- depth(Package, N + 1) :-
% N = #min{ N = #min{
% D: depends_on(Dependent, Package), D: depends_on(Dependent, Package),
% depth(Dependent, D), depth(Dependent, D),
% D < max_depth; D < max_depth;
% max_depth - 1 max_depth - 1
% }, },
% N = 0..max_depth - 1, N = 0..max_depth - 1,
% attr("node", Package). attr("node", Package).
%----------------------------------------------------------------- %-----------------------------------------------------------------