enhance: Add comprehensive .gitignore for deb-mock project
Some checks failed
Build Deb-Mock Package / build (push) Successful in 54s
Lint Code / Lint All Code (push) Failing after 1s
Test Deb-Mock Build / test (push) Failing after 36s

- Add mock-specific build artifacts (chroot/, mock-*, mockroot/)
- Include package build files (*.deb, *.changes, *.buildinfo)
- Add development tools (.coverage, .pytest_cache, .tox)
- Include system files (.DS_Store, Thumbs.db, ._*)
- Add temporary and backup files (*.tmp, *.bak, *.backup)
- Include local configuration overrides (config.local.yaml, .env.local)
- Add test artifacts and documentation builds
- Comprehensive coverage for Python build system project

This ensures build artifacts, chroot environments, and development
tools are properly ignored in version control.
This commit is contained in:
robojerk 2025-08-18 23:37:49 -07:00
parent 1a559245ea
commit 4c0dcb2522
329 changed files with 27394 additions and 965 deletions

View file

@ -1,327 +1,37 @@
# Deb-Mock FAQ
---
layout: default
title: FAQ
---
## Frequently Asked Questions
## FAQ
This FAQ addresses common issues and questions about **Deb-Mock**, a Debian-focused alternative to Fedora's Mock.
### How to preserve environment variable in chroot
### Environment Variables in Chroot
Q: I put
**Q: I set environment variables in my configuration, but they're not preserved in the chroot environment.**
config_opts['environment']['VAR'] = os.environ['VAR']
**A:** This is a common issue with chroot environments. **Deb-Mock** provides several solutions:
into config, but the variable is not preserved.
#### Solution 1: Use the `--preserve-env` flag
```bash
deb-mock shell --preserve-env
```
A: Environment is sanitized by consolehelper when elevating UID. You need to alter `/etc/security/console.apps/mock` too.
#### Solution 2: Configure specific environment variables
```yaml
# deb-mock.yaml
preserve_environment:
- CC
- CXX
- CFLAGS
- CXXFLAGS
- DEB_BUILD_OPTIONS
- CCACHE_DIR
```
### I cannot build Fedora or RHEL8 beta package on RHEL/CentOS 7
#### Solution 3: Disable environment sanitization
```yaml
# deb-mock.yaml
environment_sanitization: false
```
Q: I am on RHEL 7 and when I run `mock -r fedora-28-x86_64 --init` (similarly for rhelbeta-8-x86_64) I get:
#### Solution 4: Use the `--env-var` option
```bash
deb-mock shell --env-var CC=gcc --env-var CFLAGS="-O2"
```
....
---> Package patch.x86_64 0:2.7.6-4.fc28 will be installed
---> Package redhat-rpm-config.noarch 0:108-1.fc28 will be installed
Error: Invalid version flag: if
**Why this happens:** Chroot environments sanitize environment variables for security reasons. **Deb-Mock** provides controlled ways to preserve necessary variables while maintaining security.
A: This is not Mock error. This is because redhat-rpm-config in Fedora 28 (& RHEL 8 Beta) contains rich dependency: `Requires: (annobin if gcc)`. This is a new rpm's feature and is not recognized by RHEL7's rpm. When you are installing the fedora-28 chroot, mock is using host's rpm. And RHEL7 rpm cannot install this package, because of the new feature, which does not recognize.
### Cross-Distribution Package Building
The solution is to use mock's [bootstrap feature](https://rpm-software-management.github.io/mock/Release-Notes-1.4.1#bootstrap-chroot). It is not enabled by default, because there are still some [unresolved issues](https://github.com/rpm-software-management/mock/labels/bootstrap), but generally it works. Try:
**Q: I'm on Debian Stable but need to build packages for Debian Sid. How can I do this?**
mock -r fedora-28-x86_64 --init --bootstrap-chroot
**A:** Use **Deb-Mock**'s bootstrap chroot feature, similar to Mock's `--bootstrap-chroot`:
### When I can expect next release
#### Solution: Use bootstrap chroot
```bash
# Create a Sid chroot using bootstrap
deb-mock init-chroot debian-sid-amd64 --suite sid --bootstrap
Q: A developer merged my pull-request. When I can expect the next release with my fix?
# Build packages in the Sid chroot
deb-mock -r debian-sid-amd64 build package.dsc
```
#### Configuration-based approach
```yaml
# deb-mock.yaml
use_bootstrap_chroot: true
bootstrap_chroot_name: "debian-stable-bootstrap"
suite: "sid"
architecture: "amd64"
```
**Why this is needed:** Building packages for newer distributions on older systems can fail due to package manager version incompatibilities. Bootstrap chroots create a minimal environment with the target distribution's tools to build the final chroot.
### Build Dependencies Not Found
**Q: My build fails with "Package not found" errors for build dependencies.**
**A:** This usually indicates repository or dependency resolution issues:
#### Solution 1: Update the chroot
```bash
deb-mock update-chroot debian-bookworm-amd64
```
#### Solution 2: Check repository configuration
```yaml
# deb-mock.yaml
mirror: "http://deb.debian.org/debian/"
security_mirror: "http://security.debian.org/debian-security/"
backports_mirror: "http://deb.debian.org/debian/"
```
#### Solution 3: Install missing dependencies manually
```bash
deb-mock shell debian-bookworm-amd64
# Inside chroot:
apt-get update
apt-get install build-essential devscripts
```
#### Solution 4: Use verbose output for debugging
```bash
deb-mock --verbose build package.dsc
```
### Chroot Creation Fails
**Q: I get permission errors when creating chroots.**
**A:** Chroot creation requires root privileges:
#### Solution 1: Use sudo
```bash
sudo deb-mock init-chroot debian-bookworm-amd64
```
#### Solution 2: Add user to appropriate groups
```bash
sudo usermod -a -G sbuild $USER
# Log out and back in
```
#### Solution 3: Check disk space
```bash
df -h /var/lib/deb-mock
```
#### Solution 4: Verify debootstrap installation
```bash
sudo apt-get install debootstrap schroot
```
### Build Performance Issues
**Q: My builds are slow. How can I speed them up?**
**A:** **Deb-Mock** provides several performance optimization features:
#### Solution 1: Enable caching
```yaml
# deb-mock.yaml
use_root_cache: true
use_package_cache: true
use_ccache: true
```
#### Solution 2: Use parallel builds
```yaml
# deb-mock.yaml
parallel_jobs: 8
parallel_compression: true
```
#### Solution 3: Use tmpfs for temporary files
```yaml
# deb-mock.yaml
use_tmpfs: true
tmpfs_size: "4G"
```
#### Solution 4: Clean up old caches
```bash
deb-mock cleanup-caches
```
### Network and Proxy Issues
**Q: I'm behind a proxy and can't download packages.**
**A:** Configure proxy settings in your configuration:
#### Solution: Configure proxy
```yaml
# deb-mock.yaml
http_proxy: "http://proxy.example.com:3128"
https_proxy: "http://proxy.example.com:3128"
no_proxy: "localhost,127.0.0.1"
```
### Package Signing Issues
**Q: How do I sign packages with GPG keys?**
**A:** **Deb-Mock** supports package signing through configuration:
#### Solution: Configure signing
```yaml
# deb-mock.yaml
sign_packages: true
gpg_key: "your-gpg-key-id"
gpg_passphrase: "your-passphrase" # Use environment variable in production
```
### Debugging Build Failures
**Q: My build failed. How can I debug it?**
**A:** **Deb-Mock** provides several debugging tools:
#### Solution 1: Use verbose output
```bash
deb-mock --verbose build package.dsc
```
#### Solution 2: Keep chroot for inspection
```bash
deb-mock build package.dsc --keep-chroot
deb-mock shell # Inspect the failed build environment
```
#### Solution 3: Check build logs
```bash
# Build logs are automatically captured
ls -la ./output/
cat ./output/build.log
```
#### Solution 4: Use debug mode
```bash
deb-mock --debug build package.dsc
```
### Chain Building Issues
**Q: My chain build fails because later packages can't find earlier packages.**
**A:** This is a common issue with chain builds:
#### Solution 1: Use the chain command
```bash
deb-mock chain package1.dsc package2.dsc package3.dsc
```
#### Solution 2: Continue on failure
```bash
deb-mock chain package1.dsc package2.dsc --continue-on-failure
```
#### Solution 3: Check package installation
```bash
deb-mock shell
# Inside chroot, check if packages are installed:
dpkg -l | grep package-name
```
### Configuration Issues
**Q: How do I create a custom configuration?**
**A:** **Deb-Mock** supports custom configurations:
#### Solution 1: Create a custom config file
```yaml
# my-config.yaml
chroot_name: "custom-debian"
architecture: "amd64"
suite: "bookworm"
mirror: "http://deb.debian.org/debian/"
use_root_cache: true
use_ccache: true
parallel_jobs: 4
```
#### Solution 2: Use the config file
```bash
deb-mock -c my-config.yaml build package.dsc
```
#### Solution 3: Use core configurations
```bash
# List available configurations
deb-mock list-configs
# Use a core configuration
deb-mock -r debian-bookworm-amd64 build package.dsc
```
### Common Error Messages
#### "Chroot does not exist"
```bash
# Create the chroot first
deb-mock init-chroot debian-bookworm-amd64
```
#### "Permission denied"
```bash
# Use sudo for chroot operations
sudo deb-mock init-chroot debian-bookworm-amd64
```
#### "Package not found"
```bash
# Update the chroot
deb-mock update-chroot debian-bookworm-amd64
```
#### "Build dependencies not satisfied"
```bash
# Install build dependencies
deb-mock shell
# Inside chroot:
apt-get install build-essential devscripts
```
### Getting Help
**Q: Where can I get more help?**
**A:** Several resources are available:
1. **Documentation**: Check the main README and configuration documentation
2. **Verbose Output**: Use `--verbose` and `--debug` flags for detailed information
3. **Error Messages**: **Deb-Mock** provides detailed error messages with suggestions
4. **Logs**: Check build logs in the output directory
5. **Community**: Report issues on the project's issue tracker
### Performance Tips
1. **Use caching**: Enable root cache, package cache, and ccache
2. **Parallel builds**: Set appropriate `parallel_jobs` for your system
3. **Clean up**: Regularly run `deb-mock cleanup-caches`
4. **Monitor resources**: Use `deb-mock cache-stats` to monitor cache usage
5. **Optimize chroots**: Use tmpfs for temporary files if you have sufficient RAM
### Security Considerations
1. **Environment sanitization**: Keep environment sanitization enabled unless necessary
2. **Root privileges**: Only use sudo when required for chroot operations
3. **Package verification**: Verify source packages before building
4. **Network security**: Use HTTPS mirrors and configure proxies securely
5. **Cache security**: Regularly clean caches to remove sensitive build artifacts
A: I try to stick to two month cadence. Check the last release date and add two months and you can set your expectation. Of course things like Christmas or summer holidays can add a few weeks. On the other hand the branching event in Fedora can make it shorter as I usually do a mock release a day before Fedora branches, because I had to add new configs there anyway.

30
docs/Feature-bootstrap.md Normal file
View file

@ -0,0 +1,30 @@
---
layout: default
title: Feature bootstrap
---
## Bootstrap chroot
Mock is calling `dnf --installroot` to install packages for target architecture into the target directory. This works. Mostly. The only problem that use host DNF and rpm to install packages. But this can cause a problem when a new RPM feature is introduced. Like Soft dependencies or Rich dependencies. When you have EL6 host and try to install Fedora rawhide package with Rich dependency then rpm will fail and you cannot do anything about it. You can upgrade your build machine to Fedora rawhide, but that is often not possible when it is part of critical infrastructure.
So we introduced Boostrap chroot. And 'we' actually means Michael Cullen who implements it. And Igor Gnatenko who proposed this idea. Big kudos for both of them.
Bootstrap chroot means that we first create very minimal chroot for the target platform and we call DNF/YUM from that platform. For example: when you are on RHEL7 and you want to build a package for `fedora-26-x86_64`, mock will first create chroot called `fedora-26-x86_64-bootstrap`, it will install DNF and rpm there (fc26 versions). Then it will call DNF from `fedora-26-x86_64-bootstrap` to install all needed packages to `fedora-26-x86_64` chroot.
The disadvantage is that you will need more storage in `/var/lib/mock`, the build is a little bit slower. But you will hardly notice that unless you disabled `yum_cache` and `root_cache` plugins for some reasons.
The advantage is that you can use a stable version of OS to build packages for even most recent OS. And vice versa.
This feature is enabled by default. If you want to disable it you should set:
```
config_opts['use_bootstrap'] = False
```
in your configuration.
This has been added in Mock 1.4.1.
### Using bootstrap with local repositories
It is possible to use `file://` local repositories with bootstrap chroot. However, you should not bind mount repositories located in `/tmp`, `/dev`, etc., as they might be over-mounted by systemd-nspawn.

View file

@ -0,0 +1,42 @@
---
layout: default
title: Feature buildroot image
---
Starting from version v6.0, Mock allows users to use an OCI container image for
pre-creating the buildroot (build chroot). It can be either an online container
image hosted in a registry (or cached locally), or a local image in the form of
a tarball.
Be cautious when using chroot-compatible images (e.g., it is not advisable to
combine EPEL `ppc64le` images with `fedora-rawhide-x86_64` chroot).
## Example Use-Case
1. Mock aggressively caches the build root, so clean up your chroot first:
```bash
$ mock -r fedora-rawhide-x86_64 --scrub=all
```
2. Perform any normal Mock operation, but select the OCI image on top of that:
```bash
$ mock -r fedora-rawhide-x86_64 \
--buildroot-image registry.fedoraproject.org/fedora:41 \
--rebuild /your/src.rpm
```
## Using Exported Buildroot Image
The [export_buildroot_image](Plugin-Export-Buildroot-Image) plugin allows you to
wrap a prepared buildroot as an OCI archive (tarball). If you have this
tarball, you may select it as well:
```bash
$ mock -r fedora-rawhide-x86_64 \
--buildroot-image /tmp/buildroot-oci.tar \
--rebuild /your/src.rpm
```
Again, ensure that you do not combine incompatible chroot and image pairs.

View file

@ -0,0 +1,48 @@
---
layout: default
title: Feature container for bootstrap
---
## Container image for bootstrap
In past, we had some incompatibilities between host and build target. They were, in fact, small. Like using a different package manager. Some were big. Like, the introduction of Weak and Rich dependencies. For this reason, we introduced [bootstrap](Feature-bootstrap). But then comes [zstd payload](https://fedoraproject.org/wiki/Changes/Switch_RPMs_to_zstd_compression). This is a new type of payload. And to install packages with this payload, you need an `rpm` binary, which supports this payload. This is true for all current Fedoras. Unfortunately, neither RHEL 8 nor RHEL 7 supports this payload. So even bootstrap will not help you to build Fedora packages on RHEL 8.
We come up with a nice feature. Mock will not install bootstrap chroot itself. Instead, it will download the container image, extract the image, and use this extracted directory as a bootstrap chroot. And from this bootstrapped chroot install the final one.
Using this feature, **any** incompatible feature in either RPM or DNF can be used in the target chroot. Now or in future. And you will be able to install the final chroot. You do not even need to have `rpm` on a host. So this should work on any system, even Debian-based ones. The only requirement for this feature is [Podman](https://podman.io/). Do not forget to install the `podman` package.
This feature is available since 1.4.20 and enabled by default from 5.0. You can disable it using:
config_opts['use_bootstrap_image'] = False
It can be enabled or disabled on the command line using `--use-bootstrap-image` or `--no-bootstrap-image` options.
Note however that also this is prerequisite:
config_opts['use_bootstrap_container'] = True # or --bootstrap-chroot option
To specify which image should be used for bootstrap container you can put in config:
config_opts['bootstrap_image'] = 'registry.fedoraproject.org/fedora:latest'
This is a general config. Each config has specified its own image specified. E.g. CentOS 7 has `config_opts['bootstrap_image'] = 'centos:7'` in config. So unless you use your own config, you can enable this feature, and the right image will be used.
The image contents are typically suboptimal for Mock's use-case. In particular,
Mock needs to have a correct package manager (as specified in the
`package_manager` configuration option) installed inside the image, along with
the `builddep` functionality (typically provided by `python3-dnf-plugins-core`).
This is why Mock still has to 'update the downloaded bootstrap' somehow. If you
happen to have an image with `builddep` pre-installed, you can set
`bootstrap_image_ready` to 'True':
config_opts['bootstrap_image_ready'] = True
This option will significantly reduce the bootstrap preparation time, as no
package management actions need to be performed for the bootstrap (no need to
download and initialize package manager caches).
There is one known issue:
* Neither Mageia 6 nor 7 works correctly now with this feature.
Technically, you can use any container, as long as there is the required package manager (DNF or YUM). The rest of the needed packages will be installed by mock.

View file

@ -0,0 +1,43 @@
---
layout: default
title: Feature external dependencies
---
## External dependencies
It can happen that you need some library that is not packaged. PyPI has ten times more modules than Fedora has packages. The same for Rubygems.org, Crates.io...
External dependencies allow you to install a package using the native package manager. I.e. not dnf or rpm, but rather using `pip`, `gem`, etc.
Right now it is possible to do that only for `BuildRequires`. Run-time `Requires` will need more co-operation with DNF and rpm.
This feature is disabled by default. It can be enabled using:
```
config_opts['external_buildrequires'] = True
```
## Modules
### PyPI
`BuildRequires: external:pypi:foo` - this will run `pip3 --install foo`
### Crate
`BuildRequires: external:crate:foo` - this will run `cargo install foo`
### Others
Do you miss other languages here? [File an issue](https://github.com/rpm-software-management/mock/issues) and let us know which language you want to add. There are two requirements. The native package manager needs to be available in Fedora. And the manager has to have `--root` or something similar which let you allow to install the files in the different root path. That is because we run this tool in bootstrap chroot.
## How it works
When we find the `external::` prefix in BuildRequires then Mock install the native package manager in bootstrap buildroot. E.g., for `external:pypi:foo` mock will install `pip3` and run `pip3 install --root MOCK_CHROOT foo`.
To satisfy rpm dependencies Mock calls `create-fake-rpm` and creates a fake rpm package that provides `external:pypi:foo` and installs it in chroot.
All this is logged in `root.log` and usually start with the line `Installing dependencies to satisfy external:*`
As of now, this feature requires [bootstrap chroot](Feature-bootstrap) enabled and requires `create-fake-rpm` to be present (package) in the target chroot.
Available since 2.7

35
docs/Feature-forcearch.md Normal file
View file

@ -0,0 +1,35 @@
---
layout: default
title: Feature forcearch
---
## Forcearch
Previously you were able to only build for compatible architectures. I.e., you can build `i386` package on `x86_64` architecture. When you tried to build for incompatible architecture, you get this error:
```
$ mock -r fedora-28-ppc64le shell
ERROR: Cannot build target ppc64le on arch x86_64, because it is not listed in legal_host_arches ('ppc64le',)
```
Now, you can build for any architecture using a new option --force-arch ARCH. [GH#120](https://github.com/rpm-software-management/mock/issues/120) You have to have installed package `qemu-user-static`, which is a new soft dependence. Try this:
```
$ sudo dnf install qemu-user-static
$ mock -r fedora-28-ppc64le --forcearch ppc64le shell
```
and you get the prompt in PPC64LE Fedora. You can do this for any architecture supported by QEMU.
You got just `INFO` in the log stating:
```
INFO: Unable to build arch ppc64le natively on arch x86_64. Setting forcearch to use software emulation.
```
Note: Do not confuse `--forcearch` and `--arch` which are very different options.
:warning: `qemu-user-static` emulates **user** space, but cannot emulate **kernel** space. If your package need some architecture specific kernel calls or e.g., is parsing output of `lscpu` then this feature is not for you. :(
This has been added to Mock 1.4.11.
Since version 2.0 you do not need to use `--forcearch` as Mock will detect that you want to use different than your native architecture and use qemu-user-static automatically.

View file

@ -0,0 +1,41 @@
---
layout: default
title: Feature modularity support
---
## Modularity support
There is support for Fedora and RHEL Modularity. This requires `dnf`, not merely
`yum`. It is available for RHEL >= 8 and its clones, and built into
all supported releases of Fedora.
The new modularity format was added with release 2.4 and uses
`module_setup_commands`. Each command can be specified multiple times,
and mock respects the order of the commands when executing them.
* Artificial example:
* Disable any potentially enabled postgresql module stream.
* Enable _specific_ postgresql and ruby module streams.
* Install the development nodejs profile and (4) disable it immediately.
```
config_opts['module_setup_commands'] = [
('disable', 'postgresql'),
('enable', 'postgresql:12, ruby:2.6'),
('install', 'nodejs:13/development'),
('disable', 'nodejs'),
]
```
The obsolete, less flexible, but still available modularity syntax was added in Mock 1.4.2.
```
config_opts['module_enable'] = ['list', 'of', 'modules']
config_opts['module_install'] = ['module1/profile', 'module2/profile']
```
This would call these steps during the init phase.
* `dnf module enable list of modules`
* `dnf module install module1/profile module2/profile`
You can find more about this obsolete format in this comprehensive blogpost.
* [Modularity Features in Mock](http://frostyx.cz/posts/modularity-features-in-mock).

20
docs/Feature-nosync.md Normal file
View file

@ -0,0 +1,20 @@
---
layout: default
title: Feature nosync
---
# Nosync
One of the reasons why mock has always been quite slow is because installing a lot of packages generates a heavy IO load. But the main bottleneck regarding IO is not unpacking files from packages to disk but writing Yum DB entries. Yum DB access (used by both yum and dnf) generates a lot of `fsync`(2) calls. Those don't really make sense in mock because people generally don't try to recover mock buildroots after hardware failure. We discovered that getting rid of `fsync` improves the package installation speed by almost a factor of 4. Mikolaj Izdebski developed a small C library, `nosync`, that is `LD_PRELOAD`ed and replaces the `fsync` family of calls with (almost) empty implementations. I added support for it in mock.
How to activate it?
You need to install the `nosync` package and for multilib systems (`x86_64`), you need versions for both architectures. Then it can be enabled in mock by setting
```
# dnf install nosync
config_opts['nosync'] = True
```
If you cannot install both architectures of nosync (for example on RHEL) and still want mock to use it, you can force its usage. Then expect there can be harmless error messages from ld.so when a 32bit program is executed, but it should otherwise work fine for 64bit binaries. Forcing is done using
```
config_opts['nosync_force'] = True
```
It does require those extra steps to set up but it really pays off quickly.

View file

@ -0,0 +1,39 @@
---
layout: default
title: Feature DNF
---
## DNF
This is default package manager for mock. You can enforce it (e.g. in older Mock) using>
```
config_opts['package_manager'] = 'dnf'
```
## YUM
Yum is still used in RHEL 7 and olders. You can enable it using
```
config_opts['package_manager'] = 'yum'
```
## MicroDNF
MicroDNF is written in C and does not need Python. It is present in minimal OCI containers. It can be enabled using:
```
config_opts['package_manager'] = 'microdnf'
```
However, MicroDNF still [does not have `buildep` command](https://github.com/rpm-software-management/microdnf/issues/82). The current implementation still installs DNF (using microdnf) and use DNF to query the build deps.
You can use following options in the config:
```python
config_opts['microdnf_command'] = '/usr/bin/microdnf'
# "dnf-install" is special keyword which tells mock to use install but with DNF
config_opts['microdnf_install_command'] = 'dnf-install microdnf dnf dnf-plugins-core distribution-gpg-keys'
config_opts['microdnf_builddep_command'] = '/usr/bin/dnf'
config_opts['microdnf_builddep_opts'] = []
config_opts['microdnf_common_opts'] = []
```

View file

@ -0,0 +1,44 @@
---
layout: default
title: Feature RHEL chroots
---
## Build package for RHEL
Previously, when you had to build a package for RHEL you had to use `epel-7-x86_64` chroot (or similar). This chroot is made of CentOS plus EPEL. This causes a problem when you want to use real RHEL for some reason. E.g., when new RHEL is out, but CentOS not yet.
To build for RHEL you have to [Red Hat subscription](https://www.redhat.com/en/store/linux-platforms). You can use your existing subscription or you can use [free of charge subscription](https://developers.redhat.com/blog/2016/03/31/no-cost-rhel-developer-subscription-now-available/).
### Mock RHEL configs
Mock provides `rhel-<RELEASEVER>-<TARGET_ARCH>` configs which use pure RHEL.
There are also `rhel+epel-<RELEASEVER>-<TARGET_ARCH>` configs which use RHEL plus EPEL.
### Subscription configuration with Simple Content Access
If you have [Simple Content Access](https://access.redhat.com/articles/simple-content-access#how-do-i-enable-simple-content-access-for-red-hat-subscription-management-2) enabled,
all you need to do is register the machine you are running mock on.
The register command will prompt you for your username and password.
```
$ sudo subscription-manager register
```
After this the RHEL mock configs should work without further action.
```
$ mock -r rhel-9-x86_64 --shell
```
Optionally, you can disable the subscription-manager dnf plugin if you do not need subscription repos directly on your machine.
```sh
$ sudo subscription-manager config --rhsm.auto_enable_yum_plugins 0
$ sudo sed -e '/^enabled=/ s/1/0/' -i /etc/dnf/plugins/subscription-manager.conf
```
### Multiple client keys
If there are multiple client keys,
mock takes the first one in `glob("/etc/pki/entitlement/<numeric-part>-key.pem")` output.
But users still generate configure `config_opts['redhat_subscription_key_id']` in mock configuration,
or on command line `--config-opts=redhat_subscription_key_id=<ID>`.

9
docs/Gemfile Normal file
View file

@ -0,0 +1,9 @@
# frozen_string_literal: true
source "https://rubygems.org"
gem 'jekyll'
gem 'jekyll-theme-slate'
gem 'kramdown-parser-gfm'
gem 'webrick'
gem 'jemoji'

116
docs/LICENSE Normal file
View file

@ -0,0 +1,116 @@
CC0 1.0 Universal
Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator and
subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work for the
purpose of contributing to a commons of creative, cultural and scientific
works ("Commons") that the public can reliably and without fear of later
claims of infringement build upon, modify, incorporate in other works, reuse
and redistribute as freely as possible in any form whatsoever and for any
purposes, including without limitation commercial purposes. These owners may
contribute to the Commons to promote the ideal of a free culture and the
further production of creative, cultural and scientific works, or to gain
reputation or greater distribution for their Work in part through the use and
efforts of others.
For these and/or other purposes and motivations, and without any expectation
of additional consideration or compensation, the person associating CC0 with a
Work (the "Affirmer"), to the extent that he or she is an owner of Copyright
and Related Rights in the Work, voluntarily elects to apply CC0 to the Work
and publicly distribute the Work under its terms, with knowledge of his or her
Copyright and Related Rights in the Work and the meaning and intended legal
effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not limited
to, the following:
i. the right to reproduce, adapt, distribute, perform, display, communicate,
and translate a Work;
ii. moral rights retained by the original author(s) and/or performer(s);
iii. publicity and privacy rights pertaining to a person's image or likeness
depicted in a Work;
iv. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(a), below;
v. rights protecting the extraction, dissemination, use and reuse of data in
a Work;
vi. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation thereof,
including any amended or successor version of such directive); and
vii. other similar, equivalent or corresponding rights throughout the world
based on applicable law or treaty, and any national implementations thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention of,
applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and
unconditionally waives, abandons, and surrenders all of Affirmer's Copyright
and Related Rights and associated claims and causes of action, whether now
known or unknown (including existing as well as future claims and causes of
action), in the Work (i) in all territories worldwide, (ii) for the maximum
duration provided by applicable law or treaty (including future time
extensions), (iii) in any current or future medium and for any number of
copies, and (iv) for any purpose whatsoever, including without limitation
commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes
the Waiver for the benefit of each member of the public at large and to the
detriment of Affirmer's heirs and successors, fully intending that such Waiver
shall not be subject to revocation, rescission, cancellation, termination, or
any other legal or equitable action to disrupt the quiet enjoyment of the Work
by the public as contemplated by Affirmer's express Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason be
judged legally invalid or ineffective under applicable law, then the Waiver
shall be preserved to the maximum extent permitted taking into account
Affirmer's express Statement of Purpose. In addition, to the extent the Waiver
is so judged Affirmer hereby grants to each affected person a royalty-free,
non transferable, non sublicensable, non exclusive, irrevocable and
unconditional license to exercise Affirmer's Copyright and Related Rights in
the Work (i) in all territories worldwide, (ii) for the maximum duration
provided by applicable law or treaty (including future time extensions), (iii)
in any current or future medium and for any number of copies, and (iv) for any
purpose whatsoever, including without limitation commercial, advertising or
promotional purposes (the "License"). The License shall be deemed effective as
of the date CC0 was applied by Affirmer to the Work. Should any part of the
License for any reason be judged legally invalid or ineffective under
applicable law, such partial invalidity or ineffectiveness shall not
invalidate the remainder of the License, and in such case Affirmer hereby
affirms that he or she will not (i) exercise any of his or her remaining
Copyright and Related Rights in the Work or (ii) assert any associated claims
and causes of action with respect to the Work, in either case contrary to
Affirmer's express Statement of Purpose.
4. Limitations and Disclaimers.
a. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
b. Affirmer offers the Work as-is and makes no representations or warranties
of any kind concerning the Work, express, implied, statutory or otherwise,
including without limitation warranties of title, merchantability, fitness
for a particular purpose, non infringement, or the absence of latent or
other defects, accuracy, or the present or absence of errors, whether or not
discoverable, all to the greatest extent permissible under applicable law.
c. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without limitation
any person's Copyright and Related Rights in the Work. Further, Affirmer
disclaims responsibility for obtaining any necessary consents, permissions
or other rights required for any use of the Work.
d. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to this
CC0 or use of the Work.
For more information, please see
<http://creativecommons.org/publicdomain/zero/1.0/>

70
docs/Mock-Core-Configs.md Normal file
View file

@ -0,0 +1,70 @@
---
layout: default
title: Mock Core Configs
---
# Mock core configs
Mock project provides the `mock-core-configs` package which installs the default
[configuration files](configuration) for various RPM-based Linux distributions.
This packages is typically installed with Mock by default (runtime dependency).
Other projects can provide their own configuration files in other packages, we
know of:
* [mock-core-configs](https://github.com/rpm-software-management/mock/tree/main/mock-core-configs) (this project)
* [mock-centos-sig-configs](https://pagure.io/centos-sig-hyperscale/mock-centos-sig-configs)
* [RPM Fusion Mock conifgs](https://github.com/rpmfusion-infra/mock-rpmfusion)
## Maintenance
The configuration in this package maintained by the community.
When encountering an issue please use your best judgement to decide
whether a Mock config is broken, or the distribution is broken.
#### Mock config issues
If a Mock config is broken (e.g. [#756][mock-756]), please
[create a ticket for this repository][mock-issues]
and tag the responsible maintainer from the table below.
#### Distribution or repository issues
If a distribution or repository is broken (e.g. [#889][mock-889]),
please report the issue to the appropriate issue tracker for the
distribution.
#### Table
| Distribution | Chroots | Maintainer | Distribution or repository issue tracker |
| ------------------------------------------------------------------------------ | ----------------- | --------------------------------------------------------------------- | ------------- |
| [AlmaLinux](https://almalinux.org/) | `almalinux-*` | [@Conan-Kudo](https://github.com/Conan-Kudo), [@javihernandez](https://github.com/javihernandez) | [Issues](https://bugs.almalinux.org/) |
| [Amazon Linux 2](https://aws.amazon.com/amazon-linux-2/) | `amazonlinux-2-*` | [@stewartsmith](https://github.com/stewartsmith) | NA |
| [Amazon Linux](https://aws.amazon.com/linux/amazon-linux-2023/) | `amazonlinux-*` | [@amazonlinux](https://github.com/amazonlinux) | [Issues](https://github.com/amazonlinux/amazon-linux-2023/issues) |
| [Anolis](https://openanolis.cn/) | `anolis-*` | [@geliwei-ali](https://github.com/geliwei-ali) | [Issues](https://bugzilla.openanolis.cn/) |
| [Azure Linux](https://github.com/microsoft/azurelinux) | `azure-linux-*` | [@scaronni](https://github.com/scaronni) | [Issues](https://github.com/microsoft/azurelinux/issues) |
| [CentOS Stream](https://www.centos.org/centos-stream/) | `centos-stream*` | [Mock team][] | [Issues](https://issues.redhat.com/projects/CS) |
| [CentOS Linux](https://www.centos.org/centos-linux/) | `centos*` | End-of-life. | End-of-life. |
| [Circle Linux](https://cclinux.org/) | `circlelinux-*` | [@bella485](https://github.com/bella485) | [Issues](https://bugzilla.cclinux.org/) |
| [EuroLinux](https://en.euro-linux.com/) | `eurolinux-*` | End-of-life. | End-of-life. |
| [Fedora ELN](https://docs.fedoraproject.org/en-US/eln/) | `fedora-eln-*` | [@fedora-eln](https://github.com/fedora-eln) | [Issues](https://github.com/fedora-eln/eln/issues) |
| [Fedora](https://fedoraproject.org/) | `fedora-*` | [Mock team][] | [Issues](https://github.com/rpm-software-management/mock/issues) |
| [Kylin](https://kylinos.cn/) | `kylin-*` | [@scaronni](https://github.com/scaronni) | NA |
| [Mageia](https://www.mageia.org/en/) | `mageia-*` | [@Conan-Kudo](https://github.com/Conan-Kudo) | [Issues](https://bugs.mageia.org/) |
| [Navy Linux](https://navylinux.org/) | `navy-*` | [@unixlabs](https://github.com/unixlabs) | [issues](https://github.com/navy-linux/issue-tracker/issues) |
| [openEuler](https://www.openeuler.org/en/) | `openeuler-*` | [@Yikun](https://github.com/Yikun) | NA |
| [OpenMandriva](https://www.openmandriva.org/) | `openmandriva-*` | [berolinux](https://github.com/berolinux) | [Issues](https://github.com/OpenMandrivaAssociation/distribution/issues) |
| [openSUSE](https://www.opensuse.org/) | `opensuse-*` | [@Conan-Kudo](https://github.com/Conan-Kudo), [@lkocman](https://github.com/lkocman) | [Issues](https://bugzilla.opensuse.org/) |
| [Oracle Linux](https://www.oracle.com/linux/) | `oraclelinux-*` | [@Mno-hime](https://github.com/Mno-hime), [sharewax](https://github.com/sharewax), [Djelibeybi](https://github.com/Djelibeybi) | [issues](https://github.com/oracle/oracle-linux/issues) |
| [RHEL](https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux)| `rhel-*` | [Mock team][] | [Issues](https://issues.redhat.com/projects/RHEL) |
| [Rocky Linux](https://rockylinux.org/) | `rocky-*` | [@nazunalika](https://github.com/nazunalika) | [Issues](https://bugs.rockylinux.org/) |
[Mock team]: https://github.com/orgs/rpm-software-management/teams/mock-team
[mock-issues]: https://github.com/rpm-software-management/mock/issues
[mock-756]: https://github.com/rpm-software-management/mock/issues/756
[mock-889]: https://github.com/rpm-software-management/mock/issues/889

55
docs/Plugin-BindMount.md Normal file
View file

@ -0,0 +1,55 @@
---
layout: default
title: Plugin BindMount
---
This plugin enables setting up bind mountpoints inside the chroot. It is enabled by default but has no paths setup for bind mounts.
## Configuration
In your config file insert the following lines:
config_opts['plugin_conf']['bind_mount_enable'] = True
config_opts['plugin_conf']['bind_mount_opts']['dirs'].append(('/host/path', '/bind/mount/path/in/chroot/' ))
The `/host/path` is the path to a directory on the host that will be the source of a bind-mount, while the `/bind/mount/path/in/chroot` is the path where it will be mounted inside the chroot.
Starting from version 1.4.10 it will work for files too. Just be aware that files are still put in 'dirs' directive. E.g.,
config_opts['plugin_conf']['bind_mount_opts']['dirs'].append(('/host/path/file.txt', '/bind/mount/path/in/chroot/file.txt' ))
If you want the bind mounts to be available to all configurations, edit [the configuration file](Home#generate-custom-config-file).
### `/builddir/` cleanup
**WARNING!** The build user's homedir (`/builddir`) is partially cleaned up even when `--no-clean` is
specified in order to prevent garbage from previous builds from altering
successive builds. Mock can be configured to exclude certain files/directories
from this. Default is `SOURCES` directory to support nosrc rpms:
config_opts['exclude_from_homedir_cleanup'] = ['build/SOURCES']
Paths are relative to build user's homedir.
So if you do something like this:
config_opts['plugin_conf']['bind_mount_opts']['dirs'].append((os.path.expanduser('~/MyProject'), '/builddir/MyProject' ))
Then you SHOULD do:
config_opts['exclude_from_homedir_cleanup'] = ['build/SOURCES', 'MyProject']
otherwise your `~/MyProject` will be wiped out!
Other option is to not mount it under `/builddir`, but somewhere else (`/opt`, `/mnt`...).
***
Set options from command line
```
mock '--plugin-option=bind_mount:dirs=[("/host/dir", "/mount/path/in/chroot/")]' --init
```
:warning: Note that command line arguments override configs (not append them).
:notebook: Since version mock-1.4.10 and newer you can bind mount even single files.

View file

@ -0,0 +1,48 @@
---
layout: default
title: Plugin buildroot_lock
---
buildroot_lock Plugin
=====================
This plugin generates an additional build artifact—the buildroot *lockfile*
(`buildroot_lock.json` file in the result directory).
The *lockfile* describes both the list of buildroot sources (e.g., a list of
installed RPMs, bootstrap image info, etc.) and a set of Mock configuration
options. Using this information, Mock can later reproduce the buildroot
preparation (see the [Hermetic Builds feature page](feature-hermetic-builds)).
This plugin is **disabled** by default but is automatically enabled with the
`--calculate-build-dependencies` option. You can enable it (for all builds) by
this configuration snippet:
```python
config_opts['plugin_conf']['buildroot_lock_enable'] = True
```
**Note:** This plugin does not work with the `--offline` option.
Format of the *buildroot_lock.json* file
----------------------------------------
The file `buildroot_lock.json` is a JSON file. List of JSON Schema files is
installed together with the Mock RPM package:
rpm -ql mock | grep schema
/usr/share/doc/mock/buildroot-lock-schema-1.0.0.json
/usr/share/doc/mock/buildroot-lock-schema-1.1.0.json
Currently, we do not provide a compatibility promise. Only the exact same
version of Mock that produced the file is guaranteed to read and process it.
For more information, see [Hermetic Builds](feature-hermetic-builds).
Also, in the future we plan to switch to a standardized tooling so we operate
with a standardized format, too. For more info see the [DNF5 feature
request][discussion], [rpm-lockfile-prototype][] and [libpkgmanifest][].
[discussion]: https://github.com/rpm-software-management/dnf5/issues/833
[rpm-lockfile-prototype]: https://github.com/konflux-ci/rpm-lockfile-prototype
[libpkgmanifest]: https://github.com/rpm-software-management/libpkgmanifest

46
docs/Plugin-CCache.md Normal file
View file

@ -0,0 +1,46 @@
---
layout: default
title: Plugin CCache
---
The ccache plugin is a compiler cache plugin. It is disabled by default and has an upper limit of 4GB of ccache data.
Note: this plugin was enabled by default in mock-1.2.14 and older.
## Configuration
The ccache plugin is disabled by default and has the following values built-in:
```python
config_opts['plugin_conf']['ccache_enable'] = False
config_opts['plugin_conf']['ccache_opts']['max_cache_size'] = '4G'
config_opts['plugin_conf']['ccache_opts']['compress'] = None
config_opts['plugin_conf']['ccache_opts']['dir'] = "%(cache_topdir)s/%(root)s/ccache/u%(chrootuid)s/"
config_opts['plugin_conf']['ccache_opts']['hashdir'] = True
config_opts['plugin_conf']['ccache_opts']['debug'] = False
config_opts['plugin_conf']['ccache_opts']['show_stats'] = False
```
To turn on ccache compression, use the following in a config file:
```python
config_opts['plugin_conf']['ccache_opts']['compress'] = 'on'
```
The value specified is not important, this just triggers the setting of the CCACHE_COMPRESS environment variable, which is what the ccache program uses to determine if compression of cache elements is desired.
Setting `hashdir` to `False` 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][]https://github.com/rpm-software-management/mock/issues/1395)
See [ccache documentation](https://ccache.dev/manual/4.10.html#config_hash_dir).
This option is available since Mock 5.7.
Setting `debug` to `True` creates per-object debug files that are helpful when debugging unexpected cache misses.
See [ccache documentation](https://ccache.dev/manual/4.10.html#config_debug).
This option is available since Mock 5.7.
If `show_stats` is set to True, Mock calls `ccache --zero-stats` first (before
doing the build), and then calls `ccache --show-stats`.
This option is available since Mock v5.7+.

27
docs/Plugin-ChrootScan.md Normal file
View file

@ -0,0 +1,27 @@
---
layout: default
title: Plugin Chroot Scan
---
The chroot_scan plugin is used to grab files of interest after a build attempt and copy them to the 'result directory' before the chroot is cleaned and data lost.
## Configuration
The chroot_scan plugin is disabled by default. To enable it and to add files to the detection logic, add this code to configure file:
```python
config_opts['plugin_conf']['chroot_scan_enable'] = True
config_opts['plugin_conf']['chroot_scan_opts']['regexes'] = [
"core(\.\d+)?",
"\.log$",
]
config_opts['plugin_conf']['chroot_scan_opts']['only_failed'] = True
config_opts['plugin_conf']['chroot_scan_opts']['write_tar'] = False
```
The above logic turns on the chroot_scan plugin and adds corefiles and log files to the scan plugin. When the 'postbuild' hook is run by mock, the chroot_scan will look through the chroot for files that match the regular expressions in it's list and any matching file will be copied to the mock result directory for the config file. Again if you want this to be enabled across all configs, edit the `/etc/mock/site-defaults.cfg` file.
When `only_failed` is set to False, then those files are always copied. When it is set to True (default when plugin enabled), then those files are only copied when build failed.
When `write_tar` is set to True, then instead of `chroot_scan` directory, `chroot_scan.tar.gz` is created with the directory archive.
The `only_failed` option is available since v1.2.8, `write_tar` since v5.5.

View file

@ -0,0 +1,20 @@
---
layout: default
title: Plugin Compress Logs
---
This plugin compresses logs created by Mock in the result directory (build.log,
hw_info.log, installed_pkgs.log, root.log and state.log).
This plugin is **disabled** by default.
## Configuration
To compress your logs with XZ, you can put this into the
[configuration](configuration):
```python
config_opts['plugin_conf']['compress_logs_enable'] = True
config_opts['plugin_conf']['compress_logs_opts']['command'] = "/usr/bin/xz -9"
```
This plugin is available since mock-1.2.1.

View file

@ -0,0 +1,64 @@
---
layout: default
title: Plugin export_buildroot_image
---
This plugin allows you to (on demand) export the Mock chroot as an OCI image in
local archive format (tarball). This tarball can provide additional convenience
for local build reproducibility. See the example below for details.
By default, this plugin is **disabled**. You can enable it using the
`--enable-plugin export_buildroot_image` option in `--rebuild` mode.
This plugin has been added in Mock v6.0.
## Example use-case
First, let's start a standard Mock build, but enable the OCI archive generator:
$ mock -r fedora-rawhide-x86_64 --enable-plugin export_buildroot_image \
/tmp/quick-package/dummy-pkg-20241212_1114-1.src.rpm
... mock installs all build-deps, and does other chroot tweaks ...
Start: producing buildroot as OCI image
... mock performs the rpmbuild ...
INFO: Results and/or logs in: /var/lib/mock/fedora-rawhide-x86_64/result
Finish: run
The archive has been saved in the result directory:
$ ls /var/lib/mock/fedora-rawhide-x86_64/result/*.tar
/var/lib/mock/fedora-rawhide-x86_64/result/buildroot-oci.tar
You may use this tarball together with [the `--buildroot-image` option
then](Feature-buildroot-image). But also, you can try re-running the
build without Mock, like this:
$ chmod a+r /tmp/quick-package/dummy-pkg-20241212_1114-1.src.rpm
$ podman run --rm -ti \
-v /tmp/quick-package/dummy-pkg-20241212_1114-1.src.rpm:/dummy-pkg.src.rpm:z \
oci-archive:/var/lib/mock/fedora-rawhide-x86_64/result/buildroot-oci.tar \
rpmbuild --rebuild /dummy-pkg.src.rpm
Installing /dummy-pkg.src.rpm
setting SOURCE_DATE_EPOCH=1401926400
Executing(%mkbuilddir): /bin/sh -e /var/tmp/rpm-tmp.XIm441
...
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.pqJ9hu
...
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.iaeMZG
...
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.SHktaE
...
Processing files: dummy-pkg-20241212_1114-1.fc42.x86_64
...
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.E71FWH
...
+ exit 0
**Warning:** This method of reproducing a Mock build is not recommended for
production use. During a normal/full Mock rebuild, Mock ensures the buildroot
is fully up-to-date. Using just plain `rpmbuild` within Podman may result in
outdated files, different structure in the kernel-driven filesystems like
`/proc`, `/dev`, and `/sys`, different SELinux assumptions, permissions, etc.
Proceed with caution, and be prepared to encounter some differences (and perhaps
different build failures).

37
docs/Plugin-Hooks.md Normal file
View file

@ -0,0 +1,37 @@
---
layout: default
title: Plugin Hooks
---
When you develop a new plugin, you can register your hook with:
plugins.add_hook("HOOK_NAME", self.your_method)
Where `HOOK_NAME` is one of:
* clean
* earlyprebuild - This is called during the very early stage of building RPM or SRPM. It is called even before SRPM is rebuilt or build dependencies have been installed.
* initfailed
* list_snapshots - when `--list-snapshots` or `-l` option is passed on command line, this hook is being called and then Mock exits.
* make_snapshot
* mount_root - This hook is intended for plugins which mount the chroot directory. This is called just before 'preinit' when only chroot directory exists. Result directory does not exist yet.
* postbuild - This hook is called just after RPM or SRPM have been build (with or without success).
* postchroot - This hook is called just after exiting from command in `mock chroot` command. This action is currently being used by `root_cache` plugin.
* postclean - This hook is called when the content of the chroot has been deleted. It is called after `umount_root`. E.g., `lvm_root` use this to delete the LVM volume.
* postdeps - Called when the build dependencies (both static and dynamic) are installed, but the build has not started, yet.
* postinit - Chroot have been initialized and it is ready for installing SRPM dependencies. E.g., root_cache plugin now packs the chroot and put it in a cache. This action is currently being used by `bind_mount`, `lvm_root`, `mount`, `root_cache` plugins.
* postshell - This hook is called just after exiting from the shell in `mock shell` command. This action is currently being used by `root_cache` plugin.
* postupdate - Mock attempts to cache buildroot contents, but tries to automatically update the packages inside the buildroot in subsequent executions (so up2date packages are used during build). This hook is called anytime such update is successful and any package is updated inside the buildroot. Any plugin taking care of the buildroot caches can then react and update the cache to avoid re-updating in the subsequent mock runs.
* postumount - This hook is called when everything in chroot finished or has been killed. All inner mounts have been umounted. E.g., tmpfs plugin uses this to umount tmpfs chroot. This action is currently being used by `lvm_root`, `tmpfs` plugins.
* postyum - This hook is called after any packager manager action is executed. This is e.g., used by the `package_state` plugin to list all available packages. This action is currently being used by `package_state`, `root_cache`, `selinux`, `yum_cache` plugins.
* prebuild - This hook is called after `BuildRequires` have been installed, but before RPM builds. This is not called for SRPM rebuilds.
* prechroot - This hook is called just before executing a command when `mock chroot` command has been used. This action is currently being used by `root_cache` plugin.
* preinit - Only chroot and result_dir directories exist. There may be no other content. No binary. Not even base directories. Root_cache plugin uses this hook to populate the content of chroot_from cache. HW_info gather information about hardware and store it in result_dir. This action is currently being used by `ccache`, `hw_info`, `root_cache`, `yum_cache` plugins.
* preshell - This hook is called just before giving a prompt to a user when `mock shell` command has been used. This action is currently being used by `pm_request`, `root_cache` plugins.
* preyum - This hook is called before any packager manager action is executed. This is, e.g., used by `root_cache` plugin when `--cache-alterations` option is used. This action is currently being used by `root_cache`, `selinux`, `yum_cache`.
* process_logs - Called once the build log files (root.log, build.log, ...) are completed so they can be processed (e.g. compressed by the `compress_logs` plugin).
* remove_snapshot
* rollback_to
* scrub
You can get inspired by existing [plugins](https://github.com/rpm-software-management/mock/tree/master/mock/py/mockbuild/plugins).

20
docs/Plugin-HwInfo.md Normal file
View file

@ -0,0 +1,20 @@
---
layout: default
title: Plugin HwInfo
---
This plugin allows prints your basic hardware information, which may help identify problems or reproduced the build.
It print information about CPU, memory (including swap) and storage (only of volume where chroot will be stored).
The information is stored in file hw_info.log in results directory.
## Configuration
You can enable the plugin using this settings:
```python
config_opts['plugin_conf']['hw_info_enable'] = True
config_opts['plugin_conf']['hw_info_opts'] = {}
```
Available since version 1.3.4.
This plugin is enabled by default.

101
docs/Plugin-LvmRoot.md Normal file
View file

@ -0,0 +1,101 @@
---
layout: default
title: Plugin LVM Root
---
Mock can use LVM as a backend for caching buildroots which is a bit faster than using root_cache and enables efficient snapshotting (copy-on-write). This feature is intended to be used by people who maintain a lot packages and find themselves waiting for mock to install the same set of `BuildRequires` over and over again.
Mock uses LVM thin provisioning which means that one logical volume (called
thinpool) can hold all thin logical volumes and snapshots used by all
buildroots (you have to set it like that in the config) without each of them
having fixed size. Thinpool is created by mock when it's starts initializing
and after the buildroot is initialized, it creates a postinit snapshot which
will be used as default. Default snapshot means that when you execute clean or
start a new build without `--no-clean` option, mock will rollback to the state in default snapshot. As you install more packages you can create your own snapshots (usually for dependency chains that are common to many of your packages).
## Expected workflow
You have multiple packages that all depend on something with big dependency chain, for example Java packages depend on maven-local, therefore it may be useful to create snapshot that would contain maven-local. With the next steps, you install the package and create the snapshot
mock --install maven-local
mock --snapshot mvn
Now there should be two snapshots - the initial one and the one you just created. You can verify it with the list-snapshots command (Note it also has short option `-l`)
mock --list-snapshots
Snapshots for fedora-20-x86_64:
postinit
* mvn
The new one is marked with an asterisk, which means it will be used as the default snapshot to which `--clean` will rollback whenever you build another package. When you want to rebuild a package that doesn't use maven-local, you can use
mock --rollback-to postinit
and the initial snapshot will be used for following builds. The mvn snapshot will still exist, so you can get back to it later using
mock --rollback-to mvn
To get delete a snapshot completely, use
mock --remove-snapshot mvn
Mock will leave the buildroot volume mounted by default (you can override it in the config), so you can easily access the build directory. When you need to umount it, use
mock --umount
To getting rid of LVM volumes completely, use
mock --scrub lvm
This will delete all volumes belonging to the current config and also the thinpool if and only if there are no other volumes left by other configurations.
## Setup
The plugin is distributed as separate subpackage `mock-lvm` because it pulls in additional dependencies which are not available on RHEL6.
You need to specify a volume group which mock will use to create it's thinpool. Therefore you need to have some unoccupied space in your volume group, so you'll probably need to shrink some partition a bit. Mock won't touch anything else in the VG, so don't be afraid to use the VG you have for your system. It won't touch any other logical volumes in the VG that don't belong to it.
## Configuration
```python
config_opts['plugin_conf']['root_cache_enable'] = False
config_opts['plugin_conf']['lvm_root_enable'] = True
config_opts['plugin_conf']['lvm_root_opts'] = {
'volume_group': 'my-volume-group',
'size': '8G',
'pool_name': 'mock',
'check_size': True,
}
```
Explanation: You need to disable root_cache - having two caches with the same contents would just slow you down. You need to specify a size for the thinpool. It can be shared across all mock buildroots so make sure it's big enough. Ideally there will be just one thinpool. Then specify name for the thinpool - all configs which have the same pool_name will share the thinpool, thus being more space-efficient. Make sure the name doesn't clash with existing volumes in your system (you can list existing volumes with lvs command).
Every run, the plugin write usage of data pool and metadata pool.
When utilization is over 75 % then plugin emit warning.
Usage over 90 % is fatal and mock stop with error, but it can be override by
config_opts['plugin_conf']['lvm_root_opts']['check_size'] = False
However this override is strongly discouraged as LVM2 have known error when thinpool is full.
### Other configuration options
`config_opts['plugin_conf']['lvm_root_opts']['poolmetadatasize']` - specifies separate size of the thinpool metadata. It needs to be big enough, thinpool with overflown metadata will become corrupted. When unspecified, the default value is determined by LVM
`config_opts['plugin_conf']['lvm_root_opts']['umount_root']` -
boolean option specifying whether the buildroot volume should stay mounted after mock exits. Default is `True`
`config_opts['plugin_conf']['lvm_root_opts']['filesystem']` -
filesystem name that will be used for the volume. It will use
`mkfs.$filesystem` binary to create it. Default is `ext4`
`config_opts['plugin_conf']['lvm_root_opts']['mkfs_command']` - the whole command for creating the filesystem that will get the volume path as an argument. When set, overrides above option.
`config_opts['plugin_conf']['lvm_root_opts']['mkfs_args']` - additional arguments passed to mkfs command. Default is empty.
`config_opts['plugin_conf']['lvm_root_opts']['mount_opts']` - will
be passed to `-o` option of mount when mounting the volume. Default is empty.
`config_opts['plugin_conf']['lvm_root_opts']['mount_opts']` - Let user configure mock to wait more patiently for LVM initialization. `lvs' call can be quite expensive, especially when there are hundreds of volumes and multiple parallel mocks waiting for common LVM initialization to complete. (Added in version 1.4.3)
Note: You can not combine Tmpfs plugin and Lvm_root plugin, because it is not possible to mount Logical Volume as tmpfs.

50
docs/Plugin-Mount.md Normal file
View file

@ -0,0 +1,50 @@
---
layout: default
title: Plugin Mount
---
This plugin allows you to mount directories into chroot. The mount plugin is enabled by default, but has no configured directories to mount.
## Configuration
You can disable this plugin by:
```python
config_opts['plugin_conf']['mount_enable'] = False
```
You can configure this plugin by:
```python
config_opts['plugin_conf']['mount_enable'] = True
config_opts['plugin_conf']['mount_opts']['dirs'].append(("/dev/device", "/mount/path/in/chroot/", "vfstype", "mount_options"))
```
A real life example:
```python
config_opts['plugin_conf']['mount_opts']['dirs'].append(("server.example.com:/exports/data", "/mnt/data", "nfs", "rw,hard,intr,nosuid,nodev,noatime,tcp"))
```
### `/builddir/` cleanup
**WARNING!** The build user's homedir (`/builddir`) is partially cleaned up even when `--no-clean` is
specified in order to prevent garbage from previous builds from altering
successive builds. Mock can be configured to exclude certain files/directories
from this. Default is `SOURCES` directory to support nosrc rpms:
```python
config_opts['exclude_from_homedir_cleanup'] = ['build/SOURCES']
```
Paths are relative to build user's homedir.
So if you do something like this:
```python
config_opts['plugin_conf']['bind_mount_opts']['dirs'].append((os.path.expanduser('~/MyProject'), '/builddir/MyProject' ))
```
Then you SHOULD do:
```python
config_opts['exclude_from_homedir_cleanup'] = ['build/SOURCES', 'MyProject']
```
otherwise your `~/MyProject` will be wiped out!
Other option is to not mount it under `/builddir`, but somewhere else (`/opt`, `/mnt`...).

77
docs/Plugin-Overlayfs.md Normal file
View file

@ -0,0 +1,77 @@
---
layout: default
title: Plugin OverlayFS
---
This plugin implements mock's snapshot functionality using overlayfs. From a user perspective, it works similar to LVM plugin, but unlike LVM plugin, it only needs a directory (not a volume group) for its data (snapshots). Plugin has no additional dependencies, it only requires a kernel with overlayfs support, but this is the case for both current Fedora and RHEL-7.
## Configuration
You can enable overlayfs plugin by adding this line to your configuration:
```python
config_opts['plugin_conf']['overlayfs_enable'] = True
```
It is recommended to disable root_cache plugin when overlayfs plugin is enabled. (Plugin does implicit snapshot named "postinit" after init phase similarly to LVM plugin, which makes root cache pointless)
```python
config_opts['plugin_conf']['root_cache_enable'] = False
```
Base directory sets directory, where places all its data (snapshots etc.) are placed. Multiple configurations can share base directory (every configuration will have its own directory there).
```python
config_opts['plugin_conf']['overlayfs_opts']['base_dir'] = "/some/directory"
```
Enabling touch_rpmd option causes the plugin to implicitly "touch" rpm database files after each mount overcoming issue with rpm/mock, caused by limitations of overlayfs. Option may be useful only when running yum/rpm directly. However, it is not necessary when using package-manager related mock commands (e.g., mock --install). For more details see the section: Limitations of overlayfs (lower).
Default: false
```python
config_opts['plugin_conf']['overlayfs_opts']['touch_rpmdb'] = True
```
## Usage
As said earlier, plugins allow you to use mock's snapshot functionality. Snapshots hold the state of (current config's) root fs, which can be recovered later.
To create snapshot run:
mock --snapshot [name]
You can then return to snapshot created earlier by running (It also makes that snapshot current for clean operation):
mock --rollback-to [name]
To list snapshots use:
mock --list-snapshots
Clean operation discards changes done "on top" of current snapshot. ( basically restores current snapshot ). As noted earlier, plugin implicitly creates a snapshot after init phase. So, if no user snapshots are done, plugin behaves more or less as root cache:
mock --clean # restores current snapshot
To remove all plugin's data associated with configuration (and therefore snapshots), use:
mock --scrub overlayfs
Alternatively, you can remove everything from current configuration:
mock --scrub all
You can also see more examples of snapshot commands usage in [LVM plugin wiki page](https://rpm-software-management.github.io/mock/Plugin-LvmRoot)
( Difference is, that LVM plugin keeps root mounted, while overlayfs not. )
## Shortly about overlayfs filesystem
Overlayfs is pseudo-filesystem in a kernel, which allows to place multiple directories on each other (as overlays) and combine them to a single filesystem. Upper directory and lower directory(ies) are supplied to mount command as the options. Files from lower files are visible, but all writes happen in a upper layer. Deleted files are represented by special files. For more details see [filesystem's documentation](https://www.kernel.org/doc/Documentation/filesystems/overlayfs.txt) This plugin uses overlayfs to implement snapshots.
## Notes about the implementation of snapshots
To avoid confusion (in some cases), snapshots as displayed by mock (when using this plugin) should be understood more like references/aliases to actual physical snapshots (internally called LAYERS). This means you can have multiple names for a single physical snapshot (LAYER). This also means, you can see multiple snapshots marked as current when listing snapshots (by mock). This can happen because layers are created lazily, so new LAYER is not allocated immediately after creating a snapshot, but prior to mount. So, for example, when 2 snapshots are done, and no mock action, which requires mount, is done in between, they will point to the same LAYER (expected, no changes have been done; same applies for snapshots created after restoring snapshot and after a clean operation). However, a user can still safely delete just one of these. This is possible because LAYERS are reference counted. So you just remove reference (alias), but LAYER (holding actual snapshot's data) is only deleted when no longer referenced. Apart from user-visible references, it may be referenced by other LAYERS (by ones based on it) and by "current state" (special references)). So, it is safe to remove any "snapshot" (as seen by mock), even current one, without having to worry about "breaking" the mock. If you are interested in even more implementation details, see detailed documentation in plugin's [source file](https://github.com/rpm-software-management/mock/blob/devel/mock/py/mockbuild/plugins/overlayfs.py) or maybe even [test file](https://github.com/rpm-software-management/mock/blob/devel/mock/tests/overlayfs_layers_test.py) (where LAYERS are tested).
## Limitations of overlayfs
Overlayfs has known limitations when it comes to POSIX compatibility. This may cause problems with some programs. The problem happens, when a file from the lower layer (directory) is open for writing (forcing overlayfs copy it to upper layer), while the same file is opened read-only. Open file descriptors then point to different files. Rpm/yum are known to be affected by this issue. See:
[yum/rpm bug on RH bugzilla](https://bugzilla.redhat.com/show_bug.cgi?id=1213602)
[docker overlayfs-driver page](https://docs.docker.com/storage/storagedriver/overlayfs-driver/#limitations-on-overlayfs-compatibility)
So, this is not a bug in the plugin. It is caused by nature/design decisions made in overlafs filesystem (and documented). Problem is work-arounded automatically for package manager related operations done using mock (e.g. mock --install). When running yum/rpm manually, an option can be used to overcome the issue automatically (see higher). If you find another program(s) affected by this issue, you should be able to work-around this simply by "touching" problematic files(s) prior to running that program.
touch /some/file # using mock --shell or mock --chroot
## Using inside docker
Not tested, but you may need to add additional mount where to place this plugin's base_dir. This is because docker may itself use overlayfs. ( Overlayfs cannot use directories which are part of another overlayfs mount. )

28
docs/Plugin-PMRequest.md Normal file
View file

@ -0,0 +1,28 @@
---
layout: default
title: Plugin PM Request
---
This plugin listens to requests for package management commands from within the buildroot, using a UNIX socket. It can be used by buildsystems, that have support for communicating with this plugin, to automatically install missing packages if they're available. It's not advised to enable it globally as it affects build reproducibility, instead, it's better to enable it per-build using `--enable-plugin pm_request`. If the plugin was used during the build, it emits a warning at the end that summarizes the commands that were executed.
Currently, automatic installation of build dependencies using this plugin is supported by Java packaging tooling when building with Maven, Gradle or Ivy.
## Configuration
To enable it globally, set the following:
```python
config_opts['plugin_conf']['pm_request_enable'] = True
```
To enable it for a single build, use:
mock --rebuild foo-1.0-1.src.rpm --enable-plugin pm_request
## The protocol
The plugin creates a Unix socket in /var/run/mock/pm-request inside of the chroot and will read the commands from the socket. It also exports environment variable PM_REQUEST_SOCKET with value of the socket path.
For single request, it reads a single line from the socket (don't forget the newline, otherwise it will wait for more input) that is parsed using shell-like quoting (via shlex) and passed to current package manager. After the command completes, it responds with a line containing either "ok" or "nok" denoting whether the command was successful. The output of the package management command is then written to the socket and the connection is closed. Example of a request:
install foo
Available since mock-1.2.9

View file

@ -0,0 +1,26 @@
---
layout: default
title: Plugin PackageState
---
This plugin optionally dumps additional metadata files into the result dir:
* A list of all available pkgs + repos + other data. This file is named `available_pkgs.log`. This file is not created if you run mock with `--offline` option.
* A list of all installed pkgs + repos + other data. This file is name `installed_pkgs.log`.
Format of `installed_pkgs.log` file is:
%{nevra} %{buildtime} %{size} %{pkgid} installed
## Configuration
The Package_state plugin is enabled by default.
# in version 1.2.18 and older the default was False
config_opts['plugin_conf']['package_state_enable'] = True
The following sub-options may be turned off/on:
```python
config_opts['plugin_conf']['package_state_opts'] = {}
config_opts['plugin_conf']['package_state_opts']['available_pkgs'] = False
config_opts['plugin_conf']['package_state_opts']['installed_pkgs'] = True
```

22
docs/Plugin-ProcEnv.md Normal file
View file

@ -0,0 +1,22 @@
---
layout: default
title: Plugin ProcEnv
---
This plugin allows prints your build time environment, which may help identify problems or reproduced the build.
It prints information about the entire software build environment, any capabilities, and much more.
The information is stored in file procenv.log in the results directory.
It calls `procenv` command and stores its output.
## Configuration
You can enable the plugin using this settings:
```python
config_opts['plugin_conf']['procenv_enable'] = True
config_opts['plugin_conf']['procenv_opts'] = {}
```
Available since version 1.4.18.
This plugin is DISABLED by default.

37
docs/Plugin-RootCache.md Normal file
View file

@ -0,0 +1,37 @@
---
layout: default
title: Plugin RootCache
---
This plugin caches your buildroots. It creates archive of your buildroot and puts it in `config_opts['plugin_conf']['root_cache_opts']['dir']`, which is be default `/var/cache/mock/NAME_OF_CHROOT/root_cache/cache.tar.gz`. It is enabled by default.
## Configuration
This plugin is enabled by default and has the following values built-in:
```python
config_opts['plugin_conf']['root_cache_enable'] = True
config_opts['plugin_conf']['root_cache_opts'] = {}
config_opts['plugin_conf']['root_cache_opts']['age_check'] = True
config_opts['plugin_conf']['root_cache_opts']['max_age_days'] = 15
config_opts['plugin_conf']['root_cache_opts']['dir'] = "%(cache_topdir)s/%(root)s/root_cache/"
config_opts['plugin_conf']['root_cache_opts']['compress_program'] = "pigz"
config_opts['plugin_conf']['root_cache_opts']['extension'] = ".gz"
config_opts['plugin_conf']['root_cache_opts']['exclude_dirs'] = ["./proc", \
"./sys", "./dev", "./tmp/ccache", "./var/cache/yum" ]
```
* `age_check` - if set to `True` (which is default), then cache date is checked. See option `max_age_days` bellow. Additionally if some config is newer than cache file, then the cache is invalidated as well.
* `max_age_days` - if `age_check` is `True` and cache is older than this value, the cache is invalidated.
* `dir` - where to put cached files.
* `compress_program` - which compress program to use. By default `pigz` is used. If not present, then `gzip` is used.
* `extension` - the cache file is always named as `cache.tar$extension`. When you use different compress program e.g. `bzip2`, you should set different extension e.g. `".bz2"`.
* `exclude_dirs` - list of directories, which should not be archived.
**WARNING:** You should disable `root_cache` plugin when using `lvm_root` plugin - having two caches with the same contents would just slow you down.
**NOTE:** If you have enough disk storage you can speed-up it a bit by disabling archiving of cache:
```python
config_opts['plugin_conf']['root_cache_opts']['compress_program'] = ""
config_opts['plugin_conf']['root_cache_opts']['extension'] = ""
```

13
docs/Plugin-SELinux.md Normal file
View file

@ -0,0 +1,13 @@
---
layout: default
title: Plugin SELinux
---
On SELinux enabled box, this plugin will pretend, that SELinux is disabled in build environment.
* fake /proc/filesystems is mounted into build environment, excluding selinuxfs
* option `--setopt=tsflags=nocontext` is appended to each 'yum' command
This plugin is enabled by default and there is actually no way to disable it.
This plugin is not used with NSPAWN chroot (`--new-chroot` option) and will be removed when NSPAWN chroot will be only one option.

97
docs/Plugin-Scm.md Normal file
View file

@ -0,0 +1,97 @@
---
layout: default
title: Plugin SCM
---
This plugin provides integration to Scm systems (Git, Svn...).
This module does not use the plugin infrastructure of Mock, it is provided as a standalone package instead, mock-scm, so we dare to call it plugin.
## Configuration
In your config file insert the following lines:
```python
config_opts['scm'] = True
config_opts['scm_opts']['method'] = 'git'
config_opts['scm_opts']['cvs_get'] = 'cvs -d /srv/cvs co SCM_BRN SCM_PKG'
config_opts['scm_opts']['git_get'] = 'git clone --depth 1 SCM_BRN git://localhost/SCM_PKG.git SCM_PKG'
config_opts['scm_opts']['svn_get'] = 'svn co file:///srv/svn/SCM_PKG/SCM_BRN SCM_PKG'
config_opts['scm_opts']['distgit_get'] = 'rpkg clone -a --branch SCM_BRN SCM_PKG SCM_PKG'
config_opts['scm_opts']['distgit_src_get'] = 'rpkg sources'
config_opts['scm_opts']['spec'] = 'SCM_PKG.spec'
config_opts['scm_opts']['int_src_dir'] = None
config_opts['scm_opts']['ext_src_dir'] = '/dev/null'
config_opts['scm_opts']['write_tar'] = True
config_opts['scm_opts']['git_timestamps'] = True
config_opts['scm_opts']['exclude_vcs'] = True
config_opts['scm_opts']['package'] = 'mypkg'
config_opts['scm_opts']['branch'] = 'master'
```
While you can specify this in configuration file, this is less flexible and you may rather use command line options. E.g. `config_opts['scm_opts']['method'] = 'git'` is the same as `--scm-option method=git` or `config_opts['scm_opts']['branch'] = 'master'` is the same as `--scm-option branch=master`.
## Tar file
When either `write_tar` is set to `True` or `/var/lib/mock/<chroot>/root/builddir/build/SOURCES/` contains `.write_tar`. Mock will create tar file from whole SVN repo. This is what you probably want to. Otherwise you have to manually create the tar file and put it there yourself before you run mock command.
Extension and compression method is chosen automatically according your Source line in spec file. Therefore if there is:
Source: http://foo.com/%{name}-%{version}.tar.xz
then mock will create tar file with .tar.xz extension and compressed by xz. Similarly if you choose .tar.gz or .tar.bz2 or any other known extension.
### git_timestamps
When `git_timestamps` is set to True, then modification time of each file in GIT is altered to datetime of last commit relevant to each file.
This option is available only to Git method and not for others.
### exclude-vcs
When `exclude-vcs` is set to True, then `--exclude-vcs` option is passed to tar command.
### int_src_dir
When `int_src_dir` is specified, Mock will use that directory in the repository as the SOURCES instead of the repository root.
### ext_src_dir
When your source (or patch) file does not exist in `/var/lib/mock/<chroot>/root/builddir/build/SOURCES/` directory then it is looked up in `ext_src_dir` and copy there.
### dist-git
Since version 1.3.4, there is support for [dist-git](https://github.com/release-engineering/dist-git). In fact it can support any DistSVN or DistCVS method. You just specify which command clone the repository (`distgit_get`) and which command retrieve sources (`distgit_src_get`). Mock-scm will then construct SRPM from those spec file and sources. Do not forget to specify `config_opts['scm_opts']['method'] = 'distgit'`
## Example
In this example, mock will clone `master` branch of `github.com/xsuchy/rpmconf.git` and use `./rpmconf.spec` in that directory to build rpm package:
```sh
mock -r fedora-22-x86_64 \
--scm-enable \
--scm-option method=git \
--scm-option package=rpmconf \
--scm-option spec=rpmconf.spec \
--scm-option branch=master \
--scm-option write_tar=True \
--scm-option git_get='git clone https://github.com/xsuchy/rpmconf.git'
```
Or you can:
cp /etc/mock/fedora-22-x86_64.cfg ./my-config.cfg
vi ./my-config.cfg
put there those lines:
```python
config_opts['scm'] = True
config_opts['scm_opts']['method'] = 'git'
config_opts['scm_opts']['git_get'] = 'git clone https://github.com/xsuchy/rpmconf.git'
config_opts['scm_opts']['spec'] = 'rpmconf.spec'
config_opts['scm_opts']['write_tar'] = True
config_opts['scm_opts']['package'] = 'rpmconf'
config_opts['scm_opts']['branch'] = 'master'
```
and then just call
mock -r ./my-config.cfg

19
docs/Plugin-Showrc.md Normal file
View file

@ -0,0 +1,19 @@
---
layout: default
title: Plugin Showrc
---
This plugin dumps all the build time RPM macros (via `rpm --showrc`) into result directory as `showrc.log` file, which may help identify problems of (or reproduce) the build.
It prints information about all defined RPM macros.
## Configuration
You can enable the plugin using this settings:
```python
config_opts['plugin_conf']['showrc_enable'] = True
```
Available since version 2.5.
This plugin is DISABLED by default.

21
docs/Plugin-Sign.md Normal file
View file

@ -0,0 +1,21 @@
---
layout: default
title: Plugin Sign
---
The Sign plugin can call command (from the host) on the produced rpms.
It was primary created for signing packages, but can call anything you want to.
## Configuration
The Sign plugin is disabled by default. To enable it, add this code to configure file:
```python
config_opts['plugin_conf']['sign_enable'] = True
config_opts['plugin_conf']['sign_opts'] = {}
config_opts['plugin_conf']['sign_opts']['cmd'] = 'rpmsign'
config_opts['plugin_conf']['sign_opts']['opts'] = '--addsign %(rpms)s'
```
The variable %(rpms)s will be expanded to package file name. This command will run as unprivileged and will get all your environment variables and especially it will run in your $HOME. So `~/.rpmmacros` will be interpreted.
Since mock-1.2.14 there is also available variable `%(resultdir)`, which will be expanded to name of directory where are final rpm packages.

25
docs/Plugin-Tmpfs.md Normal file
View file

@ -0,0 +1,25 @@
---
layout: default
title: Plugin TmpFS
---
The TmpFS plugin allows you to mount a tmpfs on the chroot dir. This plugin is disabled by default.
## Configuration
You can enable the plugin using this settings:
```python
config_opts['plugin_conf']['tmpfs_enable'] = True
config_opts['plugin_conf']['tmpfs_opts'] = {}
config_opts['plugin_conf']['tmpfs_opts']['required_ram_mb'] = 1024
config_opts['plugin_conf']['tmpfs_opts']['max_fs_size'] = '768m'
config_opts['plugin_conf']['tmpfs_opts']['mode'] = '0755'
config_opts['plugin_conf']['tmpfs_opts']['keep_mounted'] = False
```
* `required_ram_mb` - If system has less memory than this value, the TmpFS plugin will be disabled and a warning is omitted, but `mock` will continue.
* `max_fs_size` - this is passed to `mount.tmpfs` as `-o size=X`
* `mode` - this is passed to to `mount.tmpfs` as `-o mode=X`
* `keep_mounted` - when set to `True`, the `buildroot` is not unmounted when mock exits (which will destroy it's content). Additionally when mock is starting and it detects the tmpfs from a previous run, it will reuse it.
:warning: You can not combine **Tmpfs plugin** and **Lvm_root plugin**, because it is not possible to mount Logical Volume as tmpfs.

25
docs/Plugin-YumCache.md Normal file
View file

@ -0,0 +1,25 @@
---
layout: default
title: Plugin YumCache
---
This plugin pre-mounts `/var/cache/{yum,dnf}` directories inside chroot, so the package manager's metadata don't have to be re-downloaded between subsequent mock commands (the caches survive `mock --clean` for example). This plugin is needed because dnf (or yum) `--installroot DIRECTORY` commands store caches below the `DIRECTORY`.
It mounts directories `/var/cache/mock/<chroot>/{dnf,yum}_cache` as `/var/cache/{dnf,yum}` in chroot.
You can explicitly clean the package manager caches by `--scrub=dnf-cache` option.
## Configuration
This plugin is **enabled by default** and has the following values built-in:
```python
config_opts['plugin_conf']['yum_cache_enable'] = True
config_opts['plugin_conf']['yum_cache_opts'] = {}
config_opts['plugin_conf']['yum_cache_opts']['max_age_days'] = 30
config_opts['plugin_conf']['yum_cache_opts']['max_metadata_age_days'] = 30
config_opts['plugin_conf']['yum_cache_opts']['online'] = True
```
* `max_age_days` - when files in cache directory is older than this number of days, then such files are removed
* `max_metadata_age_days` - when metadata (everything with suffix: ".sqlite", ".xml", ".bz2", ".gz") in cache directory is older than this number of days, then such files are removed.
* `online` - when `False`, mock doesn't apply policies for `max_*_age_days` options (complements `--offline` option)

View file

@ -0,0 +1,51 @@
---
layout: default
title: Plugin rpkg preprocessor
---
This plugin allows you to run preprocessing on an input spec file just before srpm build is started.
Preprocessing is implemented by a simple `preproc` language which allows you to place: `{% raw %}{{{ bash_code }}}{% endraw %}` tags into any text file. When you run such text file through `preproc` command-line utility, a "rendered" text file is output where all the `{% raw %}{{{ bash_code }}}{% endraw %}` tags are now replaced by standard output of the executed `bash_code` that was inside the `{% raw %}{{{ }}}{% endraw %}` tags.
`preproc` also allows you to load a certain library of macros (by `-s` switch on its command-line) which are essentially just bash functions that you can afterward use from any `{% raw %}{{{&nbsp;}}}{% endraw %}` tag in the input text file.
One such library is called `rpkg-macros` and its macros are documented [here](https://docs.pagure.org/rpkg-util/v3/macro_reference.html). These macros are specialized to render rpm spec file's dynamically based on surrounding git metadata. They need the spec file you are building srpm from to be placed in a git repository.
`preproc` with the `rpkg-macros` library loaded is exactly what is used to perform preprocessing on spec file by the `rpkg_preprocessor` plugin. Instead of calling `preproc` directly with the `-s` switch to load `rpkg-macros`, we use a tiny `preproc-rpmspec` wrapper that does this for us but it could be done either way.
Note that just enabling the plugin is not enough to get spec file preprocessed. You additionally need `rpkg.conf` file placed next to the spec file with the following content:
```ini
[rpkg]
preprocess_spec = True
```
That's because for some packages you might want to have preprocessing disabled even though the plugin is globally enabled. Note that even if you have rpkg preprocessing globally enabled (e.g. in `/etc/mock/site-defaults.cfg`) and the `rpkg.conf` file is present with the required content to enable preprocessing, you still have an option to disable preprocessing on command-line by using mock's option `--disable-plugin=rpkg_preprocessor`. There is also `--enable-plugin=rpkg_preprocessor` to do the opposite.
There is currently only one mock command that does invoke the `rpkg_preprocessor` plugin (if all the conditions above are satisfied): `mock --buildsrpm`. This plugin is not employed for rebuilding existing srpms with `mock --rebuild` command or any other mock operation currently.
An example usage with the `mock --buildsrpm` command is:
$ cd <package_git_repository>
$ mock --buildsrpm --spec ./my_package.spec.rpkg --sources .
This will run preprocessing on `my_package.spec.rpkg` and the output spec file will be then handed over to `rpmbuild` to build srpm from it.
`.rpkg` extension for rpm spec files containing rpkg macros is optional but recommended.
## Configuration
The plugin supports the following configuration options (mentioned together with the default values):
```python
config_opts['plugin_conf']['rpkg_preprocessor_enable'] = False
config_opts['plugin_conf']['rpkg_preprocessor_opts']['requires'] = ['preproc-rpmspec']
config_opts['plugin_conf']['rpkg_preprocessor_opts']['cmd'] = '/usr/bin/preproc-rpmspec %(source_spec)s --output %(target_spec)s'
```
* `rpkg_preprocessor_enable` option switches the plugin on and off
* `requires` option specifies requirements to perform the preprocessing operation. The operation is done in a chroot where srpm is built afterwards so the tool(s) to perform preprocessing need to be installed there first
* `cmd` option defines the actual command to run the preprocessing operation.
`requires` and `cmd` options are there for possible future updates in the used tooling. You don't need to modify these options to get the default preprocessing functionality. The only line needed in `/etc/mock/site-defaults.cfg` to enable this plugin is:
```python
config_opts['plugin_conf']['rpkg_preprocessor_enable'] = True
```
This plugin is available since mock-x.x.x.

121
docs/README.md Normal file
View file

@ -0,0 +1,121 @@
---
layout: default
title: README
---
# The Slate theme
[![.github/workflows/ci.yaml](https://github.com/pages-themes/slate/actions/workflows/ci.yaml/badge.svg)](https://github.com/pages-themes/slate/actions/workflows/ci.yaml) [![Gem Version](https://badge.fury.io/rb/jekyll-theme-slate.svg)](https://badge.fury.io/rb/jekyll-theme-slate)
*Slate is a Jekyll theme for GitHub Pages. You can [preview the theme to see what it looks like](http://pages-themes.github.io/slate), or even [use it today](#usage).*
![Thumbnail of Slate](thumbnail.png)
## Usage
To use the Slate theme:
1. Add the following to your site's `_config.yml`:
```yml
remote_theme: pages-themes/slate@v0.2.0
plugins:
- jekyll-remote-theme # add this line to the plugins list if you already have one
```
2. Optionally, if you'd like to preview your site on your computer, add the following to your site's `Gemfile`:
```ruby
gem "github-pages", group: :jekyll_plugins
```
## Customizing
### Configuration variables
Slate will respect the following variables, if set in your site's `_config.yml`:
```yml
title: [The title of your site]
description: [A short description of your site's purpose]
```
Additionally, you may choose to set the following optional variables:
```yml
show_downloads: ["true" or "false" (unquoted) to indicate whether to provide a download URL]
google_analytics: [Your Google Analytics tracking ID]
```
### Stylesheet
If you'd like to add your own custom styles:
1. Create a file called `/assets/css/style.scss` in your site
2. Add the following content to the top of the file, exactly as shown:
```scss
---
---
@import "{{ site.theme }}";
```
3. Add any custom CSS (or Sass, including imports) you'd like immediately after the `@import` line
*Note: If you'd like to change the theme's Sass variables, you must set new values before the `@import` line in your stylesheet.*
### Layouts
If you'd like to change the theme's HTML layout:
1. For some changes such as a custom `favicon`, you can add custom files in your local `_includes` folder. The files [provided with the theme](https://github.com/pages-themes/slate/tree/master/_includes) provide a starting point and are included by the [original layout template](https://github.com/pages-themes/slate/blob/master/_layouts/default.html).
2. For more extensive changes, [copy the original template](https://github.com/pages-themes/slate/blob/master/_layouts/default.html) from the theme's repository<br />(*Pro-tip: click "raw" to make copying easier*)
3. Create a file called `/_layouts/default.html` in your site
4. Paste the default layout content copied in the first step
5. Customize the layout as you'd like
### Customizing Google Analytics code
Google has released several iterations to their Google Analytics code over the years since this theme was first created. If you would like to take advantage of the latest code, paste it into `_includes/head-custom-google-analytics.html` in your Jekyll site.
### Overriding GitHub-generated URLs
Templates often rely on URLs supplied by GitHub such as links to your repository or links to download your project. If you'd like to override one or more default URLs:
1. Look at [the template source](https://github.com/pages-themes/slate/blob/master/_layouts/default.html) to determine the name of the variable. It will be in the form of `{{ site.github.zip_url }}`.
2. Specify the URL that you'd like the template to use in your site's `_config.yml`. For example, if the variable was `site.github.url`, you'd add the following:
```yml
github:
zip_url: http://example.com/download.zip
another_url: another value
```
3. When your site is built, Jekyll will use the URL you specified, rather than the default one provided by GitHub.
*Note: You must remove the `site.` prefix, and each variable name (after the `github.`) should be indent with two space below `github:`.*
For more information, see [the Jekyll variables documentation](https://jekyllrb.com/docs/variables/).
## Roadmap
See the [open issues](https://github.com/pages-themes/slate/issues) for a list of proposed features (and known issues).
## Project philosophy
The Slate theme is intended to make it quick and easy for GitHub Pages users to create their first (or 100th) website. The theme should meet the vast majority of users' needs out of the box, erring on the side of simplicity rather than flexibility, and provide users the opportunity to opt-in to additional complexity if they have specific needs or wish to further customize their experience (such as adding custom CSS or modifying the default layout). It should also look great, but that goes without saying.
## Contributing
Interested in contributing to Slate? We'd love your help. Slate is an open source project, built one contribution at a time by users like you. See [the CONTRIBUTING file](docs/CONTRIBUTING.md) for instructions on how to contribute.
### Previewing the theme locally
If you'd like to preview the theme locally (for example, in the process of proposing a change):
1. Clone down the theme's repository (`git clone https://github.com/pages-themes/slate`)
2. `cd` into the theme's directory
3. Run `script/bootstrap` to install the necessary dependencies
4. Run `bundle exec jekyll serve` to start the preview server
5. Visit [`localhost:4000`](http://localhost:4000) in your browser to preview the theme
### Running tests
The theme contains a minimal test suite, to ensure a site with the theme would build successfully. To run the tests, simply run `script/cibuild`. You'll need to run `script/bootstrap` once before the test script will work.

View file

@ -0,0 +1,17 @@
---
layout: default
title: Release Notes 1.2.13
---
mock-1.2.13 is bugfix release, but some bugfix may be interesting for you:
* Fedora 23 configs are reverted back to use yum again. To be on pair
with Koji
* Lot of fixes for --new-chroot option
* Mockchain can download SRPM from Dropbox
* DNF does not install weak dependencies by default
* When cleaning up chroots, mock now exclude mountpoints
* When you build using DNF (rawhide) on systems, which does not have DNF (EL6, 7), mock will print warning, wait for confirmation, tell you how to suppress this warning next time. Nevertheless this warning is not fatal and Mock can continue using YUM.
* Previously package_state plugin always used YUM, now it use DNF when chroot is configured to use DNF.
* When file `/usr/bin/yum-deprecated` is present on your machine, then variable `config_opts['yum_command']` is set to this value by default.
* Several others bugfixes

View file

@ -0,0 +1,12 @@
---
layout: default
title: Release Notes 1.2.14
---
mock-1.2.14 is bugfix release, but some bugfix may be interesting for you:
* --new-chroot now works on rhel7
* create tmpfs with unlimited inodes [RHBZ#1266453](http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=1266453) - otherwise architectures with large pages (e.g. PPC64) can use only fraction of the tmpfs capacity.
* Add %(resultdir) placeholder for sign plugin. [RHBZ#1272123](http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=1272123)
* use --setopt=deltarpm=false as default value for dnf_common_opts [RHBZ#1281355](http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=1281355)
* fixed issue with /home mount on nfs [RHBZ#1281369](http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=1281369)

View file

@ -0,0 +1,14 @@
---
layout: default
title: Release Notes 1.2.15
---
mock-1.2.15 introduce these changes:
* Fedora 24 chroot configs (and Fedora 21 was removed).
* ccache plugin is by default off - to copy behaviour of Koji and Copr.
* ~/.config/mock.cfg is parsed too (beside ~/.mock/user.cfg).
And several bugfixes:
* buildroot is removed as root [RHBZ#1294979](http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=1294979)
* "local" dnf plugin is disable [RHBZ#1264215](http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=1264215)

View file

@ -0,0 +1,19 @@
---
layout: default
title: Release Notes 1.2.16
---
mock-1.2.16 has been released to get rid of annoying errors due selinux [RHBZ#1312820](http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=1312820).
Additionally mock-1.2.16 introduces these changes:
* sparc configs has been removed
* instead of systemd-nspawn mock now requires systemd-container in F24+
And several bugfixes:
* do not call /bin/su and rather utilize --user of systemd-nspawn [RHBZ#1301953](http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=1301953)
* tell nspawn which variables it should set [RHBZ#1311796](http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=1311796)
Known issue:
* When you run mockchain with several SRPMs, then it may fails due deluser bug [RHBZ#1315864](http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=1315864)

View file

@ -0,0 +1,6 @@
---
layout: default
title: Release Notes 1.2.17
---
mock-1.2.17 is just quick release, which is fixing major issue in 1.2.16 and which was not catch during release testing.

View file

@ -0,0 +1,47 @@
---
layout: default
title: Release Notes 1.2.18
---
mock-1.2.18 has several bugfixes:
* copy just content of SRPM not the attributes ([RHBZ#1301985](http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=1301985))
* do not fail when we cannot link default.cfg ([RHBZ#1305367](http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=1305367))
* Build always fails when using --nocheck ([RHBZ#1327594](http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=1327594))
* keep machine-id in /etc/machine-id ([RHBZ#1344305](http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=1344305))
And several changes:
* Unconditionally setup resolver config
* use DNF for F24 chroot
* requires rpm-python
* Escape the escape sequences in PROMPT_COMMAND, improve prompt
* Use root name instead config name for backups dir
* Add MIPS personalities
* scm plugin handle better submodules
And there are two new groups of configs. There are new [Mageia](https://www.mageia.org) configs:
* mageia-cauldron-armv5tl
* mageia-cauldron-armv7hl
* mageia-cauldron-i586
* mageia-cauldron-x86_64
* mageia-6-armv5tl
* mageia-6-armv7hl
* mageia-6-i586
* mageia-6-x86_64
And there are new custom configs:
* custom-1-aarch64
* custom-1-armhfp
* custom-1-i386
* custom-1-ppc64
* custom-1-ppc64le
* custom-1-s390
* custom-1-s390x
* custom-1-x86_64
Those configs does not have any repository configured and base is empty. I.e:
config_opts['chroot_setup_cmd'] = ""
This is useful if you want to prepare the chroot yourself. Or when you use it with mockchain with `--addrepo=REPOS` option. This was added on request of [Koschei](https://fedoraproject.org/wiki/Koschei), which will use it.

View file

@ -0,0 +1,19 @@
---
layout: default
title: Release Notes 1.2.19
---
Mock version 1.2.19 has those changes:
* plugin [PackageState](Plugin/PackageState) is now enabled by default and it has new options. By default this plugin now generate list of installed packages. List of available packages is disabled by default.
* Fedora 25 configs has been added
* GPG keys in configs are now used from package `distribution-gpg-keys`. Keys in `/etc/pki/mock` will be still shipped for some time, so we do not break old user config. But new one will not be added and users are encouraged to migrate their paths to GPG keys.
* you can include some other config using:
``include('/path/to/config/to/be/included/include.cfg')``
* there is new option available which will install additional package to minimal chroot. This is extension of already existing option `chroot_setup_cmd`. It was added to easy automated changed of minimal buildroot in Copr.:
``config_opts['chroot_additional_packages'] = 'some_package other_package'``
* And it resolves those bugs: RHBZ#1272381, RHBZ#1358397, RHBZ#1362478, RHBZ#1277187, RHBZ#1298220, RHBZ#1264508.
And few notes about future release:
* in next release will be very likely resolved [RHBZ#1246810](https://bugzilla.redhat.com/show_bug.cgi?id=1246810). I.e. /usr/sbin/mock will be moved to /usr/libexec/mock/mock. Since this is very big change, next release will likely be 1.3.0
* Development and documentation will likely move to Github or Pagure. Please follow buildsys mailing list.

View file

@ -0,0 +1,6 @@
---
layout: default
title: Release Notes 1.2.20
---
Mock 1.2.20 is just bugfix release, which use correct gpg keys for epel in epel* configs.

View file

@ -0,0 +1,13 @@
---
layout: default
title: Release Notes 1.2.21
---
Mock version 1.2.21 is security release. It fixes:
* CVE-2016-6299 - privilige escalation via mock-scm [RHBZ#1375493](https://bugzilla.redhat.com/show_bug.cgi?id=1375493)
Additionally it has those changes:
- root_cache: Mention _root_ cache being created in state updates (log messages)
- Rename mageia pubkey to RPM-GPG-KEY-Mageia
- require generic system-release rather than fedora-release [RHBZ#1367746](https://bugzilla.redhat.com/show_bug.cgi?id=1367746)

View file

@ -0,0 +1,33 @@
---
layout: default
title: Release Notes 1.3.2
---
This is a release with big changes. Prior to this release there have been version 1.3.1, but it was never actually released. It was just tagged commit and was intended just for developers for testing. This is first public release after big internal changes.
There are those changes:
* move `/usr/sbin/mock` to `/usr/libexec/mock/mock` [RHBZ#1246810](http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=1246810)
Previously there were /usr/bin/mock and /usr/sbin/mock. It caused some confusion. Script `/usr/sbin/mock` should not be run directly, but some people (and containers) had /usr/sbin first in their path. So this script is now in `/usr/libexec/`, which are not in `$PATH`. In other word: you can still type "mock" and mock will start. If you ever seen this error
`ERROR: The most common cause for this error is trying to run `/usr/sbin/mock` as an unprivileged user.` then you should not see it anymore.
* F22 configs has been removed
* Just for developers: I removed the automake and it will use Tito now. If you are new to tito, then just:
```bash
sudo dnf install tito
tito build --rpm --test -i # install code from last commit
tito build --rpm # build latest tagged version
```
The benefits are that release process is now *much* easier. And there are no more build artefacts directly in git repo.
* `--nocheck` is working again [GH#2](https://github.com/rpm-software-management/mock/issues/2)
* You can now run mock inside of Docker [RHBZ#1336750](http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=1336750) - however you need to run docker with `-cap-add=SYS_ADMIN`.
* When building for Fedora 25+ target in container, then buildhost is set to name of host and not to name of container. [RHBZ#1302040](http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=1302040)
These are the new defaults:
```
## When RPM is build in container then build hostname is set to name of
## container. This sets the build hostname to name of container's host.
## Works only in F25+ chroots
# config_opts['use_container_host_hostname'] = True
## This works in F25+ chroots. This overrides 'use_container_host_hostname' option
# config_opts['macros']['%_buildhost'] = 'my.own.hostname'
```
* There was a lot of flake8/pep8/pycodestyle clean up of code.

View file

@ -0,0 +1,32 @@
---
layout: default
title: Release Notes 1.3.3
---
There are new features:
* All chroot (but rawhide) configs now contains `best=1`. This way DNF will always try to install latest package.
If its dependence cannot be satisfied DNF will report an error. Without this DNF may silently install some older
version which does not have broken deps.
This is fine for regular user, but not for buildsystems, where maintainers usually want to
use latest version.
Note that this change may result in sudden build failure, which previously silently succedded.
In this case, please check your BuildRequires and ask maintainers of those build deps to resolve broken dependency.
This option was not added to rawhide chroots as there are broken dependencied very often.
Additionaly option `best=1` is used for repos passed to mockchain using `-a` option.
* new config for epel-7-aarch64 chroot
* You can use new variable `hostname`: `config_opts['hostname'] = 'my.own.hostname'`
This unconditionally calls `sethostname()`, however
variable `use_container_host_hostname` or `%_buildhost` macro can override this (on F25+).
* Use DNF on RHEL, when it is installed and configured [RHBZ#1405783](http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=1405783)
* Temporary directories now use `tmp.mock.` prefix.
* Temporary directories are now removed even when buildroot is not cleaned.
* Add bash completion for .cfg files outside /etc/mock [#20](https://github.com/rpm-software-management/mock/pull/20)
There are some bugfixes:
* Handle working directories which contains spaces [RHBZ#1389663](http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=1389663)
* Error: is not iterable [RHBZ#1387895](http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=1387895)
* Delay mounting of user-defined mountpoints [RHBZ#1386544](http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=1386544)
* Added example how to use `more_buildreqs` when you need more packages
* Added example how to use `--plugin-option`

View file

@ -0,0 +1,29 @@
---
layout: default
title: Release Notes 1.3.4
---
There are new features:
* [scm plugin](Plugin-Scm) now supports [DistGit](https://github.com/release-engineering/dist-git/) (or DistSVN etc.) .
* log files of [package_state plugin](Plugin-PackageState) got `.log` extension. I.e. `available_pkgs.log` and `installed_pkgs.log`.
* Configuration files for Fedora 26 has been added.
* Configuration files for Fedora 23 has been removed.
* Even rawhide configs now use best=1.
* when Mock is run directly without consolehelper it now return exit code 2.
* You can pass additional arguments to systemd-nspawn using this config option: `config_opts['nspawn_args'] = []`.
* kojipkgs urls now use https instead of http.
* new plugin [hw_info](Plugin-HwInfo) which prints HW information of builder. This plugin is enabled by default.
There are some bugfixes:
* reflect change of "Rawhide" to "rawhide" in /etc/os-release [RHBZ#1409735](https://bugzilla.redhat.com/show_bug.cgi?id=1409735)
* in site-defaults.cfg is more examples of how to set up PS1 [RHBZ#1183733](https://bugzilla.redhat.com/show_bug.cgi?id=1183733)
* preserve mode of files when doing chroot_scan [RHBZ#1297430](https://bugzilla.redhat.com/show_bug.cgi?id=1297430)
* shell in systemd-nspawn is run as PID 2 [RHBZ#1372234](https://bugzilla.redhat.com/show_bug.cgi?id=1372234) - this is not done in EL7 version of systemd-nspawn does not support it
* debuginfo repos has been renamed so `mock --dnf-cmd debuginfo-install PACKAGE` works now [RHBZ#1409734](https://bugzilla.redhat.com/show_bug.cgi?id=1409734)
Notes:
* next version will have systemd-nspawn as default. This can break your scripts built on top of Mock. You can try the new behaviour using `--new-chroot` option.
* next version will not be released for EL6. You are advised to upgrade to EL7.

View file

@ -0,0 +1,10 @@
---
layout: default
title: Release Notes 1.3.5
---
This is bugfix release only for EL6:
* Change path to "df" in hw-info plugin [RHBZ#1428301](https://bugzilla.redhat.com/show_bug.cgi?id=1428301)
EL7 and Fedoras are not affected, therefore I did not release this version there.

View file

@ -0,0 +1,47 @@
---
layout: default
title: Release Notes 1.4.1
---
There are new features:
* Mock previously used chroot technology. Few past releases Mock offered systemd-nspawn which is modern container technology for better isolation. This release use systemd-nspawn as default. If you want to preserve previous behaviour you can use `--old-chroot` option. *NOTE*: network is disabled inside container by default now; take a look into `site-defaults.cfg` for desired options (like `rpmbuild_networking`).
* Mock now uses bootstrap chroot to install target chroot. This is big change and see special paragraph at the bottom of this release notes.
* Chroot now contains `/dev/hwrng` and `/dev/prandom` when they exists in host [[#33](https://github.com/rpm-software-management/mock/issues/33)].
* We added `%distro_section` macro to Mageia configs.
There are some bugfixes:
* Resultdir is now chowned to user who executed mock so they can delete the files.
* `hw_info` plugin chown logs to user who executed mock also.
* Previously we declared that *package state plugin* is enabled by default, but the plugin was in fact disabled. It is now enabled by default (as stated in mock documentation) [[RHBZ#1277187](https://bugzilla.redhat.com/show_bug.cgi?id=1277187)].
* Creating directories for mount points have been delayed after mount of tmpfs [[#57](https://github.com/rpm-software-management/mock/issues/57)].
* Exit code of `machinectl` is now ignored as `machinectl` set non-zero code even for non-fatal errors. Errors which are quite often not relevant nor important for mock.
* `hw_info` plugin does not crash when output contains non-ASCII characters [[#68](https://github.com/rpm-software-management/mock/issues/68)].
Notes:
* This version has not been released for EL6. If you are using EL6 and you want to use latest Mock, please upgrade you infrastructure to EL7.
* Configs for `s390` architecture has been removed as it is not supported any more.
* Configs for `aarch64` and `ppc64le` now use different GPG key as those architectures has been moved from Secondary to Primary.
* Epel5 config points now to vault.centos.org. Note that EL5 has been EOLed. We will keep epel-5 config for some time. But any issue with building for epel-5 target will not be fixed.
## Bootstrap chroot
Mock is calling `dnf --installroot` to install packages for target architecture into target directory. This works. Mostly. The only problem that use host DNF and rpm to install packages. But this can cause problem when new RPM feature is introduces. Like Soft dependencies or Rich dependencies. When you have EL6 host and try to install Fedora rawhide package with Rich dependency then rpm will fail and you cannot do anything about it. You can upgrade your build machine to Fedora rawhide, but that is often not possible when it is part of critical infrastructure.
So we introduced Boostrap chroot. And 'we' actually means Michael Cullen who implement it. And Igor Gnatenko who proposed this idea. Big kudos for both of them.
Bootstrap chroot means that we first create very minimal chroot for target platform and we call DNF/YUM from that platform. For example: when you are on RHEL7 and you want to build package for `fedora-26-x86_64`, mock will first create chroot called `fedora-26-x86_64-bootstrap`, it will install DNF and rpm there (fc26 versions). Then it will call DNF from `fedora-26-x86_64-bootstrap` to install all needed packages to `fedora-26-x86_64` chroot.
The disadvantage is that you will need more storage in `/var/lib/mock`, the build is little bit slower. But you will hardly notice that unless you disabled `yum_cache` and `root_cache` plugins for some reasons.
The advantage is that you can use stable version of OS to build packages for even most recent OS. And vice versa.
If you want to preserve previous behaviour you can use `--no-bootstrap-chroot` command line option or set:
```
config_opts['use_bootstrap_container'] = False
```
in your configuration.

View file

@ -0,0 +1,51 @@
---
layout: default
title: Release Notes 1.4.10
---
Released on 2018-05-10.
Features:
- There is a new plugin [overlayfs](Plugin-Overlayfs). This plugin implements mock's snapshot functionality using overlayfs. From a user perspective, it works similar to LVM plugin, but unlike LVM plugin, it only needs a directory (not a volume group) for its data (snapshots).
- Previously a [bind_mount](Plugin-BindMount) plugin allowed to mount just a directory. Now, you can bind mount even a single file.
- Previously a [chroot_scan](Plugin-ChrootScan) allowed retrieving artifacts from chroot where build started. Now, it can extract objects even from chroot which failed to initialize.
Bugfixes:
- Change sign plugin to sign only built RPMs and not every file in results directory [RHBZ#1217495](https://bugzilla.redhat.com/show_bug.cgi?id=1217495)
- encode content before writing [GH#176](https://github.com/rpm-software-management/mock/issues/176)
- revert workaround introduced in 057c51d6 [RHBZ#1544801](https://bugzilla.redhat.com/show_bug.cgi?id=1544801)
Note:
Few weeks ago, I released a new `mock-core-configs` package and there is a new feature.
It contains:
```
$ ls -l /etc/mock
...
lrwxrwxrwx. 1 root mock 26 May 2 09:13 fedora-29-aarch64.cfg -> fedora-rawhide-aarch64.cfg
lrwxrwxrwx. 1 root mock 25 May 2 09:13 fedora-29-armhfp.cfg -> fedora-rawhide-armhfp.cfg
lrwxrwxrwx. 1 root mock 23 May 2 09:13 fedora-29-i386.cfg -> fedora-rawhide-i386.cfg
lrwxrwxrwx. 1 root mock 24 May 2 09:13 fedora-29-ppc64.cfg -> fedora-rawhide-ppc64.cfg
lrwxrwxrwx. 1 root mock 26 May 2 09:13 fedora-29-ppc64le.cfg -> fedora-rawhide-ppc64le.cfg
lrwxrwxrwx. 1 root mock 24 May 2 09:13 fedora-29-s390x.cfg -> fedora-rawhide-s390x.cfg
lrwxrwxrwx. 1 root mock 25 May 2 09:13 fedora-29-x86_64.cfg -> fedora-rawhide-x86_64.cfg
```
The plan is that during Fedora branching event I will:
* remove those symlinks and create regular files pointing to Fedora 29 repos
* create fedora-30-* as symlinks to fedora-rawhide-*
This will give you a choice to target rawhide using "rawhide" string or using the number.
Following contributors contributed to this release:
* Martin Necas
* Michal Novotný
* Neal Gompa
* Todd Zullinger
* Zdenek Zambersky
Thank you.

View file

@ -0,0 +1,86 @@
---
layout: default
title: Release Notes 1.4.11
---
Released on 2018-06-12.
## Features:
- Previously you were able to only build for compatible architectures. I.e., you can build `i386` package on `x86_64` architecture. When you tried to build for incompatible architecture, you get this error:
```
$ mock -r fedora-28-ppc64le shell
ERROR: Cannot build target ppc64le on arch x86_64, because it is not listed in legal_host_arches ('ppc64le',)
```
Now, you can build for any architecture using new option --force-arch ARCH. [GH#120](https://github.com/rpm-software-management/mock/issues/120) You have to have installed package `qemu-user-static`, which is a new soft dependence. Try this:
```
$ sudo dnf install qemu-user-static
$ mock -r fedora-28-ppc64le --forcearch ppc64le shell
```
and you get the prompt in PPC64LE Fedora. You can do this for any architecture supported by QEMU. Note: Do not confuse `--forcearch` and `--arch` which are very different options.
- Mock previously only supported GNU Tar. Now Mock supports BSD Tar as well. [GH#169](https://github.com/rpm-software-management/mock/issues/169) There is a new option in config available:
```
# You can configure which tar is used (for root cache and SCM plugin)
# valid options are: "gnutar" or "bsdtar"
# config_opts['tar'] = "gnutar"
```
Be aware that if you created a cache using gnutar then you cannot extract it using bsdtar. Therefore when changing this option, you have to scrub all caches.
- There is a new config option:
```
# name of user that is used when executing commands inside the chroot
# config_opts['chrootuser'] = 'mockbuild'
```
This can be changed to different value. E.g., 'root'. However, be aware that any other value than 'mockbuild' is not tested by upstream.
- There is initial support for MicroDnf [GH#76](https://github.com/rpm-software-management/mock/issues/76) Be aware the due MicroDNF is missing `--installroot` option, the buildroot and build dependencies are still installed by DNF. These are new options related to MicroDNF:
```
# config_opts['microdnf_command'] = '/usr/bin/microdnf'
## "dnf-install" is special keyword which tells mock to use install but with DNF
# config_opts['microdnf_install_command'] = 'dnf-install microdnf dnf dnf-plugins-core distribution-gpg-keys'
# config_opts['microdnf_builddep_command'] = '/usr/bin/dnf'
# config_opts['microdnf_builddep_opts'] = []
# config_opts['microdnf_common_opts'] = []
# config_opts['microdnf_command'] = '/usr/bin/microdnf'
config_opts['package_manager'] = 'microdnf'
```
Right now, Mock does not ship any config which use this package manager.
- There is a new option `--spec`, which you can use to build an SRPM.
```
# dnf download --source foo
# rpm2cpio foo.src.rpm | cpio -dimv
(Add/modify compilation flags in .spec file)
# mock --spec foo.spec foo.src.rpm --postinstall
(or)
# mock --spec foo.spec --sources ./
```
## Bugfixes:
- The file `/etc/resolv.conf` is now empty when networking is disabled. [RHBZ#1514028](https://bugzilla.redhat.com/show_bug.cgi?id=1514028) This reduces timeout when code tries to connect to a network. Note that option `config_opts['use_host_resolv']` changed from True to False as networking is disabled by default too. Note that `--enable-network` automatically set `config_opts['use_host_resolv']` to True now.
Following contributors contributed to this release:
* ArrayMy
* Ken Dreyer
* Neal Gompa
* Neil Horman
* Sam Fowler
* Todd Zullinger
Thank you.

View file

@ -0,0 +1,52 @@
---
layout: default
title: Release Notes 1.4.13
---
Released on 2018-08-13.
## Features:
- Starting with mock-core-configs version 29.1 the gpg keys for rawhide are checked now.
- There is a new config option `print_main_output`, which allows you to override default behavior:
```
# By default, mock only prints the build log to stderr if it is a tty; you can
# force it on here (for CI builds where there is no tty, for example) by
# setting this to True, or force it off by setting it to False.
# config_opts['print_main_output'] = None
```
- Following new environment variables are passed to mock from user environment: `http_proxy`, `ftp_proxy`, `https_proxy`, `no_proxy`.
- bash completion has been reworked and is now much simple and hopefully better
- There are new configs for Fedora 30.
## Bugfixes:
- Mockchain will again stop after the first failure if -c or --recurse is not used.
- Commands started by mock will be using `C.UTF-8` locale instead of `en_US.UTF-8`, which does not need to be available.
- There is new default for `nspawn_args`: `config_opts['nspawn_args'] = ['--capability=cap_ipc_lock']`. This will enable cap_ipc_lock in nspawn container, which will allow to use `mlock()` [RHBZ#1580435](https://bugzilla.redhat.com/show_bug.cgi?id=1580435).
- Do not get spec from the command line when using scm [GH#203](https://github.com/rpm-software-management/mock/issues/203)
- use host's resolv.conf when --enable-network is set on cml [RHBZ#1593212](https://bugzilla.redhat.com/show_bug.cgi?id=1593212)
Following contributors contributed to this release:
* Bruno Vernay
* Chuck Wilson
* Jaroslav Škarvada
* Neal Gompa
* Owen W. Taylor
* Seth Wright
* Todd Zullinger
* Tomasz Torcz
Thank you.
Note: version 1.4.12 has been skipped due error discovered during releasing.

View file

@ -0,0 +1,79 @@
---
layout: default
title: Release Notes 1.4.14
---
Released on 2019-02-19.
Release together with `mock-core-configs-30.1` which has these changes:
- Added repositories for Fedora 30 (and Fedora 31 repos now points to rawhide).
- distribution-gpg-keys for rhel8beta is being installed directly from Koji, because EPEL8 does not exist yet.
- Fedora 27 config has been moved to `eol` directory.
- `gpgcheck` is enabled for testing and debuginfo now.
- Fedoras 29+ have included modular repos now. Additionally, there is now `module_platform_id` defined in these configs, which allows you to install modules without errors.
## Mock new features:
- All mock configs are parsed and evaluated by [Jinja2](http://jinja.pocoo.org/). Here is small example how it can be used:
```
# define your own config variable
config_opts['fedora_number'] = '30'
config_opts['root'] = 'fedora-{{ fedora_number }}-x86_64'
config_opts['dist'] = 'fc{{ fedora_number }}'
```
Another - more general - example from `site-defaults.cfg`:
```
# You can use jinja templates, e.g.:
# config_opts['foobar'] = '{{ foo }} bar'
# which will result in 'bar bar' (using value defined few lines above)
# more complicated example:
# config_opts['foo'] = "{{ plugin_conf['package_state_enable'] }}"
# which will result in "True"
```
This feature can simplify mock's configs in the future. I intentionally did not use it now, because it is too fresh. Please experiment with this feature on your own and report any error or issues. If there would be none, then I will start using it in main configs.
- Use 32-bit personality for armv7*/armv8* builds.
- You can now specify decompress program for root_cache. This is new default in `site-defaults.cfg` [GH#230](https://github.com/rpm-software-management/mock/issues/230):
```
## decompress_program is needed only for bsdtar, otherwise `compress_program` with `-d` is used
## for bsdtar use "unpigz" or "gunzip"
# config_opts['plugin_conf']['root_cache_opts']['decompress_program'] = "pigz"
```
## Bugfixes:
- Added Scientific Linux on the list of RHEL clones [GH#228](https://github.com/rpm-software-management/mock/issues/228)
- Fixed exclude pattern for BSDTar [GH#219](https://github.com/rpm-software-management/mock/issues/219)
- There used to be living part of `site-defaults.cfg`:
```
config_opts['bootstrap_chroot_additional_packages'] = []
config_opts['bootstrap_module_enable'] = []
config_opts['bootstrap_module_install'] = []
```
This is now commented out by default, and the defaults are set in mock code. You can still override it in `site-defaults.cfg`.
Following contributors contributed to this release:
* Bernhard Rosenkränzer
* František Zatloukal
* Pavel Raiskup
* Petr Junák
* Sam Fowler
Thank you.

View file

@ -0,0 +1,50 @@
---
layout: default
title: Release-Notes 1.4.15
---
Released on 2019-04-22.
## Mock new features:
- Mock supports [Dynamic Build Requires](https://fedoraproject.org/wiki/Changes/DynamicBuildRequires). There is still ongoing work in `rpmbuild`; therefore you cannot use it yet. Once the new rpmbuild lands in Fedora you can immediately use it with Mock. [[GH#245](https://github.com/rpm-software-management/mock/issues/245)]
- I have seen people who do not know about [setup](https://rpm-software-management.github.io/mock/#setup). Now, when you are not in the `mock` group, and Mock asks you via `consolehelper` for root password, it prints this banner: `You are not in the `mock` group. See https://github.com/rpm-software-management/mock/wiki#setup` [[GH#244](https://github.com/rpm-software-management/mock/issues/228)]
- Previously when Mock executed DNF, then Mock disabled DNF plugin `local`. Now the list of plugins which will be disabled can be configured via:
```
config_opts['dnf_disable_plugins'] = ['local', 'spacewalk']
```
The above is the new default, i.e., the plugin `spacewalk` is now disabled as well. [[GH#210](https://github.com/rpm-software-management/mock/issues/210)]
This change simplified `dnf_common_opts` default, which is now:
```
config_opts['dnf_common_opts'] = ['--setopt=deltarpm=False']
```
## Bugfixes:
- In Flatpak, the method `distro.version()` returns float, which produced fatal error in Mock. This is now fixed [[RHBZ#1690374](https://bugzilla.redhat.com/show_bug.cgi?id=1690374)]
- new rpm library now returns strings instead of bytes. Mock has been altered that it can accept both types [[RHBZ#1693759](https://bugzilla.redhat.com/show_bug.cgi?id=1693759)]
- Mock used FileNotFoundError class for a error handling. This class is not defined in Python 2 and caused a traceback during an error handling [[RHBZ#1696234](https://bugzilla.redhat.com/show_bug.cgi?id=1696234)]
## Known issues:
- On Fedora 30+, the createrepo_c prints its output to STDERR, which is fatal to mockchain. For the time being, I changed the mockchain behavior and creterepo_c errors are not fatal. However, mockchain print them as an error even there is no error at all. [GH#249](https://github.com/rpm-software-management/mock/issues/249)
Following contributors contributed to this release:
* Igor Gnatenko
* Jeroen van Meeuwen (Kolab Systems)
* Jo Shields
* Martin Kutlák
* Neal Gompa
* Pat Riehecky
* Toshio Kuratomi
Thank you.

View file

@ -0,0 +1,20 @@
---
layout: default
title: Release Notes 1.4.16
---
Released on 2019-05-22.
## Mock new features and bugfixes:
- switch to python3 on el7
- respect use_host_resolv config even with use_nspawn (praiskup@redhat.com)
- Fix crash on non-ascii dnf log messages (bkorren@redhat.com)
Following contributors contributed to this release:
* Barak Korren
* Miro Hrončok
* Pavel Raiskup
Thank you.

View file

@ -0,0 +1,72 @@
---
layout: default
title: Release Notes 1.4.17
---
Released on 2019-08-08.
## Mock-core-configs new features:
* Added updates-modular to Fedora 29 and Fedora 30, but with `enabled=0` for now due
[bug in DNF](https://bugzilla.redhat.com/show_bug.cgi?id=1737469).
* Removed info about metadata expire.
* Replace groupadd using sysusers.d.
* epel-7 profiles to use mirrorlists.
* EOLed Fedora 28.
* Do not protect packages in chroot [[GH#286]](https://github.com/rpm-software-management/mock/pull/286).
* Fix value for dist for OpenMandriva 4.0 configs.
* Add initial OpenMandriva distribution targets.
## Mock new features and bugfixes:
* Mockchain has been replaced by `mock --chain`. This new command inherited most
mockchain command-line options. The [return codes](https://github.com/rpm-software-management/mock/blob/master/mock/py/mockbuild/exception.py#L26) are little different.
This has been done to remove duality - mockchain parsed configs differently than mock.
Now, the behavior should be unified. Mockchain has been marked obsolete - it even prints warning
when you execute, and you are encouraged to migrate to `mock --chain`. I will try to preserve `mockchain` for next
12 months, but mockchain will not be receiving any new functionality.
* Mock is now able to run in [Fedora Toolbox](https://docs.fedoraproject.org/en-US/fedora-silverblue/toolbox/).
* Added support for [Cheat](https://github.com/cheat/cheat) - try running `cheat mock`.
* There is a new tool `mock-parse-buildlog --path FILE` which tries to parse build.log file and give you nice
human friendly description, why the build failed. Right now, it support just two use cases. Feel free to
send pull request to enhance it.
* Secondary groups are now loaded [[RHBZ#1264005]](https://bugzilla.redhat.com/show_bug.cgi?id=1264005).
* When installing dependencies, Mock pass --allowerasing to DNF now. [[GH#251]](https://github.com/rpm-software-management/mock/pull/251).
* make include() functional for --chain [[GH#263]](https://github.com/rpm-software-management/mock/pull/263).
* Removing BUILDSTDERR from log - it is now configurable via `config_opts['_mock_stderr_line_prefix`]', which is by default empty string.
* Use rpm -qa --root instead of running rpm -qa in chroot.
* Run more that one loop for DynamicBuildrequires if it is neeed.
* Number of loop devices is now configurable using `config_opts['dev_loop_count'] = 12` and the new default has been raised from 4 to 12. This change only affects `--old-chroot`. We are working on making it functional in nspawn chroot as well.
* Return back to call binaries using /bin for split-usr setups.
* Repeat [dynamic requires](https://fedoraproject.org/wiki/Changes/DynamicBuildRequires) loop if needed [[GH#276]](https://github.com/rpm-software-management/mock/pull/276)
* Fix compatibility with pre-4.15 RPM versions with DynamicBuildRequires.
* Enable [Dynamic BuildRequires](https://fedoraproject.org/wiki/Changes/DynamicBuildRequires) by default.
* Independent network configuration [[GH269]](https://github.com/rpm-software-management/mock/pull/269)
* Now, when you execute `mock -r FOO`, mock will check if `~/.config/mock/FOO.cfg` exists and use this config. If it does not exists, it will use the `/etc/mock/FOO.cfg`. This is useful if you want to localy override default configs.
* respect use_host_resolv config even with use_nspawn.
* Fix crash on non-ascii dnf log messages.
* switch to python3 on el7 (msuchy@redhat.com)
## Future
Note that in upcoming versions, I would like to:
* drop python2 support as even EL7 version is running on python3 now.
* drop EL7 support (likely spring 2020). I mean to stop building Mock for EL7. Building packages for EL7 using Mock will be still supported.
* make DNF default package manager. E.g., you will have to state in config that you want to use yum explicitly.
* Pavel Raiskup is preparing support for building for RHEL 8 targets. So besides traditional CentOS targets, you will be able to build for RHEL, if you have Red Hat subscription. This will allows you to not wait for CentOS release when RHEL has already been released.
Following contributors contributed to this release:
* Barak Korren
* Bernhard Rosenkränzer
* Igor Gnatenko
* khoitd1997
* Martin Necas
* Miro Hrončok
* Neal Gompa
* Owen W. Taylor
* Pavel Raiskup
* Silvie Chlupova
Thank you.

View file

@ -0,0 +1,41 @@
---
layout: default
title: Release Notes 1.4.18
---
Released on 2019-08-27.
## Mock-core-configs new features:
* New configs for RHEL. See [separate page](Feature-rhelchroots) for more info.
* Fedora 31 has been added
* Add local-source repo definition to Fedora Rawhide.
* revert sysusers setting [RHBZ#1740545](https://bugzilla.redhat.com/show_bug.cgi?id=1737469)
## Mock new features and bugfixes:
* When a foreign architect is detected, Mock will automatically enable `--forcearch`.
* Support for subscription-manager has been added. See [RHEL chroots](Feature-rhelchroots) page.
* bootstrap-chroot always explicitly install shadow-utils
* Add [procenv plugin](Plugin-ProcEnv.md) for more detailed build time information. This plugin is disabled by default.
* Resolved issues with SELinux from the previous release. You may still experience some warnings, but none of them should be fatal.
* SIGTERM, SIGPIPE, and SIGHUP signals are now propagated to chroot.
## Future
Note that in upcoming versions, I would like to:
* drop python2 support as even EL7 version is running on python3 now.
* drop EL7 support (likely spring 2020). I mean to stop building Mock for EL7. Building packages for EL7 using Mock will be still supported.
* make DNF default package manager. E.g., you will have to state in the config that you want to use yum explicitly.
Following contributors contributed to this release:
* Dominik Turecek
* Jan Buchmaier
* Jiri Konecny
* Miro Hrončok
* Pat Riehecky
* Pavel Raiskup
Thank you.

View file

@ -0,0 +1,17 @@
---
layout: default
title: Release Notes 1.4.19
---
Released on 2019-09-10.
## Mock bugfixes:
* Biggest reason for this release have been regression that results are owned by root user instead of unpriv user [[GH#322]](https://github.com/rpm-software-management/mock/issues/322)
* Previously resultdir variable in config has not been documented. This is now fixed.
Following contributors contributed to this release:
* Silvie Chlupová
Thank you.

View file

@ -0,0 +1,28 @@
---
layout: default
title: Release Notes 1.4.2
---
There are new features:
* The bootstrap feature is now disabled by default. There were too many issues with it. You can enable it locally with `--bootstrap-chroot`, but first see knows [bugs](https://bugzilla.redhat.com/buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&component=mock&known_name=mock-all&list_id=7491839&product=Fedora&product=Fedora%20EPEL&query_based_on=mock-all&query_format=advanced) and [issues](https://github.com/rpm-software-management/mock/issues).
* There is initial support for Fedora Modularity. You can add to config:
```
config_opts['module_enable'] = ['list', 'of', 'modules']
config_opts['module_install'] = ['module1/profile', 'module2/profile']
```
This will call `dnf module enable list of modules` and `dnf module install module1/profile module2/profile` during the init phase. EDIT: If you want to use this feature you have to have experimental DNF, it can be obtained from this [Copr project](https://copr.fedorainfracloud.org/coprs/mhatina/DNF-Modules/).
There are some bugfixes:
* NSpawn chroot is switched off for EL6 targets [[RHBZ#1456421](https://bugzilla.redhat.com/show_bug.cgi?id=1456421)].
* LVM root is not umounted when `umount_root` is set to false [[RHBZ#1447658](https://bugzilla.redhat.com/show_bug.cgi?id=1447658)]
* Shell in NSpawn container is now called with `--login` so `profile.d` scripts are executed [[RHBZ#1450516](https://bugzilla.redhat.com/show_bug.cgi?id=1450516)] [[RHBZ#1462373](https://bugzilla.redhat.com/show_bug.cgi?id=1462373)]
* yum rather then yum-deprecated is used when using bootstrap chroot [[RHBZ#1446294](https://bugzilla.redhat.com/show_bug.cgi?id=1446294)]
* Custom chroot does not use bootstrap [[RHBZ#1448321](https://bugzilla.redhat.com/show_bug.cgi?id=1448321)]
* Mock now use `dnf repoquery` instead of repoquery for chroots which uses DNF.
* LVM's scrub hook for bootstrap chroot is called [[RHBZ#1446297](https://bugzilla.redhat.com/show_bug.cgi?id=1446297)]
* `--mount` will mount LVM volumes [[RHBZ#1448017](https://bugzilla.redhat.com/show_bug.cgi?id=1448017)]

View file

@ -0,0 +1,90 @@
---
layout: default
title: Release Notes 1.4.20
---
Released on 2019-10-04.
## Mock new features:
### Container image for bootstrap
Previously we have some incompatibilities between host and build target. They were, in fact, small. Like using a different package manager. Some were big. Like, the introduction of Weak and Rich dependencies. For this reason, we introduced [bootstrap](Feature-bootstrap). But then comes [zstd payload](https://fedoraproject.org/wiki/Changes/Switch_RPMs_to_zstd_compression). This is a new type of payload. And to install packages with this payload, you need rpm binary, which supports this payload. This is true for all current Fedoras. Unfortunately, neither RHEL 8 nor RHEL 7 supports this payload. So even bootstrap will not help you to build Fedora packages on RHEL 8.
We come up with a nice feature. Mock will not install bootstrap chroot itself. Instead, it will download the container image, extract the image, and use this extracted directory as a bootstrap chroot. And from this bootstrapped chroot install the final one.
Using this feature, **any** incompatible feature in either RPM or DNF can be used in the target chroot. Now or in future. And you will be able to install the final chroot. You do not even need to have RPM on a host. So this should work on any system. Even Debian based. The only requirement for this feature is [Podman](https://podman.io/).
This feature is now disabled by default. You can enable it using:
config_opts['use_bootstrap_image'] = True
It can be enabled or disabled on the command line using `--use-bootstrap-image` or `--no-bootstrap-image` options.
Note however that also this is prerequisite:
config_opts['use_bootstrap_container'] = True # or --bootstrap-chroot option
To specify which image should be used for bootstrap container you can put in config:
config_opts['bootstrap_image'] = 'fedora:latest'
This is a general config. Each config has specified its own image specified. E.g. CentOS 7 has `config_opts['bootstrap_image'] = 'centos:7'` in config. So unless you use your own config, you can enable this feature, and the right image will be used.
There is one known issue:
* Neither Mageia 6 nor 7 works correctly now with this feature.
Technically, you can use any container, as long as there is the required package manager (DNF or YUM). The rest of the needed packages will be installed by mock.
### Mockchain removed
Mockchain has been removed. I wanted to keep it longer, but because of [[RHBZ#1757388](https://bugzilla.redhat.com/show_bug.cgi?id=1757388)] I decided to remove it now. You should use `mock --chain` instead of `mockchain`. There is present simple wrapper `/usr/bin/mockchain` which calls `mock --chain`. Most of the mockchain parameters are still preserved for `mock --chain`.
### New config option `package_manager_max_attempts`
When your infrastructure is not reliable and you see failing builds because of network issues, you can increase number of attemps to execute package manager's action. This can be now tuned using:
config_opts['package_manager_max_attempts'] = 1
config_opts['package_manager_attempt_delay'] = 10
### Bind mount local repos to bootstrap chroot
Previously when you have in your config something like:
config_opts['yum.conf'] = """
...
[myrepo]
baseurl=file:///srv/myrepo
then the path `/srv/myrepo` was not available inside of bootstrap container. The package manager was then unable to fetch those repositories.
This is now fixed and those directories are now automatically bind-mounted to bootstrap chroot.
This was actually the last known issue with bootstrap chroots. You may expect that in a future version of Mock, the bootstrap chroot will be enabled by default.
## Mock-core-config bugfixes
* Fix baseurl typo in centos-stream config
* Disabled modular repo for f29 - this was accidentally enabled during transition to templates.
## Mock bugfixes
* Several files - mainly logs - are created as unprivileged user now. This will fix several issues when you use NFS. [[#341](https://github.com/rpm-software-management/mock/issues/341)], [[#322](https://github.com/rpm-software-management/mock/issues/322)], [[RHBZ#1751944](https://bugzilla.redhat.com/show_bug.cgi?id=1751944)]
* `/var/log` is now ignored when creating root cache.
* `mock --chain` now creates local repositories using `skip_if_unavailable=0`
Following contributors contributed to this release:
* Daniel Mach
* Denis Ollier
* Chuanhao jin
* Jakub Kadlcik
* Jiri 'Ghormoon' Novak
* Pavel Raiskup
* Silvie Chlupova
Thank you.

View file

@ -0,0 +1,31 @@
---
layout: default
title: Release Notes 1.4.21
---
Released on 2019-11-01.
## Mock-core-configs 31.7
* Added configs for epel8-playground
* Added 3 base packages to epel-playground and epel buildroot [RHBZ#1764445](https://bugzilla.redhat.com/show_bug.cgi?id=1764445)
## Mock 1.4.21 bugfixes:
This is a bugfix-only release. There is already ongoing work on 1.5.0 version. I cherry-picked some commits, which resolves some painfull bugs:
There were some issue with initialization of "Container image for bootstrap" feature. [GH#380](https://github.com/rpm-software-management/mock/issues/380). This is now fixed. As side effect there are two changes. Download of container image has been moved from `root_cache` plugin to main Mock code. As result you do not need to have root cache enabled to use this feature. Second, distribution-gpg-keys are always copied to bootstrap chroot if you use bootstrap container feature.
Commands `--install` and `--installdeps` now works with bootstrap [RHBZ#1447627](https://bugzilla.redhat.com/show_bug.cgi?id=1447627)
There was an ugly bug, which involved systemd, CGroups v2 and SELinux and can lead to complete freeze of a system. This has been now resolved. [RHBZ#1756972](https://bugzilla.redhat.com/show_bug.cgi?id=1756972)
Rarely you may hit bug with incorrect rpmbuildstate. This is now fixed. [GH#349](https://github.com/rpm-software-management/mock/issues/349).
Following contributors contributed to this release:
* Jakub Kadlcik
* Merlin Mathesius
* Pavel Raiskup
Thank you.

View file

@ -0,0 +1,24 @@
---
layout: default
title: Release Notes 1.4.3
---
This is bug fix release, we fixed following issues:
* `--nocheck` macro was not properly escaped [[RHBZ#1473359](https://bugzilla.redhat.com/show_bug.cgi?id=1473359)].
* Use python3 and dnf module on Fedoras to guess architecture in `%post` scriptlet [[RHBZ#1462310](https://bugzilla.redhat.com/show_bug.cgi?id=1462310)].
* enhanced detection of RHEL [[RHBZ#1470189](https://bugzilla.redhat.com/show_bug.cgi?id=1470189)].
* scm: define `_sourcedir` to checkout directory [[PR#98](https://github.com/rpm-software-management/mock/pull/98)].
* Mageia Cauldron `releasever` is now 7 [[PR#95](https://github.com/rpm-software-management/mock/pull/95)]
* Create `/dev` nodes even when using `nspawn` [[RHBZ#1467299](https://bugzilla.redhat.com/show_bug.cgi?id=1467299)].
* SELinux: do not try to import yum when PM is dnf [[RHBZ#1474513](https://bugzilla.redhat.com/show_bug.cgi?id=1474513)].
* When you have hundreds of volumes in LVM you can tell mock to wait longer using `config_opts['plugin_conf']['lvm_root_opts']['sleep_time'] = 1`.
Thanks to following contributors:
* Igor Gnatenko
* Jonathan Lebon
* Mikolaj Izdebski
* Neal Gompa
* Ville Skyttä
* pixdrift

View file

@ -0,0 +1,11 @@
---
layout: default
title: Release Notes 1.4.4
---
This is bug fix release, we fixed following issues:
* Fedora 27 configs have been added.
* /etc/dnf/dnf.conf is used instead of /etc/dnf.conf
* /etc/dnf/dnf.conf is populated even when yum is used
* Rename group inside of chroot from mockbuild to mock - this will allow you to install mock inside of mock' chroot. Please invalidate your previous caches.

View file

@ -0,0 +1,33 @@
---
layout: default
title: Release Notes 1.4.6
---
Released on 2017-09-15.
This is mostly a bugfix release, but there are some features too:
Features:
* All chroot configs have been moved to new package mock-base-configs. This will allow us to release new chroot configs independently of Mock main code.
* There is a new command --debug-config available. This command print current mock config (including defaults) to standard output and exit. This can be useful when you experience some issue, which you cannot reproduce anywhere else.
* There is a new script, which can add a default route to loopback for a container with private-network. This is an experimental feature, not used automatically, and will very likely change in future.
* There is short option `-N` for `--no-cleanup-after`.
Bugfixes:
* Mock again create /dev/loop nodes. This caused a lot of pain to Lorax users. [RHBZ#1481370](https://bugzilla.redhat.com/show_bug.cgi?id=1481370)
* Comment about nspawn/chroot default in site-defaults.cfg was previously incorrect, this has been fixed now.
* Previously when you used --private-network then the isolated network was used only during rpm build phase. And, e.g., for shell command, it was not used. This caused some confusion. Now the network is always switched when you specify --private-network.
* The bug "The buildroot LVM volume is not kept mounted after build" [RHBZ#1447658](https://bugzilla.redhat.com/show_bug.cgi?id=1447658) has been fixed once again. Hopefully this time correctly.
Following contributors contributed to this release:
* Brian C. Lane
* Jan Synacek
* Matej Kudera
* Michael Simacek
* Ville Skyttä
P.S. I did not skip 1.4.5. I just find a serious bug in requirement just after the release. So I made two releases in one day. :) This is united release notes.

View file

@ -0,0 +1,38 @@
---
layout: default
title: Release Notes 1.4.7
---
Released on 2017-10-31.
Features:
* There is a new option in config `config_opts['chrootgroup']`, which allows you to change name of group inside of chroot.
* Any key for `config_opts` you specify with 'bootstrap_*' will be copied to bootstrap config e.g., `config_opts['bootstrap_system_yum_command'] = '/usr/bin/yum-deprecated'` will become `config_opts['system_yum_command'] = '/usr/bin/yum-deprecated'` for bootstrap config.
* There are three new default:
```
config_opts['bootstrap_chroot_additional_packages'] = []
config_opts['bootstrap_module_enable'] = []
config_opts['bootstrap_module_install'] = []
```
This will not install any additional packages or modules into bootstrap chroot.
* Mock now recognize DeskOS.
* Previously when `config_opts['rpmbuild_networking']` was enabled we passed `--private-network` to systemd-nspawn. However that lead there was no default route. And you cannot bind() UDP socket to all IP addresses and then join multicast group, without having default route. Now we do onot add `--private-network` to systemd-nspawn, instead we setup network namespace ourselves and we also add default route pointing to loopback interface (only interface in the new namespace). This feature introduce new dependency on pyroute2.
Bugfixes:
* Delete rootdir as well when calling clean. In case one overrides the rootdir option, and the rootdir is located outside of basedir, it was not cleaned up when calling --clean. Fix this case by checking if the rootdir is outside basedir. If that is the case, run an extra rmtree() on it.
* Choose good symbolic link of default.cfg on Mageia.
* Ccache is now mounted to /var/tmp as /tmp gets over-mounted with tmpfs when system-nspawn is used.
* Output of `--debug-config` is now sorted.
* Use primary key for Fedora 27+ on s390x.
Following contributors contributed to this release:
* Andreas Thienemann
* Dan Horák
* Jan Pokorný
* Mark D Horn
* Michal Sekletar
* Neal Gompa
* Ricardo Arguello

View file

@ -0,0 +1,77 @@
---
layout: default
title: Release Notes 1.4.8
---
Released on 2017-12-22.
Features:
* There is a new option --config-opts [GH#138](https://github.com/rpm-software-management/mock/issues/138)
You can run:
```
mock --config-opts yum_command=/usr/bin/yum-deprecated --enable-network
```
which will set:
```
config_opts['system_yum_command'] = '/usr/bin/yum'
```
or for a list:
```
mock --config-opts extra_chroot_dirs=/mnt/b --config-opts extra_chroot_dirs=/mnt/a
```
which will set
```
config_opts['extra_chroot_dirs'] = ['/mnt/b', '/mnt/a']
```
or list with a single item:
```
mock --config-opts extra_chroot_dirs=/mnt/b --config-opts extra_chroot_dirs=
```
which will set
```
config_opts['extra_chroot_dirs'] = ['/mnt/b']
```
It can detect boolean:
```
mock --config-opts nosync=False --debug-config |grep nosync
config_opts['nosync'] = False
```
A specialized option has priority. Therefore:
```
mock --config-opts rpmbuild_networking=False --enable-network --debug-config |grep rpmbuild_networking
config_opts['rpmbuild_networking'] = True
```
It is unable to set complicated variables. Like config_opts['plugin_conf']['package_state_opts'] or anything which has dictionary as value.
* There is a new option. `--enable-network` which is equivalent to `config_opts['rpmbuild_networking'] = True`
Bugfixes:
* orphanskill now emits SIGKILL when SIGTERM is not enough [RHBZ#1495214](https://bugzilla.redhat.com/show_bug.cgi?id=1495214)
* when mock tries to force umount, it will try umount recursively
* do not change to directory if nspawn is used [GH#108](https://github.com/rpm-software-management/mock/issues/108)
* when creating yum/dnf.conf, mock now copy timestamp from the host [RHBZ#1293910](https://bugzilla.redhat.com/show_bug.cgi?id=1293910)
* We now mount /proc and /sys in chroot before executing any package manager command (outside of chroot)[RHBZ#1467299](https://bugzilla.redhat.com/show_bug.cgi?id=1467299)
* Dependencies of mock-scm (git, cvs, tar, subversion) are now soft dependencies (Recommends) [RHBZ#1515989](https://bugzilla.redhat.com/show_bug.cgi?id=1515989)
* Previously job control in `mock shell` does not work. [RHBZ#1468837](https://bugzilla.redhat.com/show_bug.cgi?id=1468837). This was a glibc bug and it is resolved in rawhide now.
Following contributors contributed to this release:
* Matt Wheeler
* Matthew Stoltenberg

View file

@ -0,0 +1,50 @@
---
layout: default
title: Release Notes 1.4.9
---
Released on 2018-02-12.
Note:
In this release, there are several fixes to bootstrap feature. This is especially important for users who run Mock on EL7. Rich dependencies are now allowed in Fedora and maintainers are starting to use them. So sooner or later, you will be unable to build packages for Fedoras on EL7 host. Unless you start using bootstrap feature (`--bootstrap-chroot`), which is still by default off.
Features:
* Stdout and stderr in build.log has been split. All stderr output lines are prefixed by `BUILDSTDERR:`
* There is a new config option `opstimeout`:
```
# Set timeout in seconds for common mock operations
# if 0 is set, then no time limit is used
# config_opts['opstimeout'] = 0
```
The default is 0, which means that Mock is waiting until command exit.
Bugfixes:
* Builds for EL5 are working again - EL5 is sensitive to order of params of adduser [RHBZ#1535328](https://bugzilla.redhat.com/show_bug.cgi?id=1535328)
* Use correct builddep when bootstrap is used. Additionally, ccache is not installed into bootstrap chroot. [RHBZ#1540813](https://bugzilla.redhat.com/show_bug.cgi?id=1540813).
* User defined mounts are not mounted in bootstrap chroot.
* Detect if essential mounts are already mounted - previously, mock assumed that essential mounts (procfs, sysfs) are never mounted when mock starts up. That's not true, as multiple non-destructive mock processes are allowed (`--shell`, `--install`, etc.) to run concurrently. So when you use `mock --shell` and do a `mock --install` in parallel, it breaks your shell, because it unmounts its proc. This improves the situation by first asking whether the mounts aren't there already.
* fix quoting in sign_opts example in site-defaults.cfg [RHBZ#1537797](https://bugzilla.redhat.com/show_bug.cgi?id=1537797).
* Honor the "cwd" flag when nspawn is being used and "chrootPath" is not set.
* Do not produce a warning when we are using different PM for a bootstrap container.
* Default for config_opts['dnf_warning'] in site-defaults.cfg according to docs.
Additionally, there are several major changes in mock-core-config. This package is independent now, and a new version has been released two weeks ago and will be pushed to Fedora stable next week. I will repeat here changes in that package:
* Fedora 28 configs has been added.
* `failovermethod=priority` has been removed for repos which use DNF. This is the only method which DNF recognize and it cannot be changed.
* Set `skip_if_unavailable=False` for all repos. If a repository is unreachable, then build fails.
Following contributors contributed to this release:
* Barak Korren
* Michael Simacek
* Mikhail Campos Guadamuz
* mprahl
* Pavel Raiskup
* Todd Zullinger
Thank you.

150
docs/Release-Notes-2.0.md Normal file
View file

@ -0,0 +1,150 @@
---
layout: default
title: Release Notes 2.0
---
Released on 2020-02-07.
## Mock 2.0 highlights:
* The mock versioning policy (or rather style) has changed from three to
two-number pattern. Don't panic, this isn't really special major
release - the change was only done to move from the
`<UNUSED>.<MAJOR>.<MINOR>` pattern to `<MAJOR>.<MINOR>`, so practically
we went with *v2.0* instead of previously planned *v1.5.0*.
* The `--bootstrap-chroot` option is newly enabled by default, this can be
disabled by `--no-bootstrap-chroot`, or by
`config_opts['use_bootstrap'] = False`. The content of bootstrap chroot
is cached by default and never automatically updated, but one
can use the new `--scrub=bootstrap` to remove related caches. The
`--scrub=all` was updated to clean bootstrap as well (but `--clean`
doesn't touch bootstrap chroot at all).
* The `use_bootstrap_container` configuration option was renamed to
`use_bootstrap` to better describe it's purpose (it never implied usage
of container technology) and to align with `use_bootstrap_image`
option. Please migrate your custom configuration.
* The output from `--debug-config` option now only shows the differences
from mock's defaults, and the output doesn't have the Jinja templates
expanded.
* The `config_opts['dnf.conf']` replaced `config_opts['yum.conf']`. Both
still work, but only one of them can exist one config file.
* The `--old-chroot` and `--new-chroot` options were obsoleted by
`--isolation=chroot|nspawn`, and still default to `--isolation=nspawn`.
Please migrate your tooling.
* Mock now can now pre-configure DNF variables ([#346](../issues/346)), e.g.
`config_opts['dnf_vars'] = { 'stream': '8-stream' }`
* The regression in `--use-bootstrap-image` implementation was fixed (did
not work at all in `v1.4.21`), and should work reliably now (`podman`
still needs to be installed manually to make it work).
* In mock config files we now prefer Jinja templates, instead of
previously used python expansion `"%(variable)" % ..`. It is not
likely, but if you use this in your custom config files, please
migrate.
## Mock 2.0 other fixes and enhancements:
* Loop device files are pre-populated even in `--isolation=nspawn`
chroots, similarly to what is done with `--isolation=chroot`
([#298](../issues/298)).
* The `include()` statement in mock config now also accepts relative path
names (relative against `config_opts['config_path']` for now).
* The host local repositories from mock config files
(like `baseurl=file://`) are now correctly bind-mounted to bootstrap
chroot. So installing RPM from such repositories with
`--bootstrap-chroot` now works (related [#381](../issues/381)).
* Non-interactive commands in chroot are executed through
`systemd-nspawn --console=pipe` (when `--isolation=nspawn`, default)
([#432](../issues/432)).
* Better detection of host's package manager (DNF vs. YUM), for both
bootstrap and normal chroot. This should demotivate people from using
`--dnf` and `--yum` options ([#233](../issues/233)). More, on Fedora 31+ there's no
real YUM package manager anymore (there only is `yum.rpm` which actually
provides `/bin/yum` symlink to `/bin/dnf`). This situation is now
properly detected in mock, and the symlink is ignored (we fallback to
DNF).
* Better re-using of DNF/YUM caches, in both normal and bootstrap chroot.
This is mostly given by previous bullet (YUM vs. DNF detection). To be
100% sure, we also newly rather bind-mount both DNF and DNF cache
directories into the chroot.
* Mock expands the config templates (aka `include()`) completely before
executing it by eval(), and the implementation is now much simpler and
clear.
* Mock doesn't ignore `cleanup_on_success` configuration option after
`--postinstall` action.
* `mock --chain` file descriptor leak was fixed, so the descriptor usage
is constant with multiple builds.
* The Jinja templating is now iteratively re-rendered (when Jinja template
expands to another Jinja template), till there is something to expand. Also
we start the Jinja rendering mechanism a bit earlier in the codebase so the
mock configuration isn't really order-dependant (no matter which
configuration option is set first).
* Fix lvm plugin volume removal feature on modern systems
([rhbz#1762728](https://bugzilla.redhat.com/1762728)).
* We don't install `shadow-utils` (we don't need this one) and
`distribution-gpg-keys` (we copy the keys from host instead), so this
makes the initial `dnf_install_command` transaction shorter, and more
reliable across all the variety distributions we support.
* The `--sources` parameter is not mandatory in `--buildsrpm` mode.
* Mock now copies `/etc/pkg/ca-trust/extracted` into chroot
([#397](../issues/397)).
* The `success` and `fail` files are created under mockbuild user, not root.
* The `compress_logs`, when turned on, have predefined default `gzip` method.
* We turned `--forcearch` on long time ago, but mock exited with cryptic
error when `qemu-user-static` wasn't installed. Mock now detects that
`qemu-user-static` is missing and throws instructions instead.
## Mock-core-configs 32.0
* Added configs for **Fedora 32**, Fedora Rawhide configs moved to F33. The new
package depends on updated **distribution-gpg-keys 1.36** package (avaiable
in Fedora updates at the time of release).
* Fedora 29 configs EOLed (moved below `eol` subdirectory).
* All the configuration files were modified to use templates, to de-duplicate
a lot of stuff and many inconsistencies were fixed.
* On el7, mock/mock-core-configs automatically enable `use_bootstrap_image`
option for **Fedora 31+** chroots (ZSTD compression enabled for RPMs) because without
this option it wouldn't make sense to do anything (neither bootstrap chroot
is installable).
Both mock and mock-core-configs packages need to be updated together as pair.
Following contributors contributed to this release:
* Dominik Tureček
* Jakub Čajka
* Jakub Kadlčík
* Merlin Mathesius
* Scott K Logan
* Sérgio M. Basto
* Silvie Chlupová
* Tomas Hrnciar
Thank you.

65
docs/Release-Notes-2.1.md Normal file
View file

@ -0,0 +1,65 @@
---
layout: default
title: Release Notes 2.1
---
Released on 2020-03-11.
## Mock 2.1 bugfixes:
* Fixed `mock --install <sth>` request when `<sth>` is a file or directory
in CWD, or an absolute path on host (#474).
* We do not emit the warning `WARNING: Not using '/usr/bin/yum', it is symlink
to '/usr/bin/dnf-3'` anymore for installing bootstrap chroot (#477,
rhbz#1802930).
* The `config_opts['dnf.conf']` option is made equivalent to
`config_opts['yum.conf']` (#486).
* Allow specifying host-local repositories with `baseurl=/absolute/path`, not
only with `baseurl=file:///absolute/path`. This did not work with bootstrap
mode before (#480).
* Fixed broken sign plugin (#476, rhbz#1806577).
* Fixed too deep jinja recursion caused by trailing newlines in `dnf.conf`
config option (rhbz#1806482).
* The `mock --scrub` with lvm_root plugin enabled did not work (rhbz#1805179).
* Do not fail when host doesn't provide CA certificates on expected locations
(#492).
* Traceback fix for `mock --chain` with tmpfs `keep_mounted` enabled (#479).
* Dnf caches aren't cleaned for consecutive builds with `mock --chain` (#483).
## Mock 2.1 new features:
* Mock expects that `rpmbuild -br` (for %generate_buildrequires spec statement,
aka "dynamic BuildRequires") can return both exit status 0 and 11. Currently
released RPM always returns 11, but the plan is to fix that to return 0.
* New option `ssl_ca_bundle_path`. When specified, the CA certificate bundle
is copied from host to the specified path in chroot (usually it is enough to
keep the default behavior when whole `/etc/pki/ca-trust/extracted` is
copied, but e.g. OpenSUSE has different path to bundle) (#500).
## Mock-core-configs 32.4
* Specify CA bundle path for OpenSUSE chroots (#500).
* EOL Mageia 6 configs.
* Temporarily disable package_state plugin for openmandriva 4.0 and Cooker (#525).
Following contributors contributed to this release:
* Jakub Kadlcik
* Miroslav Suchý
* Remi Collet
* Tomas Hrnciar
Thank you.

View file

@ -0,0 +1,49 @@
---
layout: default
title: Release Notes 2.10
---
Released on - 2021-04-27.
## Mock 2.10 bugfixes:
* The `podman run` command which is used to pre-prepare the base mock bootstrap chroot
is now called just with `-i`, not with `-i -t`. That's because the new Podman
variants dislike `-t` when no tty is on the input.
* Fixed traceback for copying the Katello configs into the bootstrap chroot,
[PR 678][PR#678].
* Mount point handling was fixed; newly we use the correct and expected
mount-point options for recursive mounts (mostly needed for older util-linux
variants), and we correctly umount sub-set of already ḿounted mountpoints
upon some failure (traceback). [PR 712][PR#712]
## Mock-core-configs v34.3:
* Added Oracle Linux 7 and 8 configs.
* Add openSUSE Leap 15.3 configs.
* The openSUSE Leap 15.1 config was marked to EOL in configs.
* Add openSUSE Tumbleweed s390x config
* AlmaLinux 8 configs added
* The 'make' package was removed from the minimal ELN buildroot.
The following contributors contributed to this release:
* David Ward
* Miro Hrončok
* Miroslav Suchý
* Neal Gompa
Thank you!
[PR#712]: https://github.com/rpm-software-management/mock/pull/712
[PR#678]: https://github.com/rpm-software-management/mock/pull/678

View file

@ -0,0 +1,59 @@
---
layout: default
title: Release Notes 2.11
---
Released on - 2021-06-09
## Mock 2.11 features:
* You can use `--cwd` together with `--shell` now. [[PR 732][PR#732]]
* You can use `mock --install 'external:pypi:hwdata'` now. [[PR 733][PR#733]]
* Mock now defines macro `%{_platform_multiplier}` which is set to 1 by default. However, when [forcearch][forcearch] is used, then it is set to 10. [[PR 730][PR#730]]
This can be used to tune timeouts in e.g., `%check` and reflects that emulated platforms can take longer to finish task. Suggested use case can be:
```
%{!?_platform_multiplier:%global _platform_multiplier 1}
timeout $(( 60*%_platform_multiplier )) the-long-running-task
```
This will timeout after 60 seconds but on emulated platforms after 600 seconds.
If you have slow builder for some architecture, you can put in your config
```
config_opts['macros']['%_platform_multiplier'] = 5
```
to tune up this macro.
## Mock 2.11 bugfixes:
* Plug-in `compress_logs` now compresses log files even in case of DNF
repository failures [[PR 736][PR#736]].
* Broken "usage" section in `mock --help` output was fixed [[issue 738][#738]].
## Mock-core-configs v34.4:
* centos-stream-8 repositories use mirrorlist now. And have additional repositories which are presented in default centos-stream-8 installation [[PR 729][PR#729]]
The following contributors contributed to this release:
* Neal Gompa
* Miroslav Suchý
Thank you!
[PR#729]: https://github.com/rpm-software-management/mock/pull/729
[PR#730]: https://github.com/rpm-software-management/mock/pull/730
[PR#732]: https://github.com/rpm-software-management/mock/pull/732
[PR#733]: https://github.com/rpm-software-management/mock/pull/733
[PR#736]: https://github.com/rpm-software-management/mock/pull/736
[#738]: https://github.com/rpm-software-management/mock/issues/738
[forcearch]: https://github.com/rpm-software-management/mock/wiki/Feature-forcearch

View file

@ -0,0 +1,58 @@
---
layout: default
title: Release Notes 2.12
---
Released on - 2021-07-19
## Mock 2.12 bugfixes:
This is rather a small bugfix release, the most interesting stuff has been done
in mock-core-configs package (see below).
* We don't set --cwd for --shell mode when a systemd-nspawn without the
`--chdir` option is installed on the sytem (typically el7)
* An RPM `addMacro()` traceback fixed. The SCM plugin was fixed to explicitly
convert the configured macro macro values (in e.g.
`config_opts['macros']['%_platform_multiplier'] = 10`) to strings.
[[PR 753][PR#753]]
* Explicitly disabled versionlock DNF plugin by default, as we don't want to
affect the builds. [[PR 747][PR#747]]
* Mock package requirement on `shadow-utils` was removed from
`mock-core-configs` to proper `mock-filesystem`. [[PR 743][PR#743]]
## Mock-core-configs v34.6:
* CentOS Stream 9 "preview" files added
* Rocky Linux configs added
* AlmaLinux 8 AArch64 configs added.
* Add AlmaLinux Devel repo as an optional repo for AlmaLinux 8.
* Fixed GPG key path for SLE updates in openSUSE Leap 15.3.
* Switch CentOS templates to use quay.io images for bootstrap.
* EPEL Next 8 configs added.
The following contributors contributed to this release:
* Carl George
* Igor Raits
* Louis Abel
* Miroslav Suchý
* Neal Gompa
* Scott K Loga
Thank you!
[PR#747]: https://github.com/rpm-software-management/mock/pull/743
[PR#747]: https://github.com/rpm-software-management/mock/pull/747
[PR#753]: https://github.com/rpm-software-management/mock/pull/753

View file

@ -0,0 +1,65 @@
---
layout: default
title: Release Notes 2.13
---
Released on - 2021-11-02
## New Mock 2.13 features:
* A new option `--additional-package` is added. During package
development, this option can be used with `mock --rebuild` mode to specify
an additional set of build requirements (still, properly setting
`BuildRequires:` is a preferred way to achieve this) [[PR 776][PR#776]].
* A new option `--debug-config-expanded` is now available. It provides a very
similar mock configuration output to the `--debug-config` option, except that
the `{{ Jinja }}` constructs the configuration are expanded
[[PR 765][PR#765]].
## Mock 2.13 bugfixes:
* The [`external:` dependencies](Feature-external-deps) are now properly
installed into a proper build chroot, not into a bootstrap chroot
[[PR 771][PR#771]].
* The option parsing mechanism was migrated from the `optparse` library to
`argparse`. This in particular shouldn't be a user visible change, so please
report changes in mock behavior if you observe any.
* The repositories generated locally by mock are not automatically signed. But
since Mock did not specify the default `gpgpcheck=` option before, and some of
our config files didn't have `gpgcheck=0` in the `[main]` section,
DNF applied its own `gpgcheck=1` default and it led to `mock --chain` build
failures. Newly we set `gpgcheck=0` by default by Mock and any GPG signed
repository used in mock configuration needs to overwrite this explicitly
[[PR 782][PR#782]].
* When re-mounting, we newly don't specify the source of the mountpoint as it is
not needed in our case, and because the other (preferred) `mount --target ...`
variant is more portable (behaves correctly with older `util-linux`
implementations). [[issue 715][issue#715]]
* The `distro.linux_distribution()` call is now deprecated, we use
`distro.id()` instead. [[PR 767][PR#767]]
* Fixed LVM error message caused by copy/paste error [[PR 758][PR#758]].
The following contributors contributed to this release:
* Gustavo Costa
* Kamil Dudka
* Miroslav Suchý
* Sérgio M. Basto
Thank you!
[PR#758]: https://github.com/rpm-software-management/mock/pull/758
[PR#765]: https://github.com/rpm-software-management/mock/pull/765
[PR#767]: https://github.com/rpm-software-management/mock/pull/767
[PR#776]: https://github.com/rpm-software-management/mock/pull/776
[PR#782]: https://github.com/rpm-software-management/mock/pull/782
[PR#771]: https://github.com/rpm-software-management/mock/pull/771
[issue#715]: https://github.com/rpm-software-management/mock/issues/715

View file

@ -0,0 +1,15 @@
---
layout: default
title: Release Notes 2.14
---
Released on - 2021-11-04
## Mock 2.14 has just one regression fix:
* The `--enablerepo` and `--disablerepo` options got broken in v2.13 by the
`optparse => argparse` rewrite. This should be fixed now, and the options
should be working fine.
Thanks to Aleksei Bavshin for reporting the issue in Fedora Bodhi.

View file

@ -0,0 +1,27 @@
---
layout: default
title: Release Notes 2.15
---
Released on - 2021-11-18
## Mock 2.15 contains just two bugfixes:
* Mock v2.13 and v2.14 had a problem with old-style specified `chroot` and
`shell` mode (e.g. `--chroot` specified without leading dashes like `chroot`),
together with commands specified after the `--` separator. If used, Mock
misinterpreted the first part of the command to be executed; concretely, `--`
was considered to be a part of the command to be executed
[[rhbz#2024620][rhbz#2024620]].
* Fixed English grammar in `mock.1` [[PR#796][PR#796]].
The following contributors contributed to this release:
* Adam Williamson
* Cheese1
[rhbz#2024620]: https://bugzilla.redhat.com/2024620
[PR#796]: https://github.com/rpm-software-management/mock/pull/796

154
docs/Release-Notes-2.16.md Normal file
View file

@ -0,0 +1,154 @@
---
layout: default
title: Release Notes 2.16
---
Released on 2021-12-16.
## Mock-core-configs 36.4
The biggest change is the removal of `epel-8-*` configs. It has been replaced by several configs: `alma+epel-8-*`, `centos+epel-8-*`, `oraclelinux+epel-8-*`, `rhel+epel-8-*`, `rocky+epel-8-*`. Every config has its pros and cons:
* `alma+epel-8-*` - This uses Alma Linux 8 + Fedora EPEL. It works right off the bat and it is recommended replacement. The only disadvantage is that Koji actually uses RHEL + EPEL for EPEL builds.
* `centos+epel-8-*` - This uses CentOS 8 + Fedora EPEL. We do **not** recommend using this config, because [CentOS 8 will reach EOL on December 31, 2021](https://www.centos.org/centos-linux-eol/), and will be removed from mirrors on January 31, 2022.
* `oraclelinux+epel-8-*` - This uses Oracle Linux 8 + Fedora EPEL.
* `rhel+epel-8-*` - This uses RHEL 8 + Fedora EPEL. This is the configuration that Koji uses. But it [requires some settings](Feature-rhelchroots) and RHEL subscriptions. As a developer, you can have [16 subscriptions for free](https://developers.redhat.com/blog/2021/02/10/how-to-activate-your-no-cost-red-hat-enterprise-linux-subscription).
* `rocky+epel-8-*` - This uses Rocky Linux 8 + Fedora EPEL. It works right off the bat and it is recommended replacement. The only disadvantage is that Koji actually uses RHEL + EPEL for EPEL builds.
There were [several options on how to handle EOL of epel-* configs](https://docs.google.com/document/d/1wF7-7_y6Ac_oB-kCFdE6VBWPW8o8zjXd2Z0SGy4VxUA/edit?usp=sharing) and we asked EPEL Steering Committee to decide and they [decided to remove epel-* config](https://pagure.io/epel/issue/133#comment-765381). So it is up to you to decide what to use.
Mock will ease it and if you try to build for `epel-8-*` config and this config does not exist, you will get this message:
```
$ mock -r epel-8-x86_64 --shell
ERROR: Could not find required config file: /etc/mock/epel-8-x86_64.cfg
ERROR: There are those alternatives:
ERROR:
ERROR: [1] alma+epel-8-x86_64
ERROR: Use instead: mock -r alma+epel-8-x86_64 --shell
ERROR: Builds against AlmaLinux 8 repositories, together with the official EPEL repositories.
ERROR: Project page: https://almalinux.org/
ERROR: Enable permanently by:
ERROR: $ ln -s /etc/mock/alma+epel-8-x86_64.cfg /home/praiskup/.config/mock/epel-8-x86_64.cfg
ERROR:
ERROR: [2] centos+epel-8-x86_64
ERROR: Use instead: mock -r centos+epel-8-x86_64 --shell
ERROR: Builds against CentOS Linux 8 repositories, together with the official EPEL repositories.
ERROR: This will reach end-of-life in January 2021.
ERROR: Enable permanently by:
ERROR: $ ln -s /etc/mock/centos+epel-8-x86_64.cfg /home/praiskup/.config/mock/epel-8-x86_64.cfg
ERROR:
ERROR: [3] rhel+epel-8-x86_64
ERROR: Use instead: mock -r rhel+epel-8-x86_64 --shell
ERROR: Builds against Red Hat Enterprise Linux 8 repositories, together with the official EPEL repositories.
ERROR: This mimics what is done in the official EPEL build system, but you need a Red Hat subscription:
ERROR: https://rpm-software-management.github.io/mock/Feature-rhelchroots
ERROR: Enable permanently by:
ERROR: $ ln -s /etc/mock/rhel+epel-8-x86_64.cfg /home/praiskup/.config/mock/epel-8-x86_64.cfg
ERROR:
ERROR: [4] rocky+epel-8-x86_64
ERROR: Use instead: mock -r rocky+epel-8-x86_64 --shell
ERROR: Builds against Rocky Linux 8 repositories, together with the official EPEL repositories.
ERROR: Project page: https://rockylinux.org/
ERROR: Enable permanently by:
ERROR: $ ln -s /etc/mock/rocky+epel-8-x86_64.cfg /home/praiskup/.config/mock/epel-8-x86_64.cfg
```
Additional changes are:
* Fedora 33 configs were moved to eol/ directory
* EOLed EPEL Playground configs, per [EPEL Steering Committee decision](https://pagure.io/epel/issue/136)
* Added configs for CentOS Stream 9 + EPEL Next 9
* We expanded `dnf_vars` which cause an issue on EL7 hosts [RHBZ#2026571](https://bugzilla.redhat.com/show_bug.cgi?id=2026571)
* Added compatibility symlinks for EPEL 7 to centos+epel-7-*
* Resolved the multiple "local" repo problems
* Dropped rhel+epel-8-ppc64 config
* Added rhel+epel-8-s390x config
* Added navy-8-x86_64 config
* Reduced packages installed in EPEL chroots
## Mock 2.16 changes:
- Mock got a new configuration option:
```
config_opts["no-config"]["epel-8"] = {}
config_opts["no-config"]["epel-8"]["alternatives"] = {
"alma+epel-8": {
"description": [
"Builds against AlmaLinux 8 repositories, "
"together with the official EPEL repositories.",
"Project page: https://almalinux.org/"
],
}
}
```
When the configuration file for `epel-8-*` does not exist, it will print the text from the `description` field.
There is new file `/etc/mock/chroot-aliases.cfg` which contains defaults, but you can add your own option in your user config.
- There was one issue with BSD Tar, which has been resolved [[GH#820](https://github.com/rpm-software-management/mock/pull/820)]
- There is new option `ssl_extra_certs` [[GH#801](https://github.com/rpm-software-management/mock/pull/801)]
```
config_opts['ssl_extra_certs'] = ['/etc/pki/tls/certs/client.crt', '/etc/pki/tls/certs/',
'/etc/pki/tls/private/client_nopass.key.crt', '/etc/pki/tls/private/']
#config_opts['ssl_extra_certs'] = ['/path/on/host', '/path/in/mock/chroot',
# '/path/on/host2', '/path/in/mock/chroot2', ... ]
```
It copies the host's SSL certificates into a specified location inside the chroot if
mock needs access to repositories requiring client certificate
authentication. Specify the full path to the public certificate on the host
and the destination directory in the chroot. Do the same for the private key.
The private key should not be password-protected if you want Mock to run
unattended.
- For the "bootstrap_image" feature, we use `podman run` command to install
`dnf` stack into the bootstrap container. Prevously we cleaned-up the
environment for the Podman process which in turn caused DNF installation
problems on EL8 ([issue 831](https://github.com/rpm-software-management/mock/issues/831))
- We disabled `seccomp` filtering in `--isolation=nspawn` (the default). This
has been done to avoid build failures on hosts with stricter filters than on
the target chroot ([issue 811](https://github.com/rpm-software-management/mock/issues/831))
- Note **this is the last 2.x release** made from the `main` branch. After this
release, we will create a new branch, and future 2.x versions will get only
important bug fixes and important changes to the config.
A version in `main` will be 3.x and will stop supporting EL7 as build *host*.
This will allow us to get rid of some compatibility code. However, we will
still support building **for** EL7.
We plan to build 3.x for all supported Fedora versions and EPEL 8+. EPEL 7
will stay on 2.x version.
## Currently known issues:
- On Fedora 35+, there are [problems with the nosync.so plugin](https://bugzilla.redhat.com/show_bug.cgi?id=2019329).
Please, to avoid the problems, temporarily disable the nosync.so plugin.
- The `subscription-manager` plugins breaks the DNF stack on Fedora, so when
installed even the normal DNF operations don't work. Updated packages (not
yet in Bodhi updates) help, [see the workaround](https://bugzilla.redhat.com/show_bug.cgi?id=1995465#c6).
**Following contributors contributed to this release:**
* Adil Hussain
* Carl George
* Daniel Berteaud
* Istiak Ferdous
* Justin Vreeland
* Louis Abel
* Miroslav Suchý
* Neal Gompa
* Patrick Laimbock
* Pavel Raiskup
Thank you.

111
docs/Release-Notes-2.2.md Normal file
View file

@ -0,0 +1,111 @@
---
layout: default
title: Release Notes 2.2
---
Released on 2020-04-02.
## Mock 2.2 new features:
* `/etc/mock/site-defaults.cfg` was moved from /etc to %doc, and the
config file is now much smaller (and moved to `mock-core-configs`).
Even before the file was meant to be documentation-only (everything
commented-out), but since it was also configuration file - with
frequent updates in RPM - it was very easy to stop following what's new
there ([#555](../pulls/555)).
* Mock no more strictly depends on `mock-core-configs` package, but depends on
`mock-configs` instead. Even though `mock-core-configs` package still
provides `mock-configs`, but other packages can as well, so users now can
provide alternatives to `mock-core-configs` ([#544](../pulls/544)).
* New `config_opts['isolation']` option invented (alternative to
`--isolation`) to replace boolean `config_opts['use_nspawn']`. The
possible values are `nspawn`, `simple` and `auto` (default). When
`auto` is specified mock tries to use `nspawn` and if it is not
possible, it falls-back to `simple` chroot. This is useful to make
mock work by default in environments like Fedora Toolbox, Podman and
Docker. The old `use_nspawn` option still works, but `isolation` has
preference ([#337](../pulls/337) and [#550](../pulls/550)).
* The `LANG` is set to `C.UTF-8` by default (and always) for chrooted
processes. Previously mock inherited this value from host environment,
and defaulted to `C.UTF-8` otherwise. This was done to make mock more
deterministic, users can change the default by
`config_opts['environment']['LANG']` ([#451](../issues/451)).
## Mock 2.2 bugfixes:
* Fix for doubled log entries in some situations ([#539](../pulls/539),
[RHBZ#1805631](https://bugzilla.redhat.com/1805631)).
* Fix to make mock work in *Fedora Toolbox* even with
`--bootstrap-chroot` ([#550](../pulls/550)).
* Fix for mock in `--privileged` docker container where `os.getlogin()`
did not work ([#551](../pulls/551)).
* When `--bootstrap-chroot` is enabled, things like `rpm -qa --root ...` are
executed in bootstrap chroot, instead of on host. This is to assure that the
RPM used is compatible with target chroot RPMDB ([#525](../issues/525)).
* The `mock --chroot -- CMD ARG1 ARG2` command was fixed so it works correctly
for both `--isolation=simple|nspawn` and `use_bootstrap=True|False`, the
caveats in `--shell` and `--chroot` are now better documented in manual
page ([#550](../pulls/550)).
* Mock `--chain` with `--isolation=simple` was fixed to work with
external URLs ([#542](../pulls/542)).
* Killing of forgotten chrooted processes was made more robust. We now
kill also "daemons" started on background during chroot initialization
-- when packages are installed to mock chroot and some package
scriptlet mistakenly spawns background process ([#183](../issues/183)).
* The `--use-bootstrap-image` was fixed to work on EL7 properly
([#536](../pulls/536)).
* Stuff below `<bootstrap_root>/tmp` is now passed down to mock chroot even
with `--isolation=nspawn` (default). Previously - everything mock prepared
below that directory was automatically overmounted by `systemd-nspawn`.
So newly, stuff like `--install /tmp/some.rpm` or repositories like
`file:///tmp/test-repo` will be correctly used through `--bootstrap-chroot`.
This fix requires new-enough `systemd-nspawn` which supports
`$SYSTEMD_NSPAWN_TMPFS_TMP` environment variable ([#502](../issues/502)).
* Mock configuration; the host-local
`baseurl=file:///some/path/$basearch` repositories with dnf variables
inside were fixed for `--bootstrap-chroot`
([RHBZ#1815703](https://bugzilla.redhat.com/1815703)).
* Mock configuration; the host-local `metalink=file:///some/host/file`
(and mirrorlist) repositories were are fixed for bootstrap
([RHBZ#1816696](https://bugzilla.redhat.com/1816696)).
* With bootstrap, we use configured yum commands instead of hard-wired
`/usr/bin/yum` ([#518](../pulls/518)).
* The `package_state` plugin was fixed to cleanup RPMDB before executing
`rpm -qa`. This broke builds on targets with incompatible RPMDB
backends before (e.g. OpenMandriva).
## Mock-core-configs 32.6
* The `site-defaults.cfg` config file was moved from mock to
`mock-core-configs`.
* The `config_opts['isolation']` is now used instead of
`config_opts['use_nspawn']`, when necessary.
* We declare the minimal version of `mock` by `Requires:` now. At this
point it is version **2.2+**.
* The default bootstrap image was specified for Amazon Linux conifgs.
Following contributors contributed to this release:
* Neal Gompa
* Owen W. Taylor
* Paul Howarth
Thank you.

38
docs/Release-Notes-2.3.md Normal file
View file

@ -0,0 +1,38 @@
---
layout: default
title: Release Notes 2.3
---
Released on 2020-05-22.
## Mock 2.3 bugfixes:
* The `--resultdir RESULTDIR` directory is bind-mounted to bootstrap chroot, so
we can use `--postinstalll` even with `--bootstrap-chroot`,
[#564](../issues/564),
* easier configuration for `mount` plugin, [#578](../issues/578),
* mock raises better error message when `%prep` script fails during
dynamic_biuldrequires resolution, [#570](../issues/570),
* local mirrorlists are correctly bind-mounted to bootstrap chroot,
[RHBZ#1816696](https://bugzilla.redhat.com/1816696),
* traceback for invalid `getresuid()` call, [#571](../issues/571),
* use-cases with `--rootdir` and `--bootstrap-chroot` were fixed, [#560](../issues/560),
* use bootstrap (not host's) `/bin/rpm` when producing list of installed packages,
[PR#568](../pulls/568), (pmatilai@redhat.com),
* braced dnf variables are now expanded in repo URLs,
[PR#577](../pulls/577), (dmarshall@gmail.com).
Following contributors contributed to this release:
* David Marshall
* Neal Gompa
* Panu Matilainen
Thank you.

56
docs/Release-Notes-2.4.md Normal file
View file

@ -0,0 +1,56 @@
---
layout: default
title: Release Notes 2.4
---
Released on - 2020-07-21.
## Mock 2.4 features:
* The file `/dev/btrfs-control` is now available in chroot if host supports it.
This allows to create btrfs-based image builds. [[fedora-infra#9138](https://pagure.io/fedora-infrastructure/issue/9138)].
* Copy source CA certificates -
Prior to this change, we would only copy the "extracted" SSL CA
certificates into the chroot. If anything ran "update-ca-trust" inside
the chroot, this would delete our custom SSL certificates from the
"extracted" directory. For example, Fedora and RHEL's main
"ca-certificates" package always does this in %post, and any custom
third-party package could do this as well.
Copy the entire parent directory so that "sources" and "extracted" are
both present in the chroot. With this change, "update-ca-trust"
does not wipe out the CA certificates from the chroot. [[#588](../issues/588)]
* Add `module_setup_commands` configuration option, The new config option
obsoletes `module_enable` and `module_install` configuration options (but
those are still supported), and allows users to also configure "disable",
"remove" and other commands.
Each command can be specified multiple times, and mock respects the
order of the commands when executing them.
Artificial example: (1) Disable any potentially enabled postgresql module
stream, (2) enable _specific_ postgresql and ruby module streams,
(3) install the development nodejs profile and (4) disable it immediately.
```
config_opts['module_setup_commands'] = [
('disable', 'postgresql'),
('enable', 'postgresql:12, ruby:2.6'),
('install', 'nodejs:13/development'),
('disable', 'nodejs'),
]
```
## Mock 2.4 bugfixes:
* `.rpmmacros` is now created in "rootdir" instead of "basedir"
[[rhbz#1848201](https://bugzilla.redhat.com/1848201)]
Following contributors contributed to this release:
* Ken Dreyer
* Neal Gompa
* Pavel Raiskup
Thank you.

48
docs/Release-Notes-2.5.md Normal file
View file

@ -0,0 +1,48 @@
---
layout: default
title: Release Notes 2.5
---
Released on - 2020-09-03.
## Mock 2.5 features:
* Since the introduction of `mock-configs` virtual provides, it can
happen that `mock-core-configs` is not actually installed. Previously,
the `mock` group would be missing though on such installation because
it was installed by the `mock-core-configs` package. Newly, both
`mock` and `mock-core-configs` depend on the new `mock-filesystem`
package that is responsible for installing both the `mock` system group
and some basic directory layout.
* Mock newly configures the DNF so it sets a custom HTTP User Agent
header when downloading packages. This information can be later used
for better download statistics (e.g.normal end-user package downloads
vs. build-system downloads).
* A new [showrc plugin](https://rpm-software-management.github.io/mock//Plugin-Showrc) was added. It puts the output of the command
`rpm --showrc` into a separate log file in result directory so users may
e.g. use this info during debugging the macro definition peculiarities.
## Mock 2.5 bugfixes:
* Previously, when macro wasn't specified with leading `%` (see the
difference between `config_opts['macros']['foo'] = 'baz'` vs.
`config_opts['macros']['%foo'] = 'baz'`), mock on newer systems
(with new-enough Python 3.8+) failed hard with not really helpful
error. This has been fixed (issue#605).
## Mock-core-configs v33 changes:
* New Fedora ELN config files are provided.
* Some adjustments were done for the new mock-filesystem package.
Following contributors contributed to this release:
* Miroslav Suchý
* Pat Riehecky
Thank you.

48
docs/Release-Notes-2.6.md Normal file
View file

@ -0,0 +1,48 @@
---
layout: default
title: Release Notes 2.6
---
Released on - 2020-09-15.
## Mock 2.6 new features:
* The default `--rebuild` mode now supports `-a|--addrepo` option, as
well as the `--chain` did before,
[rhbz#1857918](bugzilla.redhat.com/1857918).
* The default `--rebuild` mode now also accepts URLs pointing at source
RPMs. In previous versions mock only worked with local source RPMs.
The auto-downloading feature was previously available only in the
`--chain` mode.
## Mock 2.6 bugfixes:
* The configuration files inside buildroot are pre-configured
(or re-configured) by mock even if they are pre-installed by packages
as symbolic links, [rhbz#1878924](bugzilla.redhat.com/1878924).
* Mock previously swallowed the 'rpm -i' error output when installing the
source RPM into chroot and failed. Newly the error output is printed to
stderr.
* Each particular build failure reason in `--chain` build is now properly
dumped to stderr.
* The `--chain` mode now fails right after the first build failure, as
it was previously documented in the manual page. To follow to the
other package builds, one has to specify `--continue`.
* Mock creates `/etc/localtime` as a symlink even with isolation=simple
(per [fedora discussion](https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/BNTFZH6VS43Q7FLRIZYSBOTKDK6KMQZQ/)).
* When systemd-nspawn supports the `--resolv-conf=`, mock newly always
runs it with `--resolv-conf=off`. This is done to revert back the previous
expected name resolution behavior inside mock chroot (the new default
--resolv-conf=auto has broken it).
The following contributors contributed to this release:
* Miroslav Suchý
Thank you.

89
docs/Release-Notes-2.7.md Normal file
View file

@ -0,0 +1,89 @@
---
layout: default
title: Release Notes 2.7
---
Released on - 2020-12-01.
## Mock 2.7 new features:
* [External (non-RPM) build requires](Feature-external-deps) proof of concept introduced. Initially,
there's only a support for PyPI and Crates packages. Any feedback and
patches (e.g. for other software providers) are welcome! It is disabled by default. It can be enabled using:
```
config_opts['external_buildrequires'] = True
```
and then you can use in SPEC files:
```
BuildRequires: external:pypi:foo
```
For more details see [feature page](Feature-external-deps).
* There's a new plugin for pre-processing the input spec files; so the input
spec file "templates" are instantiated right before the source RPM build is
started. See the [plugin documentation](Plugin-rpkg-preprocessor) for more
info.
* The full mock's NAME-VERSION-RELEASE string is now dumped to the log files,
it is now easier to understand what precise Mock version was used during
particular package build.
* Added a new `postupdate` plugin hook; newly the Mock plugins can implement
the automatic "snapshoting" of the buildroot after any package update inside
chroot. This was now used by `root_cache` and `lvm_root` plugins and they
now newly udpate the buildroot cache after `dnf update` ([rhbz#1175346]).
* Mock automatically copies the Katello CA pem file for the local Satellite
server into bootstrap chroot, if such CA is configured on host ([issue#638]).
## Mock 2.7 bugfixes:
* The `config_opts['resultdir']` path can contain `%`-sign, previous versions
of Mock failed on processing such configuration ([issue#639]).
* The `--addrepo <baseurl>` option newly doesn't fail the mock build when the
`<baseurl>` directory doesn't exist. This unifies the behavior of that
option because other errors/typos in the `--addrepo` option are ignored as
well.
* Mock doesn't always traceback if the `rpmbuild` process exists with exit code
11. That exit code only means that there are still some missing "dynamic
Buildrequires" (`%generate_buildrequires`) to be installed by Mock
([issue#560]). We also enhanced the build.log output a bit so it is more
obvious what Mock installs on demand.
* The bare `mock --shell` (login shell execution) was fixed so it doesn't call
`setsid()` prior executing the shell itself. This fixes the shell warning
message `Inappropriate ioctl for device`.
* The `sign` plugin now treats the non-zero exit code from the configured
auto-sign command (usually some `rpmsign` wrapper). Previous versions of
Mock just ignored the failure ([koji#2570]).
* Strange failure on RHEL 8 s390x issue fixed by removing one (probably
invalid) logging call from `preexec_fn`, but the [PR#653] still needs
proper fix (help is welcome).
The following contributors contributed to this release:
* Dominik Turecek
* Jiri Konecny
* Markus Linnala
* Merlin Mathesius
* Michal Novotný
* Miroslav Suchý
Thank you!
[rhbz#1175346]: https://bugzilla.redhat.com/1175346
[issue#560]: https://github.com/rpm-software-management/mock/issues/650
[issue#639]: https://github.com/rpm-software-management/mock/issues/639
[PR#653]: https://github.com/rpm-software-management/mock/pull/653
[issue#638]: https://github.com/rpm-software-management/mock/issues/638
[koji#2570]: https://pagure.io/koji/issue/2570

24
docs/Release-Notes-2.8.md Normal file
View file

@ -0,0 +1,24 @@
---
layout: default
title: Release Notes 2.8
---
Released on - 2020-12-15.
## Mock 2.8 bugfixes:
* The systemd-nspawn wasn't used for --isolation=nspawn. This is regression
in the release v2.7. See [issue 678][issue#678].
* Better error message for certain `rmtree` failures, [PR 677][PR#677].
The following contributors contributed to this release:
* Adam Williamson
* Miroslav Suchý
* Timm Bäde
Thank you!
[issue#678]: https://github.com/rpm-software-management/mock/issues/678
[PR#677]: https://github.com/rpm-software-management/mock/pull/677

37
docs/Release-Notes-2.9.md Normal file
View file

@ -0,0 +1,37 @@
---
layout: default
title: Release Notes 2.9
---
Released on - 2021-01-18.
## Mock 2.9 new features:
* The `rpkg_preprocessor` plugin got new `force_enable` option. This option
tells rpkg_preprocessor to ignore rpkg.conf and always preprocess the spec
file. This is useful for testing mass package changes where it's not
practical to add an rpkg.conf to every package.
* The configuration mechanism was cut-out from mock, and is now newly provided
as new package `python3-templated-dictionary` that mock package depends on.
## Mock-core-configs v33.5 fixes:
* EPEL 6 configuration was marked EOL (moved to eol/ subdirectory).
* Fedora 31 configuration is EOL, too.
* Fixed bootstrap of Fedora on Enterprise Linux 7 boxes.
* Bootstrap images defined for OpenSUSE Tumbleweed.
* RepoIDs renamed for EL8 chroots, according to real repoIDs in normal repo
files.
The following contributors contributed to this release:
* Miroslav Suchý
* Neal Gompa
* Tom Stellard
Thank you!

141
docs/Release-Notes-3.0.md Normal file
View file

@ -0,0 +1,141 @@
---
layout: default
title: Release Notes - Mock v3.0
---
Released on 2022-04-07.
## Mock v3.0 changes:
- Mock `v2.*` releases of Mock were supported on Enterprise Linux 7+. Since
this version `v3.0`, the prerequisite is Enterprise Linux 8 or newer. Mock for
the Enterprise Linux 7 is still supported in the [mock-2 branch][mock-2]
upstream, but it will only receive bug fixes.
This only affects the Mock RPM installation, i.e. the **host** EL7 operating
system where Mock is run. **Building** packages for the **target** Enterprise
Linux 7 chroots continues to be supported in Mock v3.X. More info in the
[original issue][issue #755].
- The minimal runtime requirement now is **Python 3.6**.
- Mock has a new command `--list-chroots` which prints the list of available
chroots with short descriptions ([PR#869][pull #869]). It will go through both
system-wide configuration files in `/etc/mock` and users' configuration in
`~/.config/mock/`. The output looks like:
```
$ mock --list-chroots
INFO: mock.py version 2.16 starting (python version = 3.10.2, NVR = mock-2.16-1.git.3339.8f0b45e.fc35)...
Start(bootstrap): init plugins
INFO: selinux enabled
Finish(bootstrap): init plugins
Start: init plugins
INFO: selinux enabled
Finish: init plugins
INFO: Signal handler active
Start: run
config name description
Global configs:
alma+epel-8-aarch64 AlmaLinux 8 + EPEL
alma+epel-8-ppc64le AlmaLinux 8 + EPEL
alma+epel-8-x86_64 AlmaLinux 8 + EPEL
[..snip..]
rhel-8-x86_64 RHEL 8
rocky+epel-8-aarch64 Rocky Linux 8 + EPEL
rocky+epel-8-x86_64 Rocky Linux 8 + EPEL
rocky-8-aarch64 Rocky Linux 8
rocky-8-x86_64 Rocky Linux 8
Custom configs:
mockbuild.exception.ConfigError: Could not find included config file: /etc/mock/foohkhk
fedora-50-x86_64 error during parsing the config file
fedora-rawhide-python39 Fedora Rawhide
Finish: run
```
In this example, the `fedora-50-x86_64` is a user's configuration file which
has some syntax issue(s).
- There is a new function `mockbuild.config.simple_load_config(name)` available.
You should use it if you want to parse Mock's configuration files. The use is
as simple as:
```
>>> from mockbuild.config import simple_load_config
>>> config_opts = simple_load_config("fedora-rawhide-x86_64")
>>> config_opts["resultdir"]
'/var/lib/mock/fedora-rawhide-x86_64/result'
```
- the [hw_info plugin](Plugin-HwInfo) now reports utilization of volume with `cachedir` directory.
- Source CA certificates found in `/usr/share/pki/ca-trust-source` are now
automatically copied from host to the target chroot, together with the
`/etc/pki/ca-trust` ([PR 864][pull #864]).
- bash completion for `--scrub` and `--short-circuit` has been improved.
- SECCOMP was disabled for `systemd-nspawn` before, and newly we disable it for
Podman commands by default, too ([PR 885][pull #885]).
The SECCOMP rules (syscall allow-lists) maintained in those tools are often
different across distributions or even distro versions. Because Mock does
cross-distribution builds, the "host" distro rules are not always applicable
on the "target" distribution. To not complicate things, and because by design
Mock doesn't have to fully isolate, we disable SECCOMP for those
containerization tools by default. But if you want to enable it, you can now
do it using:
```
config_opts["seccomp"] = True
```
- Since the last release of Mock we have done a few mock-core-configs releases,
see below.
## mock-core-configs-37-1
- EOL CentOS/EPEL 8 configs
- Add Fedora 36
- drop failovermethod=priority from EL8 configs
- Add Extras repo for CentOS Stream 9
## mock-core-configs-37.1-1
- drop EL7 related hack
- link default.cfg file to the right EL N config
- Add CentOS Stream 8 + EPEL 8 configs
## mock-core-configs-37.2-1
- Update CentOS Stream 9 Extras repo to use correct key
- Add AlmaLinux+EPEL 8 for POWER (ppc64le)
- Add AlmaLinux 8 for POWER (ppc64le)
- Deleted Fedora 37/Rawhide armhfp configs
## mock-core-configs-37.3-1
* Provided 'epel-9' symlinks for 'fedpkg mockbuild'
* allow n-2 gpg key for Fedora ELN
* added new key `description` for `--list-chroots` command
**Following contributors contributed to this release:**
* Derek Schrock
* Didik Supriadi
* Miro Hrončok
* Miroslav Suchý
* Neal Gompa
* Pavel Raiskup
* Tomas Tomecek
Thank you.
[mock-2]: https://github.com/rpm-software-management/mock/tree/mock-2
[issue #755]: https://github.com/rpm-software-management/mock/issues/755
[pull #864]: https://github.com/rpm-software-management/mock/pull/864
[pull #885]: https://github.com/rpm-software-management/mock/pull/885
[pull #869]: https://github.com/rpm-software-management/mock/pull/869

77
docs/Release-Notes-3.1.md Normal file
View file

@ -0,0 +1,77 @@
---
layout: default
title: Release Notes - Mock v3.1
---
Released on 2022-07-22.
## Mock v3.1 changes:
- There's a fix for a new RPM behavior on F37+ where `rpmbuild` automatically
cleans the `%buildroot` directory upon a successful build. This behavior is
not desired when Mock user wants to keep the buildroot contents for further
debugging (`config_opts["cleanup_on_success"] = False` is
configured, or `--no-cleanup-after` option is used). [Original bug
report.][rhbz#2105393]
- Mock v3.1+ started using `/bin/tar` instead of `/bin/gtar` for normal work
with archives. This default can be changed by a new option
`config_opts["tar_binary"]`. This should help with distributing Mock to
GNU/Linux distributions where `/bin/gtar` symbolic link doesn't exist.
- Mock v3.1+ *still* expects that that the default system Tar represents
a GNU tar implementation (unless `config_opts["tar"] = 'bsdtar'`). Mock v3.1
version though got several fixes that make the work with the BSD tar
implementation more convenient.
## mock-core-configs-37-4-1
* Add AlmaLinux 9 and AlmaLinux 9 + EPEL configs (neal@gompa.dev)
* Update the AlmaLinux 8 GPG key path (neal@gompa.dev)
* Fix description typo on AlmaLinux 8 for x86_64 (neal@gompa.dev)
* Add RHEL9 templates and configs (carl@george.computer)
## mock-core-configs-37.5-1
* configs: add ELN local Koji repo
* config: sync epel-8 and epel-9 templates
* Add Rocky Linux 9 Configuration and Mod RL8 (label@rockylinux.org)
* Update Fedora ELN repo template (sgallagh@redhat.com)
* EuroLinux 9 chroot configs added (git@istiak.com)
* Fedora 34 is EOL
* circlelinux+epel-8 as epel-8 alternative
* Fix dist value for openSUSE Leap 15.4 (ngompa@opensuse.org)
* Add CircleLinux 8 configs (bella@cclinux.org)
* Add openSUSE Leap 15.4 configs (ngompa@opensuse.org)
* Move openSUSE Leap 15.2 to EOL directory (ngompa@opensuse.org)
* Use MirrorCache for openSUSE repositories instead of MirrorBrain (ngompa@opensuse.org)
* Add Anolis OS 7 and Anolis OS 8 templates and configs (wb-zh951434@alibaba-inc.com)
**Following contributors contributed to this release:**
* babakovalucie
* Bella Zhang
* Carl George
* DominikaMarchovska
* Istiak Ferdous
* JeremiasVavak
* katerin71
* Louis Abel
* Miroslav Suchý
* naveen
* Neal Gompa
* Nico Kadel-Garcia
* Papapja
* PastelBrush
* SpiderKate
* Stephen Gallagher
* terezakoktava
* Zhao Hang
Thank you.
[rhbz#2105393]: https://bugzilla.redhat.com/show_bug.cgi?id=2105393

61
docs/Release-Notes-3.2.md Normal file
View file

@ -0,0 +1,61 @@
---
layout: default
title: Release Notes - Mock v3.2
---
Released on 2022-10-14.
## Mock v3.2 changes:
- The `cleanup_on_success=False` needs to use `rpmbuild --noclean` to avoid
an automatic cleanup of `%{buildroot}` by RPM (we started using `--noclean` in
[v3.1](Release-Notes-3.1). The `--noclean` option is though not available on
old systems (EL6 and older). The new Mock *v3.2* fixes this, and stops using
`--noclean` for old target builds. Related [rhbz#2105393][].
- The `mock --list-chroots` now performs much faster; the amount of `fork()`
calls while listing the chroot configuration files was minimized.
- Files installed into `/var/lib/mock` and `/var/cache/mock` no longer get the
SGID bit (which enforces `mock` group ownership). The bit shouldn't be needed
(by common sense, but also given our testsuite is green), so we dropped the
bit. Should you newly have any inconvenience, please report.
- The `simple_load_config()` library method (used e.g. by Fedora Review) was
simplified so it doesn't attempt to elevate the `mock` group process
ownership. Processing Mock's configuration is equal to evaluating a Python
code, so for security reasons we artificially fail the `simple_load_config()`
call if executed by root, [rhbz#2080735][].
- Error() (Exception) code was rewritten a bit, so the raised exceptions are
easily (de-)serializable by the Python pickle library. We can then e.g.
naturally handle the exceptions raised by Mock's `fork()` sub-processes
(exceptions from child processes are pickle-deserialized). This change could
potentially affect the `mockbuild:get_class_by_code()` users, if any.
- Mock now better detects the Docker environment run on top of
Control Group V2, [PR#986][].
- The `--use-bootstrap-image` now works even if `podman` produces an unexpected
`stderr` output, [PR#954][].
- The `mock-scm` package newly runtime-depends on the `rpkg-util` package. This
package is used for building source RPMs from DistGit, fixes [rhbz#2128212][].
- Mock starts using the SPDX format of License field in the spec file.
**Following contributors contributed to this release:**
* Achal Velani
* Michael Ho
* Miroslav Suchý
Thank you.
[rhbz#2105393]: https://bugzilla.redhat.com/2105393
[PR#954]: https://github.com/rpm-software-management/mock/pull/954
[rhbz#2128212]: https://bugzilla.redhat.com/2128212
[rhbz#2080735]: https://bugzilla.redhat.com/2080735
[PR#986]: https://github.com/rpm-software-management/mock/pull/986

15
docs/Release-Notes-3.3.md Normal file
View file

@ -0,0 +1,15 @@
---
layout: default
title: Release Notes - Mock v3.3
---
Released on 2022-10-17.
## Mock v3.3 bugfixes:
The fix for `--list-chroots` and `simple_load_config()` from
[v3.2](Release-Notes-3.2) disallowed running Mock under the `root` user. Since
this is still a common practice [issue#990][], we relaxed the rule and we only
raise a warning if `simple_load_config()` is executed by `root`.
[issue#990]: https://github.com/rpm-software-management/mock/issues/990

30
docs/Release-Notes-3.4.md Normal file
View file

@ -0,0 +1,30 @@
---
layout: default
title: Release Notes - Mock v3.4
---
Released on 2022-11-15.
## News in Mock v3.4:
- For cross-arch builds (see manual page for the `--forcearch` option), Mock
tries to detect if the (potentially missing) `qemu-user-static` package is
installed. Since Fedora 37, the package got split into a set of packages
arch-specific packages (like `qemu-user-static-x86`, `qemu-user-static-ppc`,
etc.). The Mock v3.4 does a better check, and raises more useful error if the
package is missing.
- Mock newly provides the `/dew/mapper/control` file in chrot, so users may
control the device mapper. This has been requested by
the [Koji team][kojipr#3585] while implementing Kiwi support [PR#1005][].
**Following contributors contributed to this release:**
* Miroslav Suchý
* Neal Gompa
Thank you.
[kojipr#3585]: https://pagure.io/koji/pull-request/3585
[PR#1005]: https://github.com/rpm-software-management/mock/pull/1005

24
docs/Release-Notes-3.5.md Normal file
View file

@ -0,0 +1,24 @@
---
layout: default
title: Release Notes - Mock v3.5
---
Released on 2022-12-01.
## News in Mock v3.5:
- For cross-arch builds (see manual page for the `--forcearch` option), Mock
tries to detect if the (potentially missing) `qemu-user-static` package is
installed. Since Fedora 37, the package got split into a set of packages
arch-specific packages (like `qemu-user-static-x86`, `qemu-user-static-ppc`,
etc.). The Mock v3.4 does a better check, and raises more useful error if the
package is missing.
In Mock v3.5 we further enhanced the related error message(s).
We also fixed a bug in the detection mechanism — mock no longer fails-hard for
a missing architecture (not configured in
`config_opts['qemu_user_static_mapping']`). Mock in such situation newly just
tries its best and continues the build, even though failure is likely.
[PR#1007]: https://github.com/rpm-software-management/mock/pull/1007

View file

@ -0,0 +1,20 @@
---
layout: default
title: Release Notes - Mock configs 39.2
---
### Mock Core Configs changes
- The set of GPG keys used for openSUSE Leap 15.5 was updated to include
the correct key used for the openSUSE Backports repository.
- Previous versions of mock-core-configs referenced `fedora:latest` bootstrap
images for `fedora-eln-ARCH` chroots, which led to preparation errors
caused by [package incompatibilities][issue#1238]. ELN folks though already
provide a better and
["native" ELN image](https://docs.fedoraproject.org/en-US/eln/deliverables/#_container_image),
so the new Mock configs have been switched to use it.
- The `/etc/mock/default.cfg` link installation [has been fixed][pull#1236] for
Fedora ELN.
[issue#1238]: https://github.com/rpm-software-management/mock/issues/1238
[pull#1236]: https://github.com/rpm-software-management/mock/pull/1236

94
docs/Release-Notes-4.0.md Normal file
View file

@ -0,0 +1,94 @@
---
layout: default
title: Release Notes - Mock v4.0
---
Released on 2023-05-22.
## Mock v4.0 new features:
- The RPM Software Management team(s) work hard on the [DNF5][] project, which
is planned to be the [default package manager in F39][]. Compared to [DNF4][],
DNF5 is a from-scratch rewritten software, implying that features and
command-line options might be implemented differently. That's why Mock needed
a special logic to support it. While DNF5 is still not the default at this
moment, Mock 4+ supports it and allows users to experiment:
```
$ mock -r fedora-rawhide-x86_64 --config-opts=package_manager=dnf5 --shell
```
When used like this, Mock installs DNF5 package manager into the bootstrap
chroot first (using DNF5 itself, if found on host, or just using DNF4).
Later, using DNF5 from bootstrap, installs the target Rawhide buildroot.
- The [--use-bootstrap-image](Feature-container-for-bootstrap) feature,
implemented using the containerization [Podman][] command-line tooling, did
not work correctly if Mock itself was run
[in container](index#mock-inside-podman-fedora-toolbox-or-docker-container).
At the time of releasing Mock 4.0, running nested Podman containers still
requires quite a lot of
[configuration done in the image](https://github.com/containers/podman/blob/36510f6/contrib/podmanimage/stable/Containerfile).
So the requirements were relaxed to not run Podman containers, but only
extract the container images using the [podman image mount][PR#1073] feature.
So now, the `--use-bootstrap-image` feature works if Mock is run in Podman.
- Mock historically called the `useradd` utility with `-n` option to not create
the default `mock` group in the chroot. The `-n` option has been a Red Hat
Enterprise Linux downstream patch, later implemented upstream as `-N`. The
`-N` option is now supported almost everywhere (since RHEL 6+). If you build
for older chroots than Enterprise Linux 6 (EOL nowadays), you might need to
modify the `config_opts["useradd"]` option.
## Mock v4.0 bugfixes:
- The "essential" mount-points (`/proc`, `/sys`, ..) were not correctly mounted
to the target buildroot at the time of its installation/initialization (when
package manager from bootstrap chroot is used to install the buildroot
packages). This wasn't very obvious, because, during the later phases of Mock
builds, Mock had those essential mount points mounted. This caused issues
with the installation of packages that relied on their existence, see
[rhbz#2166028].
- Before killing the leftover in-chroot processes, older Mock versions first
unmounted (well at least it tried) the mounted filesystems in the chroot.
This has been fixed, and Mock does it vice-versa so both unmounting itself is
less likely to have problems and killing the processes is easier.
- Mock ignored the `bootstrap_` prefixed `config_opts` options, especially
useful on commandline for debugging (e.g.
`--config-opts=bootstrap_chroot_additional_packages=package-foo`). The
configuration option logic
[was adjusted](https://github.com/rpm-software-management/mock/commit/8bd4adcaa197af4a7b6a915a01484c51d1c1cc5b)
to fix this problem.
- The manual page of Mock was fixed so users are now instructed to fill issues
against the GitHub upstream [Mock project](https://github.com/rpm-software-management/mock/issues),
not the Red Hat Bugzilla.
## mock-core-configs-38.5-1
- Fedora 35 and 36 are now EOL, so the configuration was moved
- The `includepkgs=devtoolset*` options were
[dropped](https://github.com/rpm-software-management/mock/pull/1042) from the
SCL-related CentOS 7 configuration. This allows the installation of other SCL
packages during package build (specified by `BuildRequires:`).
- The `useradd` override configuration was removed as it is not needed now,
Mock v4.0 now uses `useradd -N` (not `useradd -n`) by default.
- The openSUSE i586 repos have been moved out of the main repos into a port.
**Following contributors contributed to this release:**
* @cheese1
* @lilinjie
* Miroslav Suchý
Thank you.
[Podman]: https://podman.io/
[DNF5]: https://github.com/rpm-software-management/dnf5
[DNF4]: https://github.com/rpm-software-management/dnf
[PR#1073]: https://github.com/rpm-software-management/mock/pull/1073
[default package manager in F39]: https://fedoraproject.org/wiki/Changes/ReplaceDnfWithDnf5
[rhbz#2166028]: https://bugzilla.redhat.com/show_bug.cgi?id=2166028

50
docs/Release-Notes-4.1.md Normal file
View file

@ -0,0 +1,50 @@
---
layout: default
title: Release Notes - Mock v4.1
---
Released on 2023-06-05.
## Mock v4.1 new features:
- The `/bin/dnf` path can be either provided by [DNF5][] on newer systems
([Fedora 39+][default package manager in F39]), or by [DNF4][] on older
systems. The detection of `/bin/dnf` though wasn't ideal. Newly, if [DNF4][]
is requested, Mock searches for the `/bin/dnf-3` script instead. Also, when
installing [DNF4][] into a bootstrap chroot, `python3-dnf` is installed
instead of just `dnf` which might install [DNF5][].
- We newly allow installing the bootstrap chroot using `/bin/dnf5` as fallback,
if the requested package manager is not found on host (e.g. if
`package_manager=dnf` is set for particular chroot, but only [DNF5][] is
available on host, i.e. the future systems). Previous version of Mock would
just fail verbosely.
- The `mock.rpm` runtime dependencies were changed and relaxed. We newly don't
strictly require any of the package managers. Having `dnf5` or `python3-dnf`
installed on host is just a `Suggested` thing, and it is newly up to the user
to install one of them (on Fedora 39+, [DNF5][] will be more commonly the
choice). Strictly speaking, with the `--use-bootstrap-image` feature, no
package manager on host is needed at all.
- We use the same package manager search logic for bootstrap, non-bootstrap or
bootstrap image use-cases.
## Mock v4.1 bugfixes:
- The Mock v4.0 broken chroot configurations with custom SSL certificates and
bootstrap (the certificates were not copied into the bootstrap chroot
correctly). This problem [has been fixed][issue#1094].
- The `bind_mount` plug-in newly pre-creates the destination directory in-chroot
for bind-mounted files. See [PR#1093][] for more info.
- The --dnf-cmd option was fixed for the revamped `package_manager` detection
logic. See [PR#1087][] for more info.
[default package manager in F39]: https://fedoraproject.org/wiki/Changes/ReplaceDnfWithDnf5
[PR#1087]: https://github.com/rpm-software-management/mock/pull/1087
[PR#1093]: https://github.com/rpm-software-management/mock/pull/1093
[issue#1094]: https://github.com/rpm-software-management/mock/issues/1094
[DNF4]: https://github.com/rpm-software-management/dnf
[DNF5]: https://github.com/rpm-software-management/dnf5

213
docs/Release-Notes-5.0.md Normal file
View file

@ -0,0 +1,213 @@
---
layout: default
title: Release Notes - Mock v5.0
---
Released on 2023-08-09.
## Mock v5.0 new features:
- The `use_bootstrap_image` feature has been turned on as it was stabilized in
this release and it speeds up the bootstrap chroot preparation a lot
(by not installing potentially hundreds of packages into the bootstrap chroot,
but just extracting the `bootstrap_image` contents). For the RHEL based chroots
(where UBI `bootstrap_image` is in use, and where `python3-dnf-plugins-core`
is installed by default) we also turned on the `bootstrap_image_ready=True`
which drastically speeds the bootstrap preparation. See the explanation for
`bootstrap_image_ready` below. See [PR#1101][] for more info.
- Start using `useradd` and `userdel` utilities from the host to modify
in-chroot `etc/passwd` and `etc/group`. This allowed us to remove
the `shadow-utils` package from the list of "minimal buildroot" packages
([issue#1102][]).
- There's a new feature `config_opts['copy_host_users'] = ['pesign', ...]` that
allows users to specify a list of users to pre-create in buildroot, copying
the IDs from the host. Users/groups used to be historically created by
post-scriptlets from the buildroot packages, but the user/group IDs often did
not match the IDs on the host - possibly causing weird and hard to fix issues
similar to the [Pesign one][issue#1091].
- Make sure the `/dev/fuse` device is available in Mock buildroot with
`--isolation=nspawn`. Without this device, we could not use FUSE filesystems
with image builds ([PR#1158][] and the [Fedora Infra issue][fuseInfra]).
- New option `config_opts['bootstrap_image_ready'] = True|False` was invented.
When set to `True`, Mock doesn't try to do any package manager actions inside
bootstrap (normally Mock installs `dnf` tooling there). It simply assumes
that the bootstrap image is ready to use (that the `dnf` tooling is already
installed on the image). This might fix hard-to-debug/hard-to-fix issues like
[issue#1088][] when an unexpected bootstrap image is used. This option is
enabled by default for RHEL 8 and 9 chroots only.
- The Podman container environment is able to automatically pass down the Red
Hat Subscription credentials anytime a RHEL-based (UBI) container is run. But
the credential files are then on different path than when run natively on
the host, and that used to break Mock. Newly, when Mock is run in a Podman
container, the credentials passed down by Podman are automatically detected
and used ([PR#1130][]).
- Even though the requested buildroot is cross-arch (must be initialized with
cross-arch packages using the `--forcearch RPM` feature), the bootstrap chroot
is newly always prepared with the native architecture. This change has been
done to optimize the final buildroot installation — using the "arch natively"
compiled DNF stack is much faster than cross-arch emulation using
`qemu-user-static`. As a benefit, we can newly simply use the "native"
Podman-pulled `bootstrap_image` even for cross-arch builds (we have to play
with Glibc's "personality" a bit, but still). See [issue#1110][].
- The bootstrap-related logging has been changed so the corresponding log
entries are now appended to the default `root.log` file. This change should
lead to a better understanding what is going on in the bootstrap chroot
([issue#539][] and [PR#1106][]).
- An easier way to skip Mock plugin execution in Bootstrap chroot has been
invented. It is now enough to just specify `run_in_bootstrap = False` global
variable in such a plugin, see [PR#1116][] for more info. The plugin
`hw_info` has been newly disabled this way.
- The bootstrap chroot installation was made smaller; newly only the
`python3-dnf` and `python3-dnf-plugins-core` are installed, instead of `dnf`
and `dnf-plugins-core` (which used to install also unnecessary documentation
files).
- Automatic file downloads (for example with `mock https://exmaple.com/src.rpm`
use cases) have been changed to automatically retry the download several times
to work around random network failures ([PR#1132][] and [PR#1134][]).
- The `dnf` and `dnf5` processes are newly always executed with the
`--setopt=allow_vendor_change=yes` option. This is done in belief that we
don't have to protect the Mock builds against `Vendor:` changes, while
overriding the distro-default RPMs is quite a common thing (`mock --chain`
e.g.) while mimicking the distro-default `Vendor` tag would be a painful task.
The thing is that the `allow_vendor_change=no` is going to be set by default
in DNF5 soon and we want to prevent unnecessary surprises. Also, openSUSE has
been reported to use this even with DNF4 ([PR#1160][]).
- Mock now considers DNF5 to be a valid package manager alternative. For
example considering
1. that Bootstrap chroot is generated from a bootstrap image,
2. expected package manager is DNF4 (`package_manager == 'dnf'`)
3. but the selected image has only `dnf5` installed by default
then Mock properly finds the `/bin/dnf5` command in-bootstrap, uses it to
install `/bin/dnf-3` into the bootstrap chroot first and then it uses
`/bin/dnf-3` in bootstrap for the final target buildroot installation.
## Mock v5.0 bugfixes:
- The orphan-process killing feature was enhanced to also properly kill
processes started by `dnf install` post-scriptles (installing from bootstrap
to buildroot), see [issue#1165][].
- The `podman pull` logic that Mock does in the background with
`--use-bootstrap-image` (now by default) was fixed to not affect the
`mock --shell` stdout. That was a bug, stdout is often parsed by callers.
- The fact that we use in-bootstrap package manager for *installation stuff into
the bootstrap chroot itself* revealed that we have to do certain mountpoints
[earlier than we used to][PR#1167].
- Make sure we properly unmount all the Mock mount internal points even though
the Mock process was interrupted using `CTRL+C` (`KeyboardInterrupt`
exception). This has fixed a long-term observed bug that kept things mounted
longer than necessary, eventually breaking even subsequent `mock --scrub`
attempts. Also, the internal directory removal method has been fixed to
*try its job harder* under [certain circumstances][PR#1058]. Relates to
[rhbz#2176689][], [rhbz#2176691][], [rhbz#2177680][], [rhbz#2181641][], etc.
- Python `imp` module was removed from Python 3.12, so the code was migrated to
`importlib`, [issue#1140][].
- Automatic SRPM downloads from the web were handling the file names specified
by HTTP headers using the long-time deprecated `cgi` module. The module is
being dropped from Python v3.13 so Mock 5.0 has been fixed to use
`email.message` library which now provides the same functionality
([PR#1134][]).
- The default recursion limit for Python scripts is set to 1000 (for non-root
users); this hasn't been enough for Mock in some use-cases so the limit has
been increased in v5.0+. For example, some utilities have directory-tree
stress-tests their test suites, and for such cases a very large directory tree
can cause too deep recursive calls of the `shutil.rmtree()` method. Users
can newly also override the Mock's default via the
`config_opts["recursion_limit"]` option.
- Mock newly never uses the `--allowerasing` option with the `dnf5 remove`
command (this option has not been implemented in DNF5 and DNF5 simply fails,
contrary to the old DNF4 code where it was implemented a no-op,
[issue#1149][]).
- The SSL certificate copying has been fixed [once more][PR#1113] to use our own
`update_tree()` logic because the `distutils.copy_tree()` was removed from the
Python stdlib, and the new stdlib alternative `shutil.copytree()` is not
powerful enough for the Mock use-cases ([issue#1107][]).
- Mock no longer dumps the long output of the `rpmbuild --help` command into
`build.log`, fixes [issue#999][].
## mock-core-configs v39 changes:
- Fedora 39 configuration is branched from Rawhide, as branching date
is [2023-08-08](https://fedorapeople.org/groups/schedule/f-39/f-39-all-tasks.html).
- The new `mock-core-configs` package is not compatible with older Mock
versions, therefore the requirement was bumped to `v5.0` or newer.
- Started using `bootstrap_image_ready = True` for RHEL-based configs as UBI
images contain all the necessary DNF tooling by default ([PR#1101][]).
- Disable `use_bootstrap_image` for the Mageia chroots; Mageia doesn't provide
an officially supported (and working) container images that we could set in
the `bootsrap_image` config option ([issue#1111][]).
- Dropped the `config_opts['useradd']` option from all the configs; the
`useradd` utility from now on always executed on the host (not in chroot) with
the `--prefix <chrootRoot>` options ([issue#1102][]).
- Using `$releasever` in openEuler metalink URLs.
- Several configuration files were updated to work correctly with the new
`use_bootstrap_image = True` in Mock 5.0. Relates to [issue#1171][]
**Following contributors contributed to this release:**
* Miro Hrončok
* Miroslav Suchý
* Neal Gompa
* zengwei2000
* zengchen1024
Thank you.
[PR#1058]: https://github.com/rpm-software-management/mock/pull/1058
[PR#1101]: https://github.com/rpm-software-management/mock/pull/1101
[PR#1106]: https://github.com/rpm-software-management/mock/pull/1106
[PR#1113]: https://github.com/rpm-software-management/mock/pull/1113
[PR#1116]: https://github.com/rpm-software-management/mock/pull/1116
[PR#1130]: https://github.com/rpm-software-management/mock/pull/1130
[PR#1132]: https://github.com/rpm-software-management/mock/pull/1132
[PR#1134]: https://github.com/rpm-software-management/mock/pull/1134
[PR#1158]: https://github.com/rpm-software-management/mock/pull/1158
[PR#1158]: https://github.com/rpm-software-management/mock/pull/1160
[PR#1167]: https://github.com/rpm-software-management/mock/pull/1167
[issue#539]: https://github.com/rpm-software-management/mock/issues/539
[issue#999]: https://github.com/rpm-software-management/mock/issues/999
[issue#1088]: https://github.com/rpm-software-management/mock/issues/1088
[issue#1091]: https://github.com/rpm-software-management/mock/issues/1091
[issue#1102]: https://github.com/rpm-software-management/mock/issues/1102
[issue#1107]: https://github.com/rpm-software-management/mock/issues/1107
[issue#1110]: https://github.com/rpm-software-management/mock/issues/1110
[issue#1111]: https://github.com/rpm-software-management/mock/issues/1111
[issue#1140]: https://github.com/rpm-software-management/mock/issues/1140
[issue#1149]: https://github.com/rpm-software-management/mock/issues/1149
[issue#1165]: https://github.com/rpm-software-management/mock/issues/1165
[issue#1171]: https://github.com/rpm-software-management/mock/issues/1171
[rhbz#2176689]: https://bugzilla.redhat.com/2176689
[rhbz#2176691]: https://bugzilla.redhat.com/2176691
[rhbz#2177680]: https://bugzilla.redhat.com/2177680
[rhbz#2181641]: https://bugzilla.redhat.com/2181641
[fuseInfra]: https://pagure.io/fedora-infrastructure/issue/11420

View file

@ -0,0 +1,29 @@
---
layout: default
title: Release Notes - Mock 5.1.1
---
Released on 2023-09-18.
## Mock 5.1.1 bugfixes
- [commit#1e13b56ce3c0efdf81][] caused "basedir" to be created only once per Mock
run, but likewise directory "rootdir" was created only once.
Since Mock automatically unmounts rootdir **after each build** and then
also **removes the rootdir** directory to finish the cleanup tasks (at
least if tmpfs or other "root" plugin is in use, --resultdir is in
use, ...), subsequent builds failed to re-mount the rootdir with, e.g.:
ERROR: Command failed:
$ mount -n -t tmpfs -o mode=0755 -o nr_inodes=0 -o size=140g mock_chroot_tmpfs /var/lib/mock/fedora-37-x86_64-1694797505.326095/root
This caused problems e.g. [in Fedora Copr][copr_issue#2916] where each
Mock build is actually a two-step build done like:
mock --spec foo.spec --sources . --resultdir ...
So Mock first builds SRPM, and then builds RPMs (two builds in one run).
[commit#1e13b56ce3c0efdf81]: https://github.com/rpm-software-management/mock/commit/1e13b56ce3c0efdf81
[copr_issue#2916]: https://github.com/fedora-copr/copr/issues/2916

156
docs/Release-Notes-5.1.md Normal file
View file

@ -0,0 +1,156 @@
---
layout: default
title: Release Notes - Mock v5.1 and mock-core-configs v39.1
---
Released on 2023-09-15.
## New 5.1 features
- We [implemented a convenience fallback][PR#1200] 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][commit#395fc07f796] 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][PR#1210] 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][commit#8c7aad5680e8f86] raised when running
Podman in Docker, potentially without `docker run --privileged`. This should
decrease the confusion if Mock subsequently falls-back to non-default
`use_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][issue#42] 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][PR#1197]
`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](https://github.com/containers/podman/issues/19717), which caused
[hard-to-debug build failures](https://github.com/fedora-copr/copr/issues/2875).
Mock 5.1 therefore [implements a new assertion][PR#1199] failing the build
early, before mistakenly trying to run emulated "--forcearch" chroot leading to
failure. The assertion is exposed as a Python library call
`mockbuild.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][PR#1189], 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 default `mode=0777` potentially
allowing anyone to accidentally write there and cause e.g. unmount failures.
New Mock [uses `mode=0755`][PR#1213] instead.
- The `systemd-nspawn` utility [v253.9 started
failing](https://github.com/systemd/systemd/issues/29174) with pre-mounted
`<buildroot>/proc` directory (used like `systemd-nspawn -D <buildroot>`).
The resulting Mock error, per several reports like [this
one](https://github.com/fedora-copr/copr/issues/2906), 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"][PR#1214]
`<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][PR#1214] 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][issue#1186] 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][PR#1214].
- The `--installdeps foo.spec` feature is implemented using the RPM Python API.
Previously we used the method `hdr.dsFromHeader()` to get the list of
`BuildRequires`. This method has been removed from the Python RPM API (rpm
v4.19) in favor of the long-enough existing `rpm.ds(hdr, ...)` method. Mock
[has started using `rpm.ds()` API call][PR#1223] to fix the [`AttributeError:
'rpm.hdr' object has no attribute 'dsFromHeader'`][issue#1203] traceback on
newer systems (e.g. Fedora 40+).
- The `--shell` standard output is no longer affected by `podman 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][PR#1175], too.
- openSUSE Leap 15.5 configuration [added][PR#1175].
**Following contributors contributed to this release:**
* Evan Goode
* Miroslav Suchý
* Neal Gompa
* Pavel Raiskup
* Takuya Wakazono
Thank you.
[PR#1200]: https://github.com/rpm-software-management/mock/pull/1200
[issue#1186]: https://github.com/rpm-software-management/mock/issues/1186
[PR#1220]: https://github.com/rpm-software-management/mock/pull/1220
[issue#1203]: https://github.com/rpm-software-management/mock/issues/1203
[issue#42]: https://github.com/rpm-software-management/mock/issues/42
[PR#1189]: https://github.com/rpm-software-management/mock/pull/1189
[issue#1184]: https://github.com/rpm-software-management/mock/issues/1184
[commit#395fc07f796]: https://github.com/rpm-software-management/mock/commit/395fc07f796
[PR#1210]: https://github.com/rpm-software-management/mock/pull/1210
[PR#1197]: https://github.com/rpm-software-management/mock/pull/1197
[issue#1191]: https://github.com/rpm-software-management/mock/issues/1191
[PR#1199]: https://github.com/rpm-software-management/mock/pull/1199
[commit#8c7aad5680e8f86]: https://github.com/rpm-software-management/mock/commit/8c7aad5680e8f86
[PR#1223]: https://github.com/rpm-software-management/mock/pull/1223
[issue#1181]: https://github.com/rpm-software-management/mock/issues/1181
[PR#1213]: https://github.com/rpm-software-management/mock/pull/1213
[PR#1175]: https://github.com/rpm-software-management/mock/pull/1175
[PR#1214]: https://github.com/rpm-software-management/mock/pull/1214

30
docs/Release-Notes-5.2.md Normal file
View file

@ -0,0 +1,30 @@
---
layout: default
title: Release Notes - Mock 5.2
---
Released on 2023-09-27.
### Mock 5.2 new features
- Mock newly logs out its command-line arguments to better deduct what was
happening at build time.
### Bugfixes
- The fixes introduced in Mock 5.1 included a compatibility issue with Python in
Enterprise Linux 8 due to a dependency on the `capture_output=True` feature in
the `subprocess` module, which was added in Python 3.7. However, EL 8 is
running on Python 3.6. This compatibility issue has been resolved in Mock by
using `stdout=subprocess.PIPE` instead. This update was made based on a [report
from Bodhi update](https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2023-45ace77fca).
- Previous versions of Mock mistakenly expanded every `~` occurrence
(tilde character) in the specified source path with `--copyout`. So
files `~/foo~bar.txt` were searched on path `/builddir/foo/builddirbar.txt`
instead of just `/builddir/foo~bar.txt`. Fixes [rhbz#2239035][].
- The Mock state monitoring (creating state.log) was fixed so that Mock, unless
some exception is raised, always checks that we finished all the states we
started.
[rhbz#2239035]: https://bugzilla.redhat.com/2239035

97
docs/Release-Notes-5.3.md Normal file
View file

@ -0,0 +1,97 @@
---
layout: default
title: Release Notes - Mock v5.3
---
Released on 2023-12-13.
### Mock 5.3 new features
- A new plugin to pre-process spec files with rpmautospec [has been
implemented][PR#1253].
If this plugin is enabled, mock pre-processes spec files that use rpmautospec
features (for automatic release numbering and changelog generation) before
building a source RPM.
- Only run the `%prep` section once when running `%generate_buildrequires`
multiple times.
Previously Mock run `%prep` repeatedly before each `%generate_buildrequires`
round except for the last one. This was inconsistent and unnecessary
slow/wasteful.
When the original support for `%generate_buildrequires` landed into Mock,
the intention was to only call `%prep` once.
However when Mock added support for multiple rounds of
`%generate_buildrequires`, `%prep` ended up only being skipped in the final
`rpmbuild` call. This was an oversight. `%prep` is now only called once, as
originally intended.
Some RPM packages might be affected by the change, especially if a dirty
working directory after running `%generate_buildrequires` affects the results
of subsequent rounds of `%generate_buildrequires`. However, such behavior was
undefined and quite buggy even previously, due to the lack of the `%prep`
section in the final `rpmbuild` call.
Packages that need to run commands before every round of
`%generate_buildrequires` should place those commands in the
`%generate_buildrequires` section itself rather than `%prep`.
- The automatic killing feature for orphan processes within the chroot environment
[was][PR#1255] [improved][PR#1268] to also provide the user with information
about the command-line arguments of the terminated process:
`WARNING: Leftover process 1331205 is being killed with signal 15: daemon --with-arg`
- The info about package management tooling used to install the target buildroot
has been updated to provide the info earlier, before the buildroot
installation happens. Mock newly informs also about dnf5 presence.
### Bugfixes
- The Bash completion bug in Mock for options accepting multiple arguments,
tracked in the [long-standing issue][issue#746], has been resolved through [PR#1262].
- If DNF 5 sees an "interactive" TTY on stdout, it will try to draw progress bars
and cause the Mock logs to [be garbled](https://github.com/fedora-copr/copr/issues/3040).
This release brings a fix that simply sets the output of DNF5 to a pipe instead
of a PTY.
- When Mock completes the installation of all the requirements generated
by `%generate_buildrequries`, it calls `rpmbuild -ba` to perform a final build
of the package.
During the final build, `%generate_buildrequries` runs again in order to
generate a list of `BuildRequires` to be added to the built SRPM metadata.
An arbitrary `%generate_buildrequries` section may generate different
requirements that may not have been installed.
Previously, the `rpmbuild -ba` call used the `--nodeps` option,
hence it was [possible to successfully build a package with
unsatisfiable BuildRequires in the built SRPM metadata][issue#1246].
When a bootstrap chroot is used, the `--nodeps` option is
[no longer used][PR#1249] in the final `rpmbuild -ba` call.
If `%generate_buildrequries` attempts to generate new unsatisfied requirements
during the final build, the build will fail.
When a bootstrap chroot is not used, the `--nodeps` option remains because
Mock cannot know if the RPM in chroot can read the RPM database.
**Following contributors contributed to this release:**
* Evan Goode
* Jakub Kadlcik
* Miro Hrončok
* Orion Poplawski
* Stephen Gallagher
Thank you!
[issue#746]: https://github.com/rpm-software-management/mock/issues/746
[PR#1268]: https://github.com/rpm-software-management/mock/pull/1268
[issue#1246]: https://github.com/rpm-software-management/mock/issues/1246
[PR#1255]: https://github.com/rpm-software-management/mock/pull/1255
[PR#1262]: https://github.com/rpm-software-management/mock/pull/1262
[PR#1249]: https://github.com/rpm-software-management/mock/pull/1249
[PR#1253]: https://github.com/rpm-software-management/mock/pull/1253

13
docs/Release-Notes-5.4.md Normal file
View file

@ -0,0 +1,13 @@
---
layout: default
title: Release Notes - Mock 5.4 (bugfix release)
---
Released on 2024-01-04.
### Mock 5.4 bugfixes
- This release fixes how the rpmautospec plugin installs its dependencies into
the build root, see [PR#1275][] for more info.
[PR#1275]: https://github.com/rpm-software-management/mock/pull/1275

Some files were not shown because too many files have changed in this diff Show more