Skip to content

packages-to-build: fix possible unbreakable cycle in dependency graph#80

Open
yoniyes wants to merge 1 commit intogiltayar:mainfrom
yoniyes:main
Open

packages-to-build: fix possible unbreakable cycle in dependency graph#80
yoniyes wants to merge 1 commit intogiltayar:mainfrom
yoniyes:main

Conversation

@yoniyes
Copy link
Copy Markdown

@yoniyes yoniyes commented Dec 27, 2022

bilt assumes that cycles represented as ['A', 'B', 'C'] are the simple case of A-->B-->C-->A (cyclic) and tried to break the cycle by always removing the edge between A and C. However, ['A', 'B', 'C'] can also be the case for A-->B-->C-->B-->A, and in this case, the edge between C and A doesn’t exist. This enables the following loop:

while cycles exist in the dependency graph:
    for each cycle in dependency graph:
        choose edge to remove from each cycle
        remove that edge

In short, the cycle found was assumed to represent a false connectivity between the edges, causing the cycle to never be broken.


This change is Reviewable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant