Update to Python 3.12.12

This commit is contained in:
Karolina Surma 2025-10-10 13:21:13 +02:00
commit 9dc158f0bf
5 changed files with 46 additions and 115 deletions

View file

@ -1,51 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Charalampos Stratakis <cstratak@redhat.com>
Date: Wed, 8 Jan 2025 04:58:22 +0100
Subject: 00459: Apply Intel Control-flow Technology for x86-64
Required for mitigation against return-oriented programming (ROP) and Call or Jump Oriented Programming (COP/JOP) attacks
Proposed upstream: https://github.com/python/cpython/pull/128606
See also: https://sourceware.org/annobin/annobin.html/Test-cf-protection.html
---
Python/asm_trampoline.S | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/Python/asm_trampoline.S b/Python/asm_trampoline.S
index 460707717d..341d0bbe51 100644
--- a/Python/asm_trampoline.S
+++ b/Python/asm_trampoline.S
@@ -9,6 +9,9 @@
# }
_Py_trampoline_func_start:
#ifdef __x86_64__
+#if defined(__CET__) && (__CET__ & 1)
+ endbr64
+#endif
sub $8, %rsp
call *%rcx
add $8, %rsp
@@ -26,3 +29,22 @@ _Py_trampoline_func_start:
.globl _Py_trampoline_func_end
_Py_trampoline_func_end:
.section .note.GNU-stack,"",@progbits
+# Note for indicating the assembly code supports CET
+#if defined(__x86_64__) && defined(__CET__) && (__CET__ & 1)
+ .section .note.gnu.property,"a"
+ .align 8
+ .long 1f - 0f
+ .long 4f - 1f
+ .long 5
+0:
+ .string "GNU"
+1:
+ .align 8
+ .long 0xc0000002
+ .long 3f - 2f
+2:
+ .long 0x3
+3:
+ .align 8
+4:
+#endif // __x86_64__

View file

@ -13,47 +13,33 @@ gh-127906: Add missing sys import to test_cppext
Co-Authored-By: Victor Stinner <vstinner@python.org>
---
Lib/test/support/__init__.py | 11 +++++------
Lib/test/test_cext/__init__.py | 2 +-
Lib/test/test_cppext/__init__.py | 2 +-
Lib/test/test_cppext/setup.py | 1 +
Lib/test/test_peg_generator/test_c_parser.py | 2 +-
5 files changed, 9 insertions(+), 9 deletions(-)
Lib/test/support/__init__.py | 5 ++---
Lib/test/test_cext/__init__.py | 2 +-
Lib/test/test_cppext/__init__.py | 2 +-
Lib/test/test_cppext/setup.py | 1 +
Lib/test/test_peg_generator/test_c_parser.py | 2 +-
5 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index c899347624..223787244f 100644
index 4c22f131e3..e49e3668a3 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -2260,7 +2260,7 @@ def _findwheel(pkgname):
filenames = os.listdir(wheel_dir)
filenames = sorted(filenames, reverse=True) # approximate "newest" first
for filename in filenames:
- # filename is like 'setuptools-67.6.1-py3-none-any.whl'
+ # filename is like 'setuptools-{version}-py3-none-any.whl'
if not filename.endswith(".whl"):
continue
prefix = pkgname + '-'
@@ -2269,10 +2269,10 @@ def _findwheel(pkgname):
raise FileNotFoundError(f"No wheel for {pkgname} found in {wheel_dir}")
-# Context manager that creates a virtual environment, install setuptools and wheel in it
-# and returns the path to the venv directory and the path to the python executable
+# Context manager that creates a virtual environment, install setuptools in it,
+# and returns the paths to the venv directory and the python executable
@@ -2308,7 +2308,7 @@ def _findwheel(pkgname):
# Context manager that creates a virtual environment, install setuptools in it,
# and returns the paths to the venv directory and the python executable
@contextlib.contextmanager
-def setup_venv_with_pip_setuptools_wheel(venv_dir):
+def setup_venv_with_pip_setuptools(venv_dir):
import subprocess
from .os_helper import temp_cwd
@@ -2295,8 +2295,7 @@ def setup_venv_with_pip_setuptools_wheel(venv_dir):
@@ -2331,8 +2331,7 @@ def setup_venv_with_pip_setuptools_wheel(venv_dir):
cmd = [python, '-X', 'dev',
cmd = (python, '-X', 'dev',
'-m', 'pip', 'install',
- _findwheel('setuptools'),
- _findwheel('wheel')]
+ _findwheel('setuptools')]
- _findwheel('wheel'))
+ _findwheel('setuptools'))
if verbose:
print()
print('Run:', ' '.join(cmd))

View file

@ -9,10 +9,10 @@ Subject: 00461: Downstream only: Install wheel in test venvs when setuptools <
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index 223787244f..94f55ccaf0 100644
index e49e3668a3..4c42234ccc 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -2293,9 +2293,18 @@ def setup_venv_with_pip_setuptools(venv_dir):
@@ -2329,9 +2329,18 @@ def setup_venv_with_pip_setuptools(venv_dir):
else:
python = os.path.join(venv, 'bin', python_exe)
@ -24,11 +24,11 @@ index 223787244f..94f55ccaf0 100644
+ else:
+ wheels = (setuptools_whl, _findwheel('wheel'))
+
cmd = [python, '-X', 'dev',
cmd = (python, '-X', 'dev',
'-m', 'pip', 'install',
- _findwheel('setuptools')]
- _findwheel('setuptools'))
+ *wheels,
+ ]
+ )
if verbose:
print()
print('Run:', ' '.join(cmd))

View file

@ -13,11 +13,11 @@ URL: https://www.python.org/
# WARNING When rebasing to a new Python version,
# remember to update the python3-docs package as well
%global general_version %{pybasever}.11
%global general_version %{pybasever}.12
#global prerel ...
%global upstream_version %{general_version}%{?prerel}
Version: %{general_version}%{?prerel:~%{prerel}}
Release: 3%{?dist}
Release: 1%{?dist}
License: Python-2.0.1
@ -72,7 +72,7 @@ License: Python-2.0.1
# from Python with the versions below.
# This needs to be manually updated when we update Python.
%global pip_version 25.0.1
%global setuptools_version 67.6.1
%global setuptools_version 79.0.1
%global wheel_version 0.40.0
# All of those also include a list of indirect bundled libs:
# pip
@ -98,22 +98,25 @@ Provides: bundled(python3dist(typing-extensions)) = 4.12.2
Provides: bundled(python3dist(urllib3)) = 1.26.20
}
# setuptools
# vendor.txt files not in .whl
# $ %%{_rpmconfigdir}/pythonbundles.py \
# <(curl -L https://github.com/pypa/setuptools/raw/v%%{setuptools_version}/setuptools/_vendor/vendored.txt) \
# <(curl -L https://github.com/pypa/setuptools/raw/v%%{setuptools_version}/pkg_resources/_vendor/vendored.txt)
# vendor.txt not in .whl
# %%{_rpmconfigdir}/pythonbundles.py <(unzip -l Lib/test/wheeldata/setuptools-*.whl | grep -E '_vendor/.+dist-info/RECORD' | sed -E 's@^.*/([^-]+)-([^-]+)\.dist-info/.*$@\1==\2@')
%global setuptools_bundled_provides %{expand:
Provides: bundled(python3dist(importlib-metadata)) = 6
Provides: bundled(python3dist(importlib-resources)) = 5.10.2
Provides: bundled(python3dist(jaraco-text)) = 3.7
Provides: bundled(python3dist(more-itertools)) = 8.8
Provides: bundled(python3dist(ordered-set)) = 3.1.1
Provides: bundled(python3dist(packaging)) = 23
Provides: bundled(python3dist(platformdirs)) = 2.6.2
Provides: bundled(python3dist(autocommand)) = 2.2.2
Provides: bundled(python3dist(backports-tarfile)) = 1.2
Provides: bundled(python3dist(importlib-metadata)) = 8
Provides: bundled(python3dist(inflect)) = 7.3.1
Provides: bundled(python3dist(jaraco-collections)) = 5.1
Provides: bundled(python3dist(jaraco-context)) = 5.3
Provides: bundled(python3dist(jaraco-functools)) = 4.0.1
Provides: bundled(python3dist(jaraco-text)) = 3.12.1
Provides: bundled(python3dist(more-itertools)) = 10.3
Provides: bundled(python3dist(packaging)) = 24.2
Provides: bundled(python3dist(platformdirs)) = 4.2.2
Provides: bundled(python3dist(tomli)) = 2.0.1
Provides: bundled(python3dist(typing-extensions)) = 4.0.1
Provides: bundled(python3dist(typing-extensions)) = 4.4
Provides: bundled(python3dist(zipp)) = 3.7
Provides: bundled(python3dist(typeguard)) = 4.3
Provides: bundled(python3dist(typing-extensions)) = 4.12.2
Provides: bundled(python3dist(wheel)) = 0.45.1
Provides: bundled(python3dist(zipp)) = 3.19.2
}
# wheel
# $ %%{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/test/wheeldata/wheel-*.whl wheel/vendored/vendor.txt)
@ -370,17 +373,7 @@ Patch251: 00251-change-user-install-location.patch
# https://github.com/GrahamDumpleton/mod_wsgi/issues/730
Patch371: 00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch
# 00459 # 906f6692bd85034012c9554f2434627ccfc04c67
# Apply Intel Control-flow Technology for x86-64
#
# Required for mitigation against return-oriented programming (ROP) and Call or Jump Oriented Programming (COP/JOP) attacks
#
# Proposed upstream: https://github.com/python/cpython/pull/128606
#
# See also: https://sourceware.org/annobin/annobin.html/Test-cf-protection.html
Patch459: 00459-apply-intel-control-flow-technology-for-x86-64.patch
# 00460 # f399a428258bbb149de1a9b8a62583bf77742eb0
# 00460 # 1da89114f7ee7e7f392128a9861d9c2b41c0ddeb
# gh-132415: Update vendored setuptools in ``Lib/test/wheeldata``
#
# (actual changes in .whl files removed to make this patch smaller)
@ -388,7 +381,7 @@ Patch459: 00459-apply-intel-control-flow-technology-for-x86-64.patch
# gh-127906: Add missing sys import to test_cppext
Patch460: 00460-gh-132415-update-vendored-setuptools-in-lib-test-wheeldata.patch
# 00461 # 47f50dd1f049470c33edb114754529777ab2332f
# 00461 # f7bc103c7bcc6e48789b225e06daf835793e1086
# Downstream only: Install wheel in test venvs when setuptools < 71
Patch461: 00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch
@ -1740,6 +1733,9 @@ CheckPython optimized
# ======================================================
%changelog
* Fri Oct 10 2025 Karolina Surma <ksurma@redhat.com> - 3.12.12-1
- Update to 3.12.12
* Fri Jul 25 2025 Fedora Release Engineering <releng@fedoraproject.org> - 3.12.11-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild

View file

@ -1,2 +1,2 @@
SHA512 (Python-3.12.11.tar.xz) = 81f259c5bb293a5b685ebead1dff56c7c9d28eed12edb508b3e5e1a882991e762fc959803cf2734f4233bb1c5407b4f5303324c67b25d860b069d38bbebe4454
SHA512 (Python-3.12.11.tar.xz.asc) = 3589deba17c5adcfcd614387a5207ad20db56cd9c7937eb44e21035a8745f1c6bb9a1b7cfe8bc5b58ecc7cca09ed49fd4c2878f65baecb2514e79c666f85a22e
SHA512 (Python-3.12.12.tar.xz) = 4b99d240dd96a6e154909dcffe87f8bb38193d634cd80a1c3d9e819b7a63af2afa46d5e6423e81f00dd388840dc29a4a71580f6aa1ce9a12e559c1d63f65a205
SHA512 (Python-3.12.12.tar.xz.asc) = 32c10fd427c6f9f11595493d1b4d4c3cade85bffd439fe11e8b0b2c619e06734097b6aaedfdb4fe035b7fdd7196714dba77cdc806923e4454d5bcf60056991a0