Bug 1250702 - dnf.Base.group_install does not honor multilib_policy=all
dnf.Base.group_install does not honor multilib_policy=all
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
24
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jaroslav Mracek
Fedora Extras Quality Assurance
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-05 15:10 EDT by David Shea
Modified: 2017-06-16 09:18 EDT (History)
7 users (show)

See Also:
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 09:18:57 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 David Shea 2015-08-05 15:10:51 EDT
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 10:09:47 EDT
Thanks for the report. We'll take a look.
Comment 2 Jan Kurik 2016-02-24 08:34:48 EST
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 05:31:32 EDT
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 06:33:22 EDT
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 09:06:19 EDT
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 09:42:19 EDT
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 09:56:02 EDT
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 11:30:25 EDT
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-13 21:36:00 EDT
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 01:34:22 EDT
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 09:56:08 EDT
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 09:18:57 EDT
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.

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