rpm-software-management / mock

Mock is a tool for a reproducible build of RPM packages.
GNU General Public License v2.0
383 stars 231 forks source link

Mock compatibility with DNF5 #894

Open xsuchy opened 2 years ago

xsuchy commented 2 years ago

This is mostly a note for myself:

We should test the new microdnf with Mock: https://fedoraproject.org/wiki/Changes/MajorUpgradeOfMicrodnf https://copr.fedorainfracloud.org/coprs/rpmsoftwaremanagement/dnf5-unstable/.

Tracking the missing parts:

xsuchy commented 1 year ago

This is now mostly about DNF5. FYI we want to do this in the upcoming 3 months. @j-mracek FYI

praiskup commented 1 year ago

See also: https://fedoraproject.org/wiki/Changes/ReplaceDnfWithDnf5

praiskup commented 1 year ago

Can be tested with:

$ cat ~/.config/mock/fedora-rawhide-dnf5-x86_64.cfg 
config_opts['target_arch'] = 'x86_64'
config_opts['legal_host_arches'] = ('x86_64',)
include('templates/fedora-rawhide.tpl')
config_opts["root"] = "dnf5-test"
config_opts["package_manager"] = "dnf5"
config_opts["dnf5_avoid_opts"] = {"builddep": ["--allowerasing"]}

Then mock -r fedora-rawhide-dnf5-x86_64 <your SRPM>.

The system /bin/dnf (v4) installs dnf5 into a bootstrap chroot. If you want to test with DNF5 on host (DNF5 installs even the buildroot), install dnf5 package from this copr.

praiskup commented 1 year ago

That ^^ comment was meant to be in the corresponding PR #1027, sorry.

praiskup commented 1 year ago

PR #1027 deserves a review, please. I'll add an integration test for dnf5, but still.

praiskup commented 1 year ago

Reopening since the support is not yet completed. We keep updating the first comment with the list of missing things.

j-mracek commented 1 year ago

@praiskup May I ask you which module sub-commands are required by mock? dnf5 module enable is already implemented and disable and reset are under final state of development/review.

xsuchy commented 1 year ago

It used to be hardcoded. But now user can specify any command. See https://rpm-software-management.github.io/mock/Release-Notes-2.4.html

But I am aware of usage only enable and install.

j-mracek commented 1 year ago

Thank you, enable is already available, but install module sub-command not yet.

dariaphoebe commented 1 month ago

In the event anyone else needs to use older mock (2.12) with a system that needs dnf5,

config_opts['dnf_common_opts'] = config_opts['yum_common_opts'] + ['--setopt=deltarpm=False'] ( overrides additition of --allowerasing in .../mockbuild/package_manager.py )

config_opts['microdnf_install_command'] = 'dnf-install microdnf dnf5 dnf5-plugins' config_opts['dnf_install_command'] = 'install dnf5 dnf5-plugins'

was enough, tho since i had already tried to bootstrap, i needed to mock -r fedora-41-x86_64 --scrub=all