... |
... |
@@ -425,20 +425,20 @@ class Loader(): |
425
|
425
|
|
426
|
426
|
elements_to_load = deque(elements)
|
427
|
427
|
|
428
|
|
- while elements_to_load:
|
429
|
|
- print([e.name for e in elements_to_load])
|
|
428
|
+ for element in elements_to_load:
|
|
429
|
+ element.in_pipeline = True
|
430
|
430
|
|
|
431
|
+ while elements_to_load:
|
431
|
432
|
element = elements_to_load.pop()
|
432
|
433
|
|
433
|
434
|
if element.visited:
|
434
|
|
- print("SKIP", element.name)
|
435
|
435
|
continue
|
436
|
436
|
|
437
|
437
|
if any(filter(not_visited, element.reverse_dependencies)):
|
438
|
438
|
# We will want to treat this item as soon as possible.
|
439
|
439
|
# Mark it as already seen
|
440
|
440
|
element.tried_visit = True
|
441
|
|
- print("Missing rdep for", element.name, ":", [e.name for e in filter(not_visited, element.reverse_dependencies)])
|
|
441
|
+ element.in_pipeline = False
|
442
|
442
|
continue
|
443
|
443
|
|
444
|
444
|
element.visited = True
|
... |
... |
@@ -451,12 +451,15 @@ class Loader(): |
451
|
451
|
if dep.dep_type != Symbol.BUILD:
|
452
|
452
|
dep.element.on_visit(meta_element.dependencies.append)
|
453
|
453
|
|
454
|
|
- if dep.element.tried_visit:
|
455
|
|
- # This element has already been requested, we should treat
|
456
|
|
- # it as soon as possible
|
457
|
|
- elements_to_load.append(dep.element)
|
458
|
|
- else:
|
459
|
|
- elements_to_load.appendleft(dep.element)
|
|
454
|
+ if not dep.element.in_pipeline:
|
|
455
|
+ if dep.element.tried_visit:
|
|
456
|
+ # This element has already been requested, we should treat
|
|
457
|
+ # it as soon as possible
|
|
458
|
+ elements_to_load.append(dep.element)
|
|
459
|
+ else:
|
|
460
|
+ elements_to_load.appendleft(dep.element)
|
|
461
|
+
|
|
462
|
+ dep.element.in_pipeline = True
|
460
|
463
|
|
461
|
464
|
for element in self._meta_elements.values():
|
462
|
465
|
element.build_dependencies.sort(key=attrgetter("index"), reverse=True)
|