Bug 1250702

Summary: dnf.Base.group_install does not honor multilib_policy=all
Product: [Fedora] Fedora Reporter: David Shea <dshea>
Component: dnfAssignee: Jaroslav Mracek <jmracek>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: dshea, jmracek, jzeleny, mluscon, packaging-team-maint, tim.lauridsen, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-2.5.1-1.fc26 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-16 13:18:57 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:
Embargoed:

Description David Shea 2015-08-05 19:10:51 UTC
Description of problem:
multilib_policy is used when installing packages, but not when installing groups.

Version-Release number of selected component (if applicable):
dnf-1.0.2-3.fc24.noarch

A demonstration:
dshea@spectre:~$ cat test-pkg.py 
#!/usr/bin/python3

import tempfile, atexit, os, shutil

import dnf

def exitHandler():
    shutil.rmtree(tempdir)

tempdir = tempfile.mkdtemp()
atexit.register(exitHandler)

base = dnf.Base()
base.conf.multilib_policy = 'all'

repo = dnf.repo.Repo('test-repo', os.path.join(tempdir, 'dnf.cache'))
repo.baseurl = 'http://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/x86_64/os/'
base.repos.add(repo)

base.fill_sack(load_system_repo=False)
base.read_comps()

base.install('glibc')
base.resolve()
for pkg in base.transaction.install_set:
    if pkg.arch == 'i686':
        print(pkg.pkgtup)

dshea@spectre:~$ python3 test-pkg.py 
('glibc', 'i686', '0', '2.21.90', '20.fc24')
('nss-softokn-freebl', 'i686', '0', '3.19.2', '2.fc23')


dshea@spectre:~$ cat test-group.py 
#!/usr/bin/python3

import tempfile, atexit, os, shutil

import dnf

def exitHandler():
    shutil.rmtree(tempdir)

tempdir = tempfile.mkdtemp()
atexit.register(exitHandler)

base = dnf.Base()
base.conf.multilib_policy = 'all'

repo = dnf.repo.Repo('test-repo', os.path.join(tempdir, 'dnf.cache'))
repo.baseurl = 'http://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/x86_64/os/'
base.repos.add(repo)

base.fill_sack(load_system_repo=False)
base.read_comps()

group = base.comps.group_by_pattern('core')
base.group_install(group, {'mandatory', 'default'})
base.resolve()
for pkg in base.transaction.install_set:
    if pkg.arch == 'i686':
        print(pkg.pkgtup)

dshea@spectre:~$ python3 test-group.py 
dshea@spectre:~$

Comment 1 Honza Silhan 2015-08-11 14:09:47 UTC
Thanks for the report. We'll take a look.

Comment 2 Jan Kurik 2016-02-24 13:34:48 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase

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

Comment 4 Jaroslav Mracek 2017-05-19 10:33:22 UTC
Please can you provide information what is expected behavior with multilib_policy=all? 

Cases like
dnf install pkgA

dnf install pkgA.i686

and what about case where I have pkg.arch and pkg.noarch package?

Thanks a lot then I will add the support for groups.

Comment 5 David Shea 2017-05-19 13:06:19 UTC
The short answer is, if dnf doesn't already have a definition for the behavior, then neither do I.

The configuration option was copied from yum, so the expected behavior is whatever yum did. I'm not sure what it does in the case of `install pkgA.i686`, and I would not expect the pkg.arch vs. pkg.noarch case to ever actually happen.

This bug isn't about what happens when you run `dnf install`. install + multilib_policy was working because dnf.base.Base.install includes a check against self.conf.multilib_policy and changes the package selection accordingly. dnf.base.Base.group_install does not. This bug is a request to make all of the install API functions work consistently with respect to multilib_policy.

Comment 6 Jaroslav Mracek 2017-05-19 13:42:19 UTC
Sorry for my previous question, but I would like to change code that handle multilib also. I will try my best.

Comment 7 Jaroslav Mracek 2017-05-25 13:56:02 UTC
I created a pull request that should implement it (https://github.com/rpm-software-management/dnf/pull/829).

Comment 8 Fedora Update System 2017-06-12 15:30:25 UTC
dnf-plugins-core-2.1.1-1.fc26 libdnf-0.9.1-1.fc26 dnf-2.5.1-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-c87c47dccb

Comment 9 Fedora Update System 2017-06-14 01:36:00 UTC
dnf-2.5.1-1.fc26, dnf-plugins-core-2.1.1-1.fc26, libdnf-0.9.1-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-c87c47dccb

Comment 10 Fedora Update System 2017-06-14 05:34:22 UTC
dnf-2.5.1-1.fc26 dnf-plugins-core-2.1.1-1.fc26 dnfdaemon-0.3.18-3.fc26 libdnf-0.9.1-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-c87c47dccb

Comment 11 Fedora Update System 2017-06-15 13:56:08 UTC
dnf-2.5.1-1.fc26, dnf-plugins-core-2.1.1-1.fc26, dnfdaemon-0.3.18-3.fc26, libdnf-0.9.1-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-c87c47dccb

Comment 12 Fedora Update System 2017-06-16 13:18:57 UTC
dnf-2.5.1-1.fc26, dnf-plugins-core-2.1.1-1.fc26, dnfdaemon-0.3.18-3.fc26, libdnf-0.9.1-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.