Bug 847003 - RFE: greedy dependency resolving
RFE: greedy dependency resolving
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: hawkey (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Ales Kozumplik
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-09 08:20 EDT by Martin Gracik
Modified: 2014-09-30 19:40 EDT (History)
4 users (show)

See Also:
Fixed In Version: hawkey-0.2.9-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-09-17 18:52:02 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Martin Gracik 2012-08-09 08:20:57 EDT
It would be nice if hawkey could do greedy dependency resolving. Adding all packages that provide some requirement, not just the best package.
Comment 1 Ales Kozumplik 2012-08-09 10:33:44 EDT
There are two general approaches:

a) let the hawkey clients do this themselves: after all, the simplest case is just traversing the requirements graph. But that requires exposing the requirements (bug 847006) in some suitable format, which again is tricky. Also one of the premises of hawkey is that it won't need the user to do things like graph traversing.

b) provide a Goal.run() flag that would list all solutions instead of just the best solution. A union of these is the greedy result you're looking for. I like this solution better especially because it nicely handles the case where a requirement-providing package is itself not installable (for instance missing its own requirement). At this time I unfortunately don't know how well is libsolv capable of this.
Comment 2 Ales Kozumplik 2012-08-21 09:04:03 EDT
Fixed with the b) approach, master commits 5e83e28 and d431efa.

A simple example how to use this is shown in a unit test:
https://github.com/akozumpl/hawkey/blob/master/tests/python/tests/test_goal.py#L34

the corresponding repo:
https://github.com/akozumpl/hawkey/blob/master/tests/repos/greedy.repo
Comment 3 Michael Schröder 2012-08-21 09:38:28 EDT
A union will probably not work, as the different providers will sometimes conflict with each other.

I'm also not sure what the exact requirement is. Is it that the solver should install all the providers while solving a dependency of some package or is it more about installing all providers of a dependency provided on the command line?
Comment 4 Ales Kozumplik 2012-08-21 10:57:49 EDT
(In reply to comment #3)
> A union will probably not work, as the different providers will sometimes
> conflict with each other.
> 
> I'm also not sure what the exact requirement is. Is it that the solver
> should install all the providers while solving a dependency of some package
> or is it more about installing all providers of a dependency provided on the
> command line?

I think what Martin is really after is some 'repoquery' functionality, in this case trying to find a list of all packages that (directly or indirectly) satisfy some requirement of the original package (for the outlined solution to make sense the 'installed' repo also needs to be empty). The result is not going to be used in a transaction, as conflicts should be expected.
Comment 5 Fedora Update System 2012-08-23 08:08:04 EDT
hawkey-0.2.9-1.git8599c55.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/hawkey-0.2.9-1.git8599c55.fc18
Comment 6 Fedora Update System 2012-08-23 11:37:18 EDT
Package hawkey-0.2.9-1.git8599c55.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing hawkey-0.2.9-1.git8599c55.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-12561/hawkey-0.2.9-1.git8599c55.fc18
then log in and leave karma (feedback).
Comment 7 Fedora Update System 2012-09-17 18:52:02 EDT
hawkey-0.2.9-1.git8599c55.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.