From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 9 Dec 2025 18:16:19 +0000 (+0100) Subject: [3.13] gh-138061: Exclude __pycache__ directory from the computed digest in the... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab8ac4b76018a8ba7564d9252ee229091b2d5402;p=thirdparty%2FPython%2Fcpython.git [3.13] gh-138061: Exclude __pycache__ directory from the computed digest in the JIT stencils (GH-138131) (#142481) Co-authored-by: alm --- diff --git a/Misc/NEWS.d/next/Build/2025-08-27-09-52-45.gh-issue-138061.fMVS9w.rst b/Misc/NEWS.d/next/Build/2025-08-27-09-52-45.gh-issue-138061.fMVS9w.rst new file mode 100644 index 000000000000..7af79d0b87ef --- /dev/null +++ b/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/Tools/jit/_targets.py b/Tools/jit/_targets.py index 34f4e20b95d1..fe953ddddcfc 100644 --- a/Tools/jit/_targets.py +++ b/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()