mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
[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>
This commit is contained in:
parent
dafac8a47a
commit
8cb65ca1dd
2 changed files with 4 additions and 0 deletions
|
|
@ -0,0 +1 @@
|
|||
Ensure reproducible builds by making JIT stencil header generation deterministic.
|
||||
|
|
@ -69,6 +69,9 @@ def _compute_digest(self) -> str:
|
|||
hasher.update(PYTHON_EXECUTOR_CASES_C_H.read_bytes())
|
||||
hasher.update((self.pyconfig_dir / "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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue