@@ -25,7 +25,7 @@ def conflicts(self, name):
25
25
return False
26
26
27
27
28
- def recursively_collect_orders (name , ctx , orders = []):
28
+ def recursively_collect_orders (name , ctx , all_inputs , orders = []):
29
29
'''For each possible recipe ordering, try to add the new recipe name
30
30
to that order. Recursively do the same thing with all the
31
31
dependencies of each recipe.
@@ -40,6 +40,11 @@ def recursively_collect_orders(name, ctx, orders=[]):
40
40
dependencies = [([dependency ] if not isinstance (
41
41
dependency , (list , tuple ))
42
42
else dependency ) for dependency in recipe .depends ]
43
+
44
+ # handle opt_depends: these impose requirements on the build
45
+ # order only if already present in the list of recipes to build
46
+ dependencies .extend ([[d ] for d in recipe .get_opt_depends_in_list (all_inputs )])
47
+
43
48
if recipe .conflicts is None :
44
49
conflicts = []
45
50
else :
@@ -68,7 +73,7 @@ def recursively_collect_orders(name, ctx, orders=[]):
68
73
dependency_new_orders = [new_order ]
69
74
for dependency in dependency_set :
70
75
dependency_new_orders = recursively_collect_orders (
71
- dependency , ctx , dependency_new_orders )
76
+ dependency , ctx , all_inputs , dependency_new_orders )
72
77
73
78
new_orders .extend (dependency_new_orders )
74
79
@@ -109,7 +114,7 @@ def get_recipe_order_and_bootstrap(ctx, names, bs=None):
109
114
new_possible_orders = [RecipeOrder (ctx )]
110
115
for name in name_set :
111
116
new_possible_orders = recursively_collect_orders (
112
- name , ctx , orders = new_possible_orders )
117
+ name , ctx , name_set , orders = new_possible_orders )
113
118
possible_orders .extend (new_possible_orders )
114
119
115
120
# turn each order graph into a linear list if possible
0 commit comments