diff --git a/files/1000-add-oci-platform-support-for-x86_64-sub-arch.patch b/files/1000-add-oci-platform-support-for-x86_64-sub-arch.patch index 4b5bf0d..1778ac3 100644 --- a/files/1000-add-oci-platform-support-for-x86_64-sub-arch.patch +++ b/files/1000-add-oci-platform-support-for-x86_64-sub-arch.patch @@ -19,19 +19,19 @@ check, and error paths. Fixes: #1732 --- - mock/py/mock.py | 8 +- - mock/py/mockbuild/config.py | 7 + - mock/py/mockbuild/podman.py | 7 +- - mock/tests/test_podman.py | 130 ++++++++++++++++++ + py/mock.py | 8 +- + py/mockbuild/config.py | 7 + + py/mockbuild/podman.py | 7 +- + tests/test_podman.py | 130 ++++++++++++++++++ .../oci-platform-sub-arch.feature.md | 5 + 5 files changed, 155 insertions(+), 2 deletions(-) - create mode 100644 mock/tests/test_podman.py + create mode 100644 tests/test_podman.py create mode 100644 releng/release-notes-next/oci-platform-sub-arch.feature.md -diff --git a/mock/py/mock.py b/mock/py/mock.py +diff --git a/py/mock.py b/py/mock.py index 270043611..0ed4b746a 100755 ---- a/mock/py/mock.py -+++ b/mock/py/mock.py +--- a/py/mock.py ++++ b/py/mock.py @@ -773,8 +773,14 @@ def main(): # Enforce host-native repo architecture for bootstrap chroot (unless # bootstrap_forcearch=True, which should never be the case). This @@ -48,10 +48,10 @@ index 270043611..0ed4b746a 100755 # with bootstrap image, bootstrap is always native bootstrap_buildroot_config['repo_arch'] = config_opts['repo_arch_map'].get(host_arch, host_arch) elif host_arch not in config_opts.get("legal_host_arches", []) \ -diff --git a/mock/py/mockbuild/config.py b/mock/py/mockbuild/config.py +diff --git a/py/mockbuild/config.py b/py/mockbuild/config.py index 34244fa45..cc80cec84 100644 ---- a/mock/py/mockbuild/config.py -+++ b/mock/py/mockbuild/config.py +--- a/py/mockbuild/config.py ++++ b/py/mockbuild/config.py @@ -429,6 +429,13 @@ def setup_default_config_opts(): 'i686': 'i386', } @@ -66,10 +66,10 @@ index 34244fa45..cc80cec84 100644 config_opts["recursion_limit"] = 5000 config_opts["calculatedeps"] = None -diff --git a/mock/py/mockbuild/podman.py b/mock/py/mockbuild/podman.py +diff --git a/py/mockbuild/podman.py b/py/mockbuild/podman.py index 286d5fae3..67369534a 100644 ---- a/mock/py/mockbuild/podman.py -+++ b/mock/py/mockbuild/podman.py +--- a/py/mockbuild/podman.py ++++ b/py/mockbuild/podman.py @@ -117,7 +117,12 @@ def pull_image(self): """ pull the latest image, return True if successful """ logger = getLog() @@ -84,11 +84,11 @@ index 286d5fae3..67369534a 100644 res = subprocess.run(cmd, env=self.buildroot.env, stdout=subprocess.PIPE, stderr=subprocess.PIPE, -diff --git a/mock/tests/test_podman.py b/mock/tests/test_podman.py +diff --git a/tests/test_podman.py b/tests/test_podman.py new file mode 100644 index 000000000..ec2187cc8 --- /dev/null -+++ b/mock/tests/test_podman.py ++++ b/tests/test_podman.py @@ -0,0 +1,130 @@ +# -*- coding: utf-8 -*- +"""Unit tests for mockbuild.podman — OCI platform pull and architecture check.""" @@ -232,56 +232,3 @@ index 000000000..0dc976c3a +strings (e.g. `linux/amd64/v2`), and the architecture check accepts +variant images on a matching base host. -From bf697c9d5211127bcab6d7b613082e069bb9bb83 Mon Sep 17 00:00:00 2001 -From: Andrew Lukoshko -Date: Mon, 6 Apr 2026 19:12:51 +0200 -Subject: [PATCH 2/2] configs: re-enable bootstrap images for x86_64_v2 - AlmaLinux configs - -Remove use_bootstrap_image = False workaround from almalinux-10.tpl -and almalinux-kitten-10.tpl. With OCI platform-aware pulls now -passing --platform linux/amd64/v2, the correct image variant is -fetched and the arch check accepts it. - -The default use_bootstrap_image = True (config.py) now takes effect -for all architectures. ---- - mock-core-configs/etc/mock/templates/almalinux-10.tpl | 1 - - mock-core-configs/etc/mock/templates/almalinux-kitten-10.tpl | 1 - - .../release-notes-next/almalinux-x86_64_v2-bootstrap.config.md | 3 +++ - 3 files changed, 3 insertions(+), 2 deletions(-) - create mode 100644 releng/release-notes-next/almalinux-x86_64_v2-bootstrap.config.md - -diff --git a/mock-core-configs/etc/mock/templates/almalinux-10.tpl b/mock-core-configs/etc/mock/templates/almalinux-10.tpl -index ce95eff9a..9bc41661f 100644 ---- a/mock-core-configs/etc/mock/templates/almalinux-10.tpl -+++ b/mock-core-configs/etc/mock/templates/almalinux-10.tpl -@@ -9,7 +9,6 @@ config_opts['bootstrap_image'] = 'quay.io/almalinuxorg/almalinux:10' - # deal with special handling for x86_64_v2 variant - config_opts['mirrorlist_arch'] = "{% if repo_arch == 'x86_64_v2' %}?arch=x86_64_v2{% endif %}" - config_opts['baseurl_arch'] = "{% if repo_arch == 'x86_64_v2' %}x86_64_v2{% else %}$basearch{% endif %}" --config_opts['use_bootstrap_image'] = "{% if repo_arch == 'x86_64_v2' %}False{% else %}True{% endif %}" - - config_opts['dnf.conf'] = """ - [main] -diff --git a/mock-core-configs/etc/mock/templates/almalinux-kitten-10.tpl b/mock-core-configs/etc/mock/templates/almalinux-kitten-10.tpl -index 5873783b2..3b2c99d02 100644 ---- a/mock-core-configs/etc/mock/templates/almalinux-kitten-10.tpl -+++ b/mock-core-configs/etc/mock/templates/almalinux-kitten-10.tpl -@@ -9,7 +9,6 @@ config_opts['bootstrap_image'] = 'quay.io/almalinuxorg/almalinux:10-kitten' - # deal with special handling for x86_64_v2 variant - config_opts['mirrorlist_arch'] = "{% if repo_arch == 'x86_64_v2' %}?arch=x86_64_v2{% endif %}" - config_opts['baseurl_arch'] = "{% if repo_arch == 'x86_64_v2' %}x86_64_v2{% else %}$basearch{% endif %}" --config_opts['use_bootstrap_image'] = "{% if repo_arch == 'x86_64_v2' %}False{% else %}True{% endif %}" - - config_opts['dnf.conf'] = """ - [main] -diff --git a/releng/release-notes-next/almalinux-x86_64_v2-bootstrap.config.md b/releng/release-notes-next/almalinux-x86_64_v2-bootstrap.config.md -new file mode 100644 -index 000000000..c4d449f3f ---- /dev/null -+++ b/releng/release-notes-next/almalinux-x86_64_v2-bootstrap.config.md -@@ -0,0 +1,3 @@ -+Re-enable container-based bootstrap for AlmaLinux 10 and AlmaLinux Kitten 10 -+x86_64_v2 configs. The `use_bootstrap_image = False` workaround has been -+removed now that mock supports OCI platform-aware pulls. diff --git a/files/1001-yum-cache-add-cache-key-for-shared-package-cache.patch b/files/1001-yum-cache-add-cache-key-for-shared-package-cache.patch index d8201ce..9fbf116 100644 --- a/files/1001-yum-cache-add-cache-key-for-shared-package-cache.patch +++ b/files/1001-yum-cache-add-cache-key-for-shared-package-cache.patch @@ -20,15 +20,15 @@ The shared cache directory is not removed by --scrub=all (which only cleans per-root caches), matching the design intent that shared caches are host-level resources. --- - mock/py/mockbuild/plugins/yum_cache.py | 25 +++- - mock/tests/plugins/test_yum_cache.py | 181 +++++++++++++++++++++++++ + py/mockbuild/plugins/yum_cache.py | 25 +++- + tests/plugins/test_yum_cache.py | 181 +++++++++++++++++++++++++ 2 files changed, 200 insertions(+), 6 deletions(-) - create mode 100644 mock/tests/plugins/test_yum_cache.py + create mode 100644 tests/plugins/test_yum_cache.py -diff --git a/mock/py/mockbuild/plugins/yum_cache.py b/mock/py/mockbuild/plugins/yum_cache.py +diff --git a/py/mockbuild/plugins/yum_cache.py b/py/mockbuild/plugins/yum_cache.py index c732b439f..1e8aec494 100644 ---- a/mock/py/mockbuild/plugins/yum_cache.py -+++ b/mock/py/mockbuild/plugins/yum_cache.py +--- a/py/mockbuild/plugins/yum_cache.py ++++ b/py/mockbuild/plugins/yum_cache.py @@ -26,11 +26,12 @@ def init(plugins, conf, buildroot): @@ -78,11 +78,11 @@ index c732b439f..1e8aec494 100644 # ============= -diff --git a/mock/tests/plugins/test_yum_cache.py b/mock/tests/plugins/test_yum_cache.py +diff --git a/tests/plugins/test_yum_cache.py b/tests/plugins/test_yum_cache.py new file mode 100644 index 000000000..a6aba45d0 --- /dev/null -+++ b/mock/tests/plugins/test_yum_cache.py ++++ b/tests/plugins/test_yum_cache.py @@ -0,0 +1,181 @@ +"""Unit tests for the yum_cache plugin cache_key shared-cache feature.""" +