@@ -25,7 +25,7 @@ def conflicts(self, name):
2525 return False
2626
2727
28- def recursively_collect_orders (name , ctx , orders = []):
28+ def recursively_collect_orders (name , ctx , all_inputs , orders = []):
2929 '''For each possible recipe ordering, try to add the new recipe name
3030 to that order. Recursively do the same thing with all the
3131 dependencies of each recipe.
@@ -40,6 +40,11 @@ def recursively_collect_orders(name, ctx, orders=[]):
4040 dependencies = [([dependency ] if not isinstance (
4141 dependency , (list , tuple ))
4242 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+
4348 if recipe .conflicts is None :
4449 conflicts = []
4550 else :
@@ -68,7 +73,7 @@ def recursively_collect_orders(name, ctx, orders=[]):
6873 dependency_new_orders = [new_order ]
6974 for dependency in dependency_set :
7075 dependency_new_orders = recursively_collect_orders (
71- dependency , ctx , dependency_new_orders )
76+ dependency , ctx , all_inputs , dependency_new_orders )
7277
7378 new_orders .extend (dependency_new_orders )
7479
@@ -109,7 +114,7 @@ def get_recipe_order_and_bootstrap(ctx, names, bs=None):
109114 new_possible_orders = [RecipeOrder (ctx )]
110115 for name in name_set :
111116 new_possible_orders = recursively_collect_orders (
112- name , ctx , orders = new_possible_orders )
117+ name , ctx , name_set , orders = new_possible_orders )
113118 possible_orders .extend (new_possible_orders )
114119
115120 # turn each order graph into a linear list if possible
0 commit comments