Skip to content

Commit 8cb65ca

Browse files
[3.14] gh-138061: Exclude __pycache__ directory from the computed digest in the JIT stencils (GH-138131) (#142482)
Co-authored-by: alm <alonme@users.noreply.github.com>
1 parent dafac8a commit 8cb65ca

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Ensure reproducible builds by making JIT stencil header generation deterministic.

Tools/jit/_targets.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ def _compute_digest(self) -> str:
6969
hasher.update(PYTHON_EXECUTOR_CASES_C_H.read_bytes())
7070
hasher.update((self.pyconfig_dir / "pyconfig.h").read_bytes())
7171
for dirpath, _, filenames in sorted(os.walk(TOOLS_JIT)):
72+
# Exclude cache files from digest computation to ensure reproducible builds.
73+
if dirpath.endswith("__pycache__"):
74+
continue
7275
for filename in filenames:
7376
hasher.update(pathlib.Path(dirpath, filename).read_bytes())
7477
return hasher.hexdigest()

0 commit comments

Comments
 (0)