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.