From 45ae9e0091e6d5ec72ecc18568d191a8df220702929ddfe2bbb177b57a2d3ab3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Fri, 12 Sep 2025 07:39:47 +0000 Subject: [PATCH] Accepting request 1303343 from home:dgarcia:branches:devel:languages:python:Factory - Add gh138131-exclude-pycache-from-digest.patch fixing reproducible build for python-nogil. (bsc#1244680, gh#python/cpython#138131) OBS-URL: https://build.opensuse.org/request/show/1303343 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python313?expand=0&rev=121 --- gh138131-exclude-pycache-from-digest.patch | 30 ++++++++++++++++++++++ python313.changes | 7 +++++ python313.spec | 2 ++ 3 files changed, 39 insertions(+) create mode 100644 gh138131-exclude-pycache-from-digest.patch diff --git a/gh138131-exclude-pycache-from-digest.patch b/gh138131-exclude-pycache-from-digest.patch new file mode 100644 index 0000000..996d217 --- /dev/null +++ b/gh138131-exclude-pycache-from-digest.patch @@ -0,0 +1,30 @@ +From 4bb41b28d5bac09bccd636d8c5fefe1a462f63a7 Mon Sep 17 00:00:00 2001 +From: Alm +Date: Mon, 25 Aug 2025 08:56:38 +0300 +Subject: [PATCH 1/4] Exclude .pyc files from the computed digest in the jit + stencils + +--- + Tools/jit/_targets.py | 3 +++ + 1 file changed, 3 insertions(+) + +Index: Python-3.13.7/Tools/jit/_targets.py +=================================================================== +--- Python-3.13.7.orig/Tools/jit/_targets.py ++++ Python-3.13.7/Tools/jit/_targets.py +@@ -53,6 +53,9 @@ class _Target(typing.Generic[_S, _R]): + hasher.update(PYTHON_EXECUTOR_CASES_C_H.read_bytes()) + hasher.update((out / "pyconfig.h").read_bytes()) + for dirpath, _, filenames in sorted(os.walk(TOOLS_JIT)): ++ # Exclude cache files from digest computation to ensure reproducible builds. ++ if dirpath.endswith("__pycache__"): ++ continue + for filename in filenames: + hasher.update(pathlib.Path(dirpath, filename).read_bytes()) + return hasher.hexdigest() +Index: Python-3.13.7/Misc/NEWS.d/next/Build/2025-08-27-09-52-45.gh-issue-138061.fMVS9w.rst +=================================================================== +--- /dev/null ++++ Python-3.13.7/Misc/NEWS.d/next/Build/2025-08-27-09-52-45.gh-issue-138061.fMVS9w.rst +@@ -0,0 +1 @@ ++Ensure reproducible builds by making JIT stencil header generation deterministic. diff --git a/python313.changes b/python313.changes index 38632be..5cb8169 100644 --- a/python313.changes +++ b/python313.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Sep 9 10:11:58 UTC 2025 - Daniel Garcia + +- Add gh138131-exclude-pycache-from-digest.patch fixing reproducible + build for python-nogil. + (bsc#1244680, gh#python/cpython#138131) + ------------------------------------------------------------------- Fri Aug 15 12:31:08 UTC 2025 - Matej Cepl diff --git a/python313.spec b/python313.spec index 2ae2949..e1e38b1 100644 --- a/python313.spec +++ b/python313.spec @@ -231,6 +231,8 @@ Patch42: gh126985-mv-pyvenv.cfg2getpath.patch # PATCH-FIX-UPSTREAM bsc1243155-sphinx-non-determinism.patch bsc#1243155 mcepl@suse.com # Doc: Generate ids for audit_events using docname Patch43: bsc1243155-sphinx-non-determinism.patch +# PATCH-FIX-UPSTREAM gh138131-exclude-pycache-from-digest.patch bsc#1244680 daniel.garcia@suse.com +Patch44: gh138131-exclude-pycache-from-digest.patch BuildRequires: autoconf-archive BuildRequires: automake BuildRequires: fdupes