Bug 1548635 - get_best_query will happily return packages that conflict with each other
Summary: get_best_query will happily return packages that conflict with each other
Keywords:
Status: CLOSED DUPLICATE of bug 1548586
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: rawhide
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-02-24 04:15 UTC by Adam Williamson
Modified: 2018-02-27 12:35 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-27 12:35:15 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Adam Williamson 2018-02-24 04:15:15 UTC
I'm not 100% sure if this is considered a bug, but it was certainly at least *unexpected*.

We recently added an 'installpkg system-logos' directive to lorax (it turned out in the end we didn't need to, but that's another story). Doing this caused all install attempts to fail, because lorax would attempt to install *both* fedora-logos and generic-logos. Both those packages do provide system-logos, but they also conflict with each other.

I dug into why this is a bit more. lorax installpkg is basically backed by this line:

pkgnames = [pkg for pkg in dnf.subject.Subject(p).get_best_query(self.dbo.sack).filter(latest=True)]

where 'p' is the requested identifier. So in this case, lorax does:

pkgnames = [pkg for pkg in dnf.subject.Subject('system-logos').get_best_query(self.dbo.sack).filter(latest=True)]

and what it gets back from dnf is a list of items (I think hawkey package objects?) including both fedora-logos and generic-logos.

lorax takes the list that get_best_query gives it, and tries to install all the packages in it. So this is why the conflict occurs: basically lorax is asking dnf "hey give me system-logos packages" and dnf says "oh okay those are fedora-logos and generic-logos" and lorax says "oh ok i'll install fedora-logos and generic-logos then", and...boom.

So, I figured I'd at least file a bug to highlight this behaviour and see who thinks what about whether this should be 'solved', and if so, where.

Comment 1 Brian Lane 2018-02-24 19:32:03 UTC
See bug #1548586 for a reproducer script.

Comment 2 Jaroslav Mracek 2018-02-27 12:35:15 UTC
I think that I answered all questions in bug #1548586. Please if the information is insufficient, don't hesitate to reopen the bug report.

Additionally, get_best_query() returns all packages that fit to provided subject p. Then solver after filling dnf.base.goal and performing dnf.base.resolve() can choose one from provided possibilities (query from get_best_query()).

*** This bug has been marked as a duplicate of bug 1548586 ***


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