-
Notifications
You must be signed in to change notification settings - Fork 39
Description
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:
buildstream/src/buildstream/element.py
Lines 315 to 316 in b8e6876
| def __lt__(self, other): | |
| return self.name < other.name |
Sorting in bst show:
buildstream/src/buildstream/_frontend/cli.py
Lines 657 to 658 in b8e6876
| if order == "alpha": | |
| dependencies = sorted(dependencies) |