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

dep_check: use DNF to optimize overlapping || deps (bug 632026) #226

Merged
merged 1 commit into from
Nov 14, 2017

Conversation

zmedico
Copy link
Member

@zmedico zmedico commented Nov 9, 2017

dep_check: use DNF to optimize overlapping virtual || deps (bug 632026)

Deps like these:

|| ( foo bar ) || ( bar baz )

Translate to disjunctive normal form (DNF):

|| ( ( foo bar ) ( foo baz ) ( bar bar ) ( bar baz ) )

Using DNF, if none of the packages are currently installed,
then the ( bar bar ) choice will be automatically preferred
since it is satisfied by the fewest number of packages.
If the ( foo baz ) choice is already satisfied, then that
choice will be preferred instead.

Since DNF results in exponential explosion of the formula,
only use DNF for the parts of the dependencies that have
overlapping atoms.

In order to simplify the implementation of the dnf_convert
function, this patch also fixes _expand_new_virtuals to
normalize results in the same way as use_reduce (with no
redundant nested lists).

Bug: https://bugs.gentoo.org/632026

@zmedico zmedico force-pushed the bug_632026 branch 29 times, most recently from 91725f6 to 00b052a Compare November 13, 2017 19:02
@zmedico zmedico force-pushed the bug_632026 branch 2 times, most recently from 2bebfbb to 8f3bd43 Compare November 13, 2017 22:52
Deps like these:

  || ( foo bar ) || ( bar baz )

Translate to disjunctive normal form (DNF):

  || ( ( foo bar ) ( foo baz ) ( bar bar ) ( bar baz ) )

Using DNF, if none of the packages are currently installed,
then the ( bar bar ) choice will be automatically preferred
since it is satisfied by the fewest number of packages.
If the ( foo baz ) choice is already satisfied, then that
choice will be preferred instead.

Since DNF results in exponential explosion of the formula,
only use DNF for the parts of the dependencies that have
overlapping atoms.

In order to simplify the implementation of the dnf_convert
function, this patch also fixes _expand_new_virtuals to
normalize results in the same way as use_reduce (with no
redundant nested lists).

Bug: https://bugs.gentoo.org/632026
Reviewed-by: Manuel Rüger <mrueg@gentoo.org>
Reviewed-by: Alec Warner <antarus@gentoo.org>
@gentoo-bot gentoo-bot merged commit 9fdaf9b into gentoo:master Nov 14, 2017
@zmedico zmedico deleted the bug_632026 branch January 3, 2018 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants