Dependency resolution issues

Bug #453543 reported by BJ Dierkes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
IUS Community Project
Fix Released
Medium
BJ Dierkes

Bug Description

[root@centos5-2 ~]# rpm -qa | grep php
php52-common-5.2.11-1.1.ius.el5
php52-cli-5.2.11-1.1.ius.el5
php52-5.2.11-1.1.ius.el5

[root@centos5-2 ~]# yum repolist
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
 * epel: mirrors.tummy.com
 * base: mirror.5ninesolutions.com
 * updates: mirror.raystedman.net
 * addons: www.cyberuse.com
 * ius: dl.iuscommunity.org
 * extras: www.cyberuse.com
epel | 3.4 kB 00:00
base | 1.1 kB 00:00
updates | 951 B 00:00
addons | 951 B 00:00
ius | 1.9 kB 00:00
primary.sqlite.bz2 | 105 kB 00:00
extras | 1.1 kB 00:00
repo id repo name status
addons CentOS-5 - Addons enabled : 0
base CentOS-5 - Base enabled : 3272
epel Extra Packages for Enterprise Linux 5 - enabled : 4469
extras CentOS-5 - Extras enabled : 288
ius IUS Community Packages for Enterprise Li enabled : 187
updates CentOS-5 - Updates enabled : 700
repolist: 8916

[root@centos5-2 ~]# yum install cacti
...output snipped...
Resolving Dependencies
--> Running transaction check
---> Package cacti.noarch 0:0.8.7e-1.el5 set to be updated
--> Processing Dependency: php-mysql for package: cacti
--> Processing Dependency: php-snmp for package: cacti
--> Running transaction check
---> Package php-mysql.x86_64 0:5.1.6-23.el5 set to be updated
--> Processing Dependency: php-common = 5.1.6-23.el5 for package: php-mysql
--> Processing Dependency: php-pdo for package: php-mysql
---> Package php-snmp.x86_64 0:5.1.6-23.el5 set to be updated
--> Running transaction check
---> Package php-common.x86_64 0:5.1.6-23.el5 set to be updated
---> Package php-pdo.x86_64 0:5.1.6-23.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package Arch Version Repository Size
====================================================================================================
Installing:
 cacti noarch 0.8.7e-1.el5 epel 2.1 M
Installing for dependencies:
 php-common x86_64 5.1.6-23.el5 base 154 k
 php-mysql x86_64 5.1.6-23.el5 base 87 k
 php-pdo x86_64 5.1.6-23.el5 base 64 k
 php-snmp x86_64 5.1.6-23.el5 base 29 k

Transaction Summary
====================================================================================================
Install 5 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 2.5 M
Is this ok [y/N]:

Related branches

Revision history for this message
BJ Dierkes (derks) wrote :

http://yum.baseurl.org/ticket/296

---
The following is the Yum feature request added upstream
---

An issue exists with compare_providers if the packages that provide a dependency do not have the same name. For example:

root@el5-x86_64 ~]# rpm -qa | grep php
php53-5.3.0-5.ius
php53-common-5.3.0-5.ius
php53-cli-5.3.0-5.ius

root@el5-x86_64 ~]# yum install cacti

In this situation, the following is true based on the repos available:

    * cacti requires php-mysql, php-snmp
    * php53-mysql provides php-mysql, php53-snmp provides php-snmp
    * php-mysql provides php-mysql, php-snmp provides php-snmp (stock rhel packages)

That said, Yum resolves the dependency with stock php-mysql, and php-snmp even though php53 is installed and php53-mysql/php53-snmp are available. This happens because compare_providers does not compare versions if the package name is different, and php-mysql/php-snmp are the shortest package names so they win out.

I propose an additional check to add to compare providers to accommodate the comparison of different package names that provide the same dependency, based on whether that provider's sourcerpm is already installed. Meaning, if the providers source rpm is already installed and provides the dependency then it should be awarded points.

This might sound expensive, but the only expensive part is generating the self.installedSourceRPMS list (which is only once). The per pkg operation is simply a 'if po.sourcerpm in self.installedSourceRPMS' check.

Patch against latest git checkout attached.

Revision history for this message
BJ Dierkes (derks) wrote :

Temporary work around: Add items to the global exclude list. For example, when using the php52 packages, add 'exclude=php*5.1*' to /etc/yum.conf. Not a great solution, but temporary.

Revision history for this message
BJ Dierkes (derks) wrote :

Packages for yum3 have been added to ius-el5-testing and should be pushed to stable within the next week after some more testing. Fingers crossed this issue will be fixed in the next Yum release as well as RHEL 5.5 (we hope). Once that happens we will drop the optional yum3 package.

Quick instructs:

yumdownloader yum3
rpm -e yum --nodeps
rpm -Uvh yum3*.rpm

It is exactly the same version as RHEL5 with 1 additional patch to add better dependency resolution (which is being added upstream).

Revision history for this message
BJ Dierkes (derks) wrote :

This should be resolved once yum-3.2.22-23.el5 makes it to RHEL5.

https://bugzilla.redhat.com/show_bug.cgi?id=529719

Revision history for this message
BJ Dierkes (derks) wrote :

This is now resolved in RHEL 5.5/RHEL 6 .... therefore, the yum3.ius package is no longer required.

Changed in ius:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.