forked from rpm-software-management/mock
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There are new options, --calculate-build-dependencies and --isolated-build. New buildroot_lock plugin added. Fixes: rpm-software-management#1358 Merges: rpm-software-management#1393 Relates: rpm-software-management#1380
- Loading branch information
Showing
24 changed files
with
1,268 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Feature: Mock 5.7+ supports isolated builds | ||
|
||
@isolated_build | ||
Scenario: Isolated build against a DNF5 distribution | ||
Given an unique mock namespace | ||
When deps for python-copr-999-1.src.rpm are calculated against fedora-rawhide-x86_64 | ||
And a local repository is created from lockfile | ||
And an isolated build is retriggered with the lockfile and repository | ||
Then the build succeeds | ||
And the produced lockfile is validated properly | ||
|
||
# We'd like to use centos-stream+epel-9 here right now, but c9s is not | ||
# bootstrap_image_ready=True :-( and rhel-9 packages are CDN (RHSM) | ||
# only. We SHOULD be fine with c10s once container images are available. | ||
# Fedora 40 is DNF4 but not "bootstrap_image_ready" either :-( | ||
#Scenario: Isolated build against a DNF4 distribution | ||
# Given an unique mock namespace | ||
# When deps for mock-test-bump-version-1-0.src.rpm are calculated against centos-stream+epel-10-x86_64 | ||
# And a local repository is created from lockfile | ||
# And an isolated build is retriggered with the lockfile and repository | ||
# Then the build succeeds | ||
# And the produced lockfile is validated properly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
--- | ||
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 [Isolated Builds feature page](feature-isolated-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 | ||
|
||
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 [Isolated Builds](feature-isolated-builds). | ||
|
||
Example structure | ||
----------------- | ||
|
||
Contents of such a lockfile may look like: | ||
|
||
{ | ||
"version": "1.0.0", | ||
"buildroot": { | ||
"packages": [ | ||
{ | ||
"license": "MIT", | ||
"name": "fedora-repos-rawhide", | ||
"version": "42", | ||
"release": "0.1", | ||
"arch": "noarch", | ||
"epoch": null, | ||
"sigmd5": "4378929dac9e51ed8470de5173ae664e", | ||
"signature": null, | ||
"url": "http://ftp.sh.cvut.cz/fedora/linux/development/rawhide/Everything/x86_64/os/Packages/f/fedora-repos-rawhide-42-0.1.noarch.rpm" | ||
}, | ||
... | ||
] | ||
}, | ||
"config": { | ||
"target_arch": "x86_64", | ||
"legal_host_arches": [ | ||
"x86_64" | ||
], | ||
"dist": "rawhide", | ||
"package_manager": "dnf5", | ||
"bootstrap_image": "registry.fedoraproject.org/fedora:rawhide", | ||
"bootstrap_image_ready": true | ||
} | ||
} | ||
|
||
The list of packages is sorted by the `name + arch` pair. |
Oops, something went wrong.