Released on 2023-09-15.
New 5.1 features
-
We implemented a convenience fallback from bootstrap-from-image to the slower bootstrap-installed-DNF-from-host for the cases when Podman can not be used properly (when container image can not be pulled, image can not be mounted, image architecture mismatch, Podman is not available or not working - e.g. if run in non-privileged Docker, etc).
There’s also a new “podman pull” backoff logic that makes Mock to retry Podman pulling for 120s (default). Feel free to adjust this timeout by
config_opts["bootstrap_image_keep_getting"]
option. - Mock newly logs out the package management toolset versions (e.g.
version of DNF, RPM, etc.) that is used for the buildroot installation. This
is a feature helping users to diagnose problems with buildroot installation
(minimal buildroot,
BuildRequires
, dynamic build requires, etc.). It might seem like a trivial addition, but sometimes it isn’t quite obvious where the tooling comes from (is that from host? from bootstrap? was it downloaded “pre-installed” with bootstrap image?). - There’s a new “INFO” message raised when running
Podman in Docker, potentially without
docker run --privileged
. This should decrease the confusion if Mock subsequently falls-back to non-defaultuse_bootstrap_image=False
. See issue#1184 for more info. - New exception
BootstrapError
was invented with (if not caught) returns with exit status 90. This exception covers problems with the bootstrap chroot preparation. - The
package_state.py
plugin has been updated to sort the displayed list of installed and available packages alphabetically (previously the list of packages was printed in random order). - Per PR#1220 discussion, Mock package newly
Recommends
having DNF5, DNF and YUM package managers installed on host. These packages are potentially useful, at least when the (default) bootstrap preparation mechanism (bootstrap image) fails and the bootstrap needs to be installed with host’s package management. Previously Mock just “suggested” having them installed, which though used to have almost zero practical effect (as Suggests are not installed by default). - Mock now, at least on the best effort basis (if used with
package_manager=dnf
), “fails” with exit status 30 if it isn’t able to process the--postinstall
request (i.e. installing the built packages into the target chroot). Previous Mock versions used to ignore (with warning) the failed package installation attempts. - The SCM logic got a new option
config_opts['scm_opts']['int_src_dir']
that instructs Mock to search for sources in a specified sub-directory.
Bugfixes
- Some container images Mock is using for initializing bootstrap chroot (e.g.
centos:7
), do not provide all the needed architectures. Podman though silently pulls arch-incompatible image, which caused hard-to-debug build failures. Mock 5.1 therefore implements a new assertion failing the build early, before mistakenly trying to run emulated “–forcearch” chroot leading to failure. The assertion is exposed as a Python library callmockbuild.podman:podman_check_native_image_architecture()
. - When bootstrap chroot is initialized from downloaded container image, it
typically contains
/etc/rpm/macros.image-language-conf
file with locale filtering of some kind (per defaults from the fedora-kickstarts project). This bootstrap configuration though affects the buildroot installation (filtering l11n files from buildroot) and this is sometimes unexpected. Mock now automatically removes the macro file, see issue#1181 for more info. - Manual page has been fixed to better describe the
--config-opts=option=value
semantics. - Mock uses
tmpfs
mountpoints in some cases just to hide (on host) some rather complicated mount structures (done in chroot/separate mount namespace). These “barrier” mount points though used to have the defaultmode=0777
potentially allowing anyone to accidentally write there and cause e.g. unmount failures. New Mock usesmode=0755
instead. -
The
systemd-nspawn
utility v253.9 started failing with pre-mounted<buildroot>/proc
directory (used likesystemd-nspawn -D <buildroot>
). The resulting Mock error, per several reports like this one, was rather cryptic:# /usr/bin/systemd-nspawn -q -M 50743cd0fe0a4142b9b2dbb2c5f8eea6 -D /var/lib/mock/fedora-39-x86_64-bootstrap-1694347273.676351/root Failed to mount /proc/sys (type n/a) on /proc/sys (MS_BIND ""): Invalid argument Failed to create /user.slice/user-1000.slice/session-12.scope/payload subcgroup: Structure needs cleaning
Previous versions of
systemd-nspawn
silently over-mounted the/proc
filesystem so Mock simply could always pre-mount/proc
(with--isolation=simple
it is still needed).To work-around this problem, new Mock now stopped “pre-mounting”
<buildroot>/proc
directory when--isolation=nspawn
(default) and the package management downloaded with bootstrap image is used for installing packages into the bootstrap chroot. - Mock automatically kills “orphan” processes started in buildroot (unwanted “daemons”). These are typically started by DNF installation that trigger some buggy scriptlet. The corresponding code has been moved to a better place which assures that such processes are always killed before “buildroot in bootstrap” recursive bind-mount is unmounted.
- Mock properly dumps Podman’s standard error output to logs to allow the user better diagnose related errors. Per issue#1191 report.
- Mock 5.0 release contained a bug causing that
postyum
hooks (in Mock plugins) were not called. In turn, e.g.root_cache
locking mechanism was broken causing Mock to wait for the lock unnecessary long. - Previous version of Mock used to bind-mount
/proc
and/proc/filesystems
in wrong order, eventually causing that/proc/filesystems
was not visible (this could affect some scriptlests from packages installed into such a chroot). This has been fixed now. - The
--installdeps foo.spec
feature is implemented using the RPM Python API. Previously we used the methodhdr.dsFromHeader()
to get the list ofBuildRequires
. This method has been removed from the Python RPM API (rpm v4.19) in favor of the long-enough existingrpm.ds(hdr, ...)
method. Mock has started usingrpm.ds()
API call to fix theAttributeError: 'rpm.hdr' object has no attribute 'dsFromHeader'
traceback on newer systems (e.g. Fedora 40+). - The
--shell
standard output is no longer affected bypodman image unmount
output executed in the background (prints out the image ID).
mock-core-configs v39.1 changes
- Mageia 9 to branched (released recently) and Cauldron retargeted to Mageia 10.
- openSUSE Leap 15.3 became end-of-life at the end of 2022 and the corresponding Mock configuration is now end-of-life, too.
- openSUSE Leap 15.5 configuration added.
Following contributors contributed to this release:
- Evan Goode
- Miroslav Suchý
- Neal Gompa
- Pavel Raiskup
- Takuya Wakazono
Thank you.