From 4fb790f82c73d02f24899804b230f9fc0560a347 Mon Sep 17 00:00:00 2001 From: Andrew Lukoshko Date: Wed, 8 Apr 2026 13:24:51 +0200 Subject: [PATCH] Add shared yum cache support for mock builds When a platform sets use_shared_yum_cache in mock config, pass a shared_cache_key (platform name + target arch) to MockConfig so builds of the same platform/arch share the yum package cache. --- build_node/builders/base_rpm_builder.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build_node/builders/base_rpm_builder.py b/build_node/builders/base_rpm_builder.py index 3fd56a9..4507b23 100644 --- a/build_node/builders/base_rpm_builder.py +++ b/build_node/builders/base_rpm_builder.py @@ -689,10 +689,17 @@ def generate_mock_config(config, task, srpm_build=False): mock_config_kwargs['macros'].update(value) elif key == 'rpmautospec_enable': continue + elif key == 'use_shared_yum_cache': + continue elif key == 'use_host_resolv': use_host_resolv = value else: mock_config_kwargs[key] = value + shared_cache_key = None + if task.platform.data['mock'].get('use_shared_yum_cache'): + shared_cache_key = '{0}-{1}'.format( + task.platform.name.lower(), target_arch, + ) mock_config = MockConfig( dist=task.platform.data.get('mock_dist'), rpmbuild_networking=True, @@ -700,6 +707,7 @@ def generate_mock_config(config, task, srpm_build=False): yum_config=yum_config, target_arch=target_arch, basedir=config.mock_basedir, + shared_cache_key=shared_cache_key, **mock_config_kwargs, ) if task.is_secure_boot: