The ordering used by bst show --order alpha is based on the comparison operator of the Element class. This ordering is based on element name only which means that the junction an element comes from is ignored when searching elements. This means that elements from different junctions get mixed together in the bst show output which is confusing.
A better option might be to use _get_full_name as the sort key (either in the def __lt__ in Element or directly in the bst show code). I am not sure on the stability promises of buildstream and whether the ordering of alpha cannot change (if so could we consider adding a new ordering?).
References
Comparison operator of Element class:
|
def __lt__(self, other): |
|
return self.name < other.name |
Sorting in bst show:
|
if order == "alpha": |
|
dependencies = sorted(dependencies) |
The ordering used by
bst show --order alphais based on the comparison operator of theElementclass. This ordering is based on element name only which means that the junction an element comes from is ignored when searching elements. This means that elements from different junctions get mixed together in thebst showoutput which is confusing.A better option might be to use
_get_full_nameas the sort key (either in thedef __lt__in Element or directly in thebst showcode). I am not sure on the stability promises of buildstream and whether the ordering ofalphacannot change (if so could we consider adding a new ordering?).References
Comparison operator of
Elementclass:buildstream/src/buildstream/element.py
Lines 315 to 316 in b8e6876
Sorting in
bst show:buildstream/src/buildstream/_frontend/cli.py
Lines 657 to 658 in b8e6876