Kekun commented on issue #1988:
URL: https://github.com/apache/buildstream/issues/1988#issuecomment-2624449069

   I'm using BuildStream's comparison function in the sorts. I believe the 
problem is that the comparison function doesn't result in a total order and I 
think I'm starting to guess why, I'm testing things.
   
   There are things like this which in case of a dependency loop would give 
different results based on the used sort function:
   ```python
       if element_a.depends(element_b):
           return 1
       elif element_b.depends(element_a):
           return -1
   ```
   
   If I am right, a fix would be this:
   ```python
       if element_a.depends(element_b) != element_b.depends(element_a):
           if element_a.depends(element_b):
               return 1
           else:
               return -1
   ```
   
   But I'm still unsure, I'm testing this.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to