summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2025-02-10 17:17:35 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2025-02-14 19:04:56 +0100
commit222271ee0d44c8e7bc00935fbbc2615529a4cdfc (patch)
tree9af0ae58c47ae20c52c46d1ee56c723b253a271a /doc
parentf870bd44522d195199987b0e073d495eed060495 (diff)
solver3: Discover recursive dependencies
When we have discovered all clauses for a version, discover each possible solution for the clauses. This means that when Discover(foo) is called _anything_ that could lead to foo becoming uninstallable is translated; so we can extend this next by keeping a list of reverse dependencies for each package and rejecting those. We limit the discovery to those variables that we did not already enqueue as a negative fact at the root level, as those can never become true. We are utilizing a queue here which is not the most performant solution possible, but where it excels is in producing usable stack traces when debugging. Traversing the entire dependency tree using recursion can easily produce thousand levels of recursion. The queue means that we discover packages in a breadth-first manner compatible with the order in which we propagate dependencies, which is helpful for consistency. The queue did not appear as a bottleneck in benchmarking. If it did, we could switch to a grow-only ring buffer (std::queue's underlying deque also shrinks automatically which is suboptimal).
Diffstat (limited to 'doc')
0 files changed, 0 insertions, 0 deletions