From f45779a0aa4f74356165fe69e9a71b4990f9ab58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 14 Apr 2026 14:08:05 +0200 Subject: [PATCH] When comparing the pre-built JIT stencils for identity, exclude the checksum When autoconf was updated from 2.72 to 2.73, we observed a change in the checksum: + diff -u /builddir/build/SOURCES/Python-3.15.0a7-x86_64-debug-jit_stencils.h build/debug/jit_stencils-x86_64-unknown-linux-gnu.h --- /builddir/build/SOURCES/Python-3.15.0a7-x86_64-debug-jit_stencils.h 2026-03-10 00:00:00.000000000 +0000 +++ build/debug/jit_stencils-x86_64-unknown-linux-gnu.h 2026-03-31 21:12:53.391262973 +0000 @@ -1,4 +1,4 @@ -// 5e1dc452d67c20147c4ea13e692c2d3e7b0b47b24f8847354c58988c7ffa02bc +// c783e3946f774d4d83e8fdcca35678ec77006e1b96b12661fcbd3ee680d10e94 // $ python3.14 /builddir/build/BUILD/python3.14-3.15.0_a7-build/Python-3.15.0a7/Tools/jit/build.py x86_64-redhat-linux-gnu --output-dir . --pyconfig-dir . --cflags= --llvm-version= --debug void error: Bad exit status from /var/tmp/rpm-tmp.G15BYi (%check) The autoconf-generated pyconfig.h file is part of the checksum input: https://github.com/python/cpython/blob/v3.15.0a8/Tools/jit/_targets.py#L75 Generally, the reason for this checksum is to prevent outdated JIT stencils when Python is re-configured with different options (or when the stencils generation code is updated). As suspected, the change in checksum was caused by a change in pyconfig.h: --- pyconfig.h +++ pyconfig.h @@ -1882,6 +1882,10 @@ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 #endif +/* Enable extensions on Cosmopolitan Libc. */ +#ifndef _COSMO_SOURCE +# define _COSMO_SOURCE 1 +#endif /* Enable general extensions on macOS. */ #ifndef _DARWIN_C_SOURCE # define _DARWIN_C_SOURCE 1 This is expected, see https://cgit.git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS?h=v2.73#n99 tl;dr when a new autoconf version changes the output of pyconfig.h, the checksum changes as well. We cannot update the pre-built stencils with the new checksum because that would make the build fail with older autoconf. Instead, we ignore the checksum in this check. We care for the contents, not checksums. Cherry-picked from python3.15 commit aab847c347b141083dbfbcf33fb38fb286dc2f62 --- python3.14.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python3.14.spec b/python3.14.spec index 98548a3..62c8a57 100644 --- a/python3.14.spec +++ b/python3.14.spec @@ -1498,7 +1498,8 @@ done %if %{with jit_build_stencils} for ConfName in %{?with_debug_build:debug} optimized; do if [ -s %{jit_stencils_source} ]; then - diff -u %{jit_stencils_source} build/${ConfName}/%{jit_stencils_filename} + # The -I option ignores the checksum line (calculated from files incl. pyconfig.h which may change with new autoconf) + diff -u -I '^// [0-9a-f]\{64\}$' %{jit_stencils_source} build/${ConfName}/%{jit_stencils_filename} else echo "%{jit_stencils_source} is empty, not checking if it is up to date" fi