Bug 1332830

Summary: DNF builddep is not consistently installing packages providing capabilities properly
Product: [Fedora] Fedora Reporter: Neal Gompa <ngompa13>
Component: dnfAssignee: Jaroslav Mracek <jmracek>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: high    
Version: 26CC: atigro, jmracek, jsilhan, mluscon, ngompa13, packaging-team-maint, pnemade, RadekHolyPublic, rpm-software-management, samuel-rhbugs, vmukhame
Target Milestone: ---Keywords: Reopened, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-04-01 17:22:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Description Flags
DNF debugsolver data for the builddep issue none

Description Neal Gompa 2016-05-04 07:30:47 UTC
Description of problem:
DNF currently will search for a package by its name+host arch, then name, then capabilities (Provides and whatnot).

This causes a problem in Mageia, because the way our library packages are named can cause DNF to pick the wrong thing at times.

For example, our library devel packages are usually named with the format %{_lib}%{shortname}-devel, and often times they Provide the Fedora variant of the name.

For example, lib64solv-devel Provides libsolv-devel. However, doing "dnf builddep hawkey.spec" doesn't necessarily pull in lib64solv-devel, especially if the user has both 32-bit and 64-bit repos (as is the norm).

This leads to all kinds of problems when trying to install or build packages, as dependencies could be improperly pulled in.

Essentially, I'd like to ask for two things: 1) a configuration option to switch the default behavior from name -> Provides to Provides -> name and 2) a runtime switch to have the same effect temporarily.

Version-Release number of selected component (if applicable):
dnf-1.1.8-2.mga6 (= dnf-1.1.8-1.fc24)
dnf-plugins-core-0.1.20-1.mga6 (= dnf-plugins-core-0.1.20-1.fc24)

Additional info:
This capability exists in Zypper as the "-C" option when using install. This changes Zypper to use capabilities (process Provides before the actual name), so it appears libsolv can do it, so DNF should be able to, as well.

This issue was discovered by a Mageia user, and the bug is referenced in the "See Also" field.

Comment 1 Honza Silhan 2016-05-09 11:46:59 UTC

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

Comment 2 Neal Gompa 2016-05-17 14:01:56 UTC
After speaking to mls about the issue, it turns out it's actually a DNF bug that indicates that it's doing a mix of "job install" and "job install provides" when it should be doing exclusively "job install provides" and resolving that correctly.

So this is now actually a bug rather than an enhancement request.

Comment 3 Neal Gompa 2016-05-17 14:04:04 UTC
Created attachment 1158308 [details]
DNF debugsolver data for the builddep issue

I've also managed to reproduce the test case of the original issue with builddep.

I've provided four debugsolver data sets, two with both 32-bit and 64-bit repositories enabled, and two with just 64-bit repositories enabled. One of each kind has "--best --allowerasing" enabled, and the other set does not.

The source RPM this issue showed up in was qemu-2.6.0-3.mga6.src.rpm, which can be retrieved from https://mirrors.kernel.org/mageia/distrib/cauldron/SRPMS/core/release/qemu-2.6.0-3.mga6.src.rpm

Comment 4 Honza Silhan 2016-05-18 14:42:36 UTC
We should just change reordering of "pkgspec" analysis in bug 1096506 (Subject().get_best_*) then builddep would search by provides at first.

Comment 5 Neal Gompa 2016-05-22 17:24:39 UTC
Updating this ticket to use the new external bug tracker for Mageia bugs.

Comment 6 Fedora Admin XMLRPC Client 2016-07-08 09:26:04 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 7 Jaroslav Mracek 2016-09-12 09:16:03 UTC
I have created a PR that will help. It do not allow to customize the searching characteristic by options but it change searching priorities where first is taken in account provides and if no provides than the name. If someone wants to prefer another package, it chan be customized by ver.release or using excludes. Please can you comment the PR or the bug-report if this changes are acceptable. 


Comment 8 Jaroslav Mracek 2016-10-04 08:38:39 UTC
There is a new PR: https://github.com/rpm-software-management/dnf/pull/609

Comment 9 Igor Gnatenko 2016-12-02 15:23:34 UTC
Neal, can you check if it starts working properly?

If no -- NEW

Comment 10 Neal Gompa 2016-12-11 00:19:48 UTC
The acceptance of https://github.com/rpm-software-management/libhif/pull/224 made this bug return.

Jaroslav, can you figure out how to fix this for good?

Comment 11 Neal Gompa 2016-12-11 00:22:30 UTC
Wait, nevermind. My bad, it's fine.

Comment 13 Fedora End Of Life 2017-02-28 09:58:01 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 14 Fedora Update System 2017-03-21 13:04:20 UTC
dnf-plugins-core-1.1.0-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-f56311f5dd

Comment 15 Fedora Update System 2017-03-22 15:26:38 UTC
dnf-plugins-core-1.1.0-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-f56311f5dd

Comment 16 Fedora Update System 2017-04-01 17:22:41 UTC
dnf-plugins-core-1.1.0-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.