From a940c3aa2e2def3bb405678a0f9984ead62d1db8 Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Mar 18 2026 14:56:22 +0000 Subject: Don't assume target_arch is a valid host_cpu In the case of x86_64_v2 it is not, and config.sub rejects it. Signed-off-by: Yann Dirson --- diff --git a/koji/__init__.py b/koji/__init__.py index cc06126..1cdf0a0 100644 --- a/koji/__init__.py +++ b/koji/__init__.py @@ -126,6 +126,10 @@ RPM_FILEDIGESTALGO_IDS = { 11: 'SHA224' } +HOSTCPU_FROM_ARCH = { + 'x86_64_v2': 'x86_64', +} + # rpm 4.12 introduces optional deps, but they can also be backported in some # rpm installations. So, we need to check their real support, not only rpm # version. @@ -2004,9 +2008,10 @@ name=build macros.update(opts.get('tag_macros', {})) # The following macro values cannot be overridden by tag options + host_cpu = HOSTCPU_FROM_ARCH.get(opts.get('target_arch', arch), opts.get('target_arch', arch)) macros['%_topdir'] = '%s/build' % config_opts['chroothome'] - macros['%_host_cpu'] = opts.get('target_arch', arch) - macros['%_host'] = '%s-%s' % (opts.get('target_arch', arch), + macros['%_host_cpu'] = host_cpu + macros['%_host'] = '%s-%s' % (host_cpu, opts.get('mockhost', 'koji-linux-gnu')) parts = ["""# Auto-generated by the Koji build system