Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yoniyes
Copy link

@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