Release 5.7 - 2024-09-26
New features and important changes
-
Support for hermetic builds has been implemented. This update introduces two new command-line options:
--calculate-build-deps
and--hermetic-build
, along with the newmock-hermetic-repo(1)
utility.Additionally, this change introduces a new
buildroot_lock
plugin, which generates a new artifact in the buildroot—a buildroot lockfile. Users can enable this plugin explicitly by settingconfig_opts["plugin_conf"]["buildroot_lock_enable"] = True
. -
This version addresses issue#521, which requested a cleanup option for all chroots. A new option,
--scrub-all-chroots
, has been added. It can detect leftovers in/var/lib/mock
or/var/cache/mock
and make multiplemock --scrub=all
calls accordingly. -
Alias
dnf4
added for thepackage_manager = dnf
.The options specific to DNF4, previously prefixed with
dnf_*
, have been renamed todnf4_*
too to avoid confusion withdnf5_*
options. For backward compatibility, thednf_*
prefixed variants still work, so these config pairs are equivalent:config_opts['dnf4_install_cmd'] = 'install python3-dnf python3-dnf-plugins-core' config_opts['dnf_install_cmd'] = 'install python3-dnf python3-dnf-plugins-core' config_opts['package_manager'] = 'dnf4' config_opts['package_manager'] = 'dnf'
Some of the
dnf_*
options remain unchanged because they are universal and used with DNF4, DNF5, or YUM, e.g.,dnf_vars
.While working on this rename, the rarely used
system_<PM>_command
options have been changed to<PM>_system_command
to visually align with the rest of the package-manager-specific options. The old variants are still accepted. -
The
--addrepo
option has been updated to affect both the bootstrap chroot installation and the buildroot installation, as requested in issue#1414. However, be cautious, as Mock aggressively caches the bootstrap. Always remember to runmock -r <chroot> --scrub=bootstrap
first. Additionally, as more chroots are being switched tobootstrap_image_ready = True
, you’ll likely need to use--addrepo
in combination with--no-bootstrap-image
; otherwise, the bootstrap chroot installation will remain unaffected. -
There’s a new
config_opts['bootstrap_image_skip_pull']
option that allows you to skip image pulling (running thepodman pull
command by Mock) when preparing the bootstrap chroot. This is useful ifpodman pull
is failing, for example, when the registry is temporarily or permanently unavailable, but the local image exists, or if the image reference is pointing at a local-only image. -
There’s a new ccache plugin option
config_opts['plugin_conf']['ccache_opts']['show_stats']
; if set toTrue
, Mock prints the ccache statistics (hits/misses) to logs. -
A new option
debug
has been added to the ccache plugin. Setting it toTrue
creates per-object debug files that are helpful when debugging unexpected cache misses, see ccache docs. -
A new option
hashdir
has been added to the ccache plugin. Setting it toFalse
excludes the build working directory from the hash used to distinguish two compilations when generating debuginfo. While this allows the compiler cache to be shared across different package NEVRs, it might cause the debuginfo to be incorrect. The option can be used for issue bisecting if running the debugger is unnecessary (issue#1395). -
New Mock RPM package provides the systemd-sysusers drop-in configuration file for automatic
mock 135
group ID allocation. See rpm docs for more info.
Bugfixes
-
The
installed_pkgs.log
— generated by thepackage_state
plugin — was previously generated too early, after the static build requirements were installed but before the dynamic build requirements were resolved and installed. This led to incorrect chroot introspection for the end user, as the reported set of packages needed to build the given package was incomplete. The new Mock version generates theinstalled_pkgs.log
file after the dynamic build requirements are installed. -
De-duplicating bootstrap mount points for local repositories used with
--chain
or--localrepo=file:///repo/on/host
. Caused eventual problems during--scrub=bootstrap
. This bug existed in Mock <= 5.6, but after fixing the issue#1414, it got exposed by our test suite. Related issues include issue#357 (commit#a0a2cba3) and issue#381 (commit#16462acc). -
Previously, mock.rpm created file in
/usr/share/doc/mock
directory but did did own this directory. -
The fuse-overlayfs package is not installed in the Fedora container images by default. We need to explicitly install it, otherwise running Mock inside of a container won’t work.
-
Previously, the
nspawn_args
configuration value was not applied in multiple internaldoChroot()
calls. This could cause issues when custom nspawn arguments were needed everywhere (see PR#1410). Now,doChroot()
automatically appliesnspawn_args
, shifting the responsibility from callers to callee. -
Several internal code locations attempt to ensure that the result directory exists, creating it if necessary. However, these locations handled it inconsistently, sometimes neglecting to change the ownership of the result directory. Now, all locations use a single method dedicated to result directory preparation.
Mock Core Configs changes
-
The GPG key locations for the CentOS Stream 10 Appstream debuginfo and Extras Common repositories were updated to point to the correct GPG keys.
-
Anolis-7 has been EOLed at 2024-06-30. We moved the configs to
eol
directory. -
The CentOS Stream 10 configuration has been updated to use
quay.io/centos/centos:stream10-development
as its bootstrap image. Since this image already has thepython3-dnf-plugins-core
package installed, the configuration is also updated to setbootstrap_image_ready = True
. This means the image can be used “as is” to bootstrap the DNF stack without installing any additional packages into the prepared bootstrap chroot, significantly speeding up bootstrap preparation. -
The centos-stream-9 (and transitively centos-stream+epel-9) configuration has been fixed to rely on “bootstrap image” readiness for Mock builds, see issue#1442.
-
OpenSuse Leap 15.4 EOLed at 07 Dec 2023 so we moved the configs to
eol
directory. -
We updated the configuration files for chroots that still use older RPM versions (v4.18 and earlier), which affects RHEL/CentOS 9 and older. These older RPM versions were built with an incorrect default for the
%_host_cpu
macro inppc64le
chroots, where the macro incorrectly resolved topowerpc64le
instead ofppc64le
.This incorrect value caused issues during architecture validation, such as when checking
ExclusiveArch: ppc64le
forBuildArch: noarch
packages (done in-chroot by/bin/rpmbuild
).The incorrect macro value has now been overridden in the relevant
ppc64le
configuration files in Mock, ensuring thatExcludeArch
andExclusiveArch
validations resolve correctly.
Following contributors contributed to this release:
- Brian J. Murrell
- Carl George
- Jakub Kadlcik
- Jiri Kyjovsky
- Julian Sikorski
- Miroslav Suchý
- Nils Philippsen
- Thomas Mendorf
Thank you!