From 78e3110af1b0ec6fc66908f0de4a7ddbf045ec82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 3 Dec 2025 11:51:32 +0100 Subject: [PATCH] Make it easier to bootstrap new JIT stencils Only define the JIT stencils sources when we must (i.e. when building --wihtout jit_build_stencils) or when the files already exist. This allows to run rawhide CI scratch builds without the stencils, but it also ensures the final SRPM contains them even when built --with jit_build_stencils. (cherry picked from python3.15 commit b2312d171d6a3280744a549f2c4daee492b66f44) --- python3.14.spec | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/python3.14.spec b/python3.14.spec index 6e9f073..e1f1485 100644 --- a/python3.14.spec +++ b/python3.14.spec @@ -355,16 +355,19 @@ Source11: idle3.appdata.xml # Only used on platforms without the required LLVM version. # # When updating Python: -# 1. touch the .h files (create them empty) -# 2. scratch build Python on platform with required LLVM version (usually rawhide) -# 3. download the files from Koji: +# 1. scratch build Python on platform with required LLVM version (usually rawhide) +# 2. download the files from Koji: # $ bash download-jit-stencils-from-koji.sh KOJI_TASK_URL|KOJI_TASK_ID -# 4. add the files to lookaside cache with fedpkg new-sources +# 3. add the files to lookaside cache with fedpkg new-sources Source30: download-jit-stencils-from-koji.sh +# This %%if-hack makes it easier to do step 1. from the above. +# Use `fedpkg sources --force` to get the conditionally defined sources from the lookaside cache. +%if %{without jit_build_stencils} || %{exists:%{_sourcedir}/Python-%{upstream_version}-x86_64-optimized-jit_stencils.h} Source31: Python-%{upstream_version}-aarch64-debug-jit_stencils.h Source32: Python-%{upstream_version}-aarch64-optimized-jit_stencils.h Source33: Python-%{upstream_version}-x86_64-debug-jit_stencils.h Source34: Python-%{upstream_version}-x86_64-optimized-jit_stencils.h +%endif %global jit_stencils_source %{_sourcedir}/Python-%{upstream_version}-%{_arch}-${ConfName}-jit_stencils.h %global jit_stencils_filename jit_stencils-%{_arch}-redhat-linux-gnu.h