... |
... |
@@ -386,7 +386,6 @@ class Loader(): |
386
|
386
|
|
387
|
387
|
# Cache it now, make sure it's already there before recursing
|
388
|
388
|
self._meta_elements[element.name] = meta_element
|
389
|
|
- print("Created", meta_element.name, meta_element.first_pass, "on", id(self), "with kind", element_kind)
|
390
|
389
|
|
391
|
390
|
return meta_element
|
392
|
391
|
|
... |
... |
@@ -394,8 +393,6 @@ class Loader(): |
394
|
393
|
all_elements = set()
|
395
|
394
|
elements_to_process = set(elements)
|
396
|
395
|
|
397
|
|
- print([e.name for e in elements_to_process])
|
398
|
|
-
|
399
|
396
|
while elements_to_process:
|
400
|
397
|
element = elements_to_process.pop()
|
401
|
398
|
all_elements.add(element)
|
... |
... |
@@ -435,13 +432,12 @@ class Loader(): |
435
|
432
|
|
436
|
433
|
all_elements = deque(sorted(all_elements, key=cmp_to_key(sorter)))
|
437
|
434
|
|
438
|
|
- print([e.full_name for e in all_elements])
|
439
|
|
-
|
440
|
435
|
treated_elements = []
|
441
|
436
|
|
|
437
|
+ print("-" * 60)
|
442
|
438
|
while all_elements:
|
|
439
|
+ print([e.name for e in all_elements])
|
443
|
440
|
current = all_elements.popleft()
|
444
|
|
- print("Visiting", current.full_name)
|
445
|
441
|
|
446
|
442
|
if current.visited:
|
447
|
443
|
continue
|
... |
... |
@@ -452,6 +448,7 @@ class Loader(): |
452
|
448
|
]
|
453
|
449
|
|
454
|
450
|
if missing_deps:
|
|
451
|
+ print(current.name, "bumped")
|
455
|
452
|
all_elements.appendleft(current)
|
456
|
453
|
all_elements.extendleft(missing_deps)
|
457
|
454
|
continue
|
... |
... |
@@ -460,7 +457,6 @@ class Loader(): |
460
|
457
|
treated_elements.append(current)
|
461
|
458
|
|
462
|
459
|
all_elements = deque(treated_elements)
|
463
|
|
- print([e.full_name for e in all_elements])
|
464
|
460
|
|
465
|
461
|
# Filter out duplicated elements
|
466
|
462
|
for _ in range(len(all_elements)):
|
... |
... |
@@ -471,13 +467,7 @@ class Loader(): |
471
|
467
|
current.visited = False
|
472
|
468
|
all_elements.append(current)
|
473
|
469
|
|
474
|
|
- print([e.full_name for e in all_elements])
|
475
|
|
-
|
476
|
470
|
for element in all_elements:
|
477
|
|
- print("#" * 60)
|
478
|
|
- print("Treating", element.full_name)
|
479
|
|
- print("With deps:", [e.element.full_name for e in element.dependencies])
|
480
|
|
-
|
481
|
471
|
meta_element = element._loader._collect_element(element)
|
482
|
472
|
|
483
|
473
|
for dep in element.dependencies:
|
... |
... |
@@ -487,10 +477,12 @@ class Loader(): |
487
|
477
|
if dep.dep_type != Symbol.BUILD:
|
488
|
478
|
meta_element.dependencies.append(dependency)
|
489
|
479
|
|
|
480
|
+ print("------------------")
|
490
|
481
|
for element in self._meta_elements.values():
|
|
482
|
+ print("element before sort:", element.name, [e.name for e in element.build_dependencies], [e.name for e in element.dependencies])
|
491
|
483
|
element.build_dependencies.sort(key=attrgetter("index"))
|
492
|
484
|
element.dependencies.sort(key=attrgetter("index"))
|
493
|
|
-
|
|
485
|
+ print("####################")
|
494
|
486
|
|
495
|
487
|
|
496
|
488
|
|
... |
... |
@@ -609,11 +601,6 @@ class Loader(): |
609
|
601
|
|
610
|
602
|
ret = [e._loader._collect_element(e) for e in elements]
|
611
|
603
|
|
612
|
|
- for e in ret:
|
613
|
|
- print(e.name, e.first_pass)
|
614
|
|
- for d in e.dependencies:
|
615
|
|
- print("\t", d.name)
|
616
|
|
-
|
617
|
604
|
return ret
|
618
|
605
|
|
619
|
606
|
# _get_loader():
|