From 48c4c75d7377c4629f7a0b1bcb90a9c0cb971cf5 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Mon, 16 Nov 2020 11:32:49 -0500 Subject: [PATCH] MockModuleBuilder: Share root cache between threads The different build threads all are using the same basic build root contents, so there's no reason to use separate caches - point the root cache plugin for mock to a single location. (There's locking inside Mock for updating the root cache.) --- module_build_service/builder/MockModuleBuilder.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/module_build_service/builder/MockModuleBuilder.py b/module_build_service/builder/MockModuleBuilder.py index 0f610b67..ccfc5f29 100644 --- a/module_build_service/builder/MockModuleBuilder.py +++ b/module_build_service/builder/MockModuleBuilder.py @@ -6,6 +6,7 @@ import os import pipes import re import subprocess +from textwrap import dedent import threading import dnf @@ -483,6 +484,11 @@ class MockModuleBuilder(GenericBuilder): config = config.replace("$enabled_modules", str(self.enabled_modules)) config = config.replace("$releasever", str(self.releasever)) + config += dedent("""\ + config_opts.setdefault('plugin_conf', {}) + config_opts['plugin_conf'].setdefault('root_cache_opts', {}) + config_opts['plugin_conf']['root_cache_opts']['dir'] = "{{cache_topdir}}/%s/root_cache/" + """) % self.tag_name mock_cfg_path = os.path.join(self.configdir, "mock.cfg") if update_main or not os.path.exists(mock_cfg_path):