See f45779a0aa for context.
After autoconf 2.73 landed in Fedora ELN,
the pre-built JIT stencils were rejected because of checksum mismatch.
This new patch adds an ability to circumvent that check.
It has been offered upstream in
https://github.com/python/cpython/issues/148646https://github.com/python/cpython/pull/148647
While this has yet to be finalized upstream and might take a while, we need to fix the ELN build right away.
(When we build the stencils on rawhide for the next release,
the problem will shift from ELN with new autoconf to old Fedoras with old autoconf.)
Cherry-picked from python3.15 commit 4a1f3dae4f24af60227469c76acf9452f02c90dd
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
When the SRPM is built in Koji on non-JIT architecture (such as ppc64le
or s390x), the jit_build_stencils bcond is set to false.
When we don't have the JIT stencils sources yet and we do a scratch
build to generate them,
we want the SRPM creation to succeed, regardless of architecture.
This way, the sources are only defined when they are required or when
they exist.
An alternative would be to set jit_build_stencils to true/false
in an arch-independent way, and later always check for:
%{with jit} && %{with jit_build_stencils}
But I think that might be confusing.
In the past we have had a versioned requirement on expat, e.g.:
https://src.fedoraproject.org/rpms/python3.13/c/c686992b6c25a39d0e4117053ddb669fd5998723
The explanation is still valid: if Python is built with an expat version
with new symbols, and used with an installed older expat, it won't work,
preventing crating new venvs, and many more.
This has happened again now with expat 2.7.2 introducing new symbols.
Reintroduce the versioned requirement and make it future-proof - the
generated version will always match at least the one present in the buildroot
during the Python build.
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)
Python includes a lot of differently licensed functions and
modules.
We gather the list from https://docs.python.org/3.14/license.html.
Detect changes to Doc/license.rst with file hash automatically in %prep.
We always switch rpmswheels, optimizations and tests when bootstrapping
new Python version, so they can be tied to the bootstrap conditional.
With that, switching the bootstrap in Koji side tag will be possible,
letting us to avoid separate "bootstrap" and "rebuild" commits.
We need to have it above the Release field, in order for the build NVR
to contain the ~bootstrap suffix and sort correctly (lower than the main
build).
This enables bootstrapping the package directly in Koji side tag.