mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-138061: Exclude __pycache__ directory from the computed digest in the JIT stencils (#138131)
Exclude the __pycache__ directory when generating the digest in the JIT stencils
This commit is contained in:
parent
f58a7c7175
commit
d3d94e0ed7
2 changed files with 4 additions and 0 deletions
|
|
@ -0,0 +1 @@
|
||||||
|
Ensure reproducible builds by making JIT stencil header generation deterministic.
|
||||||
|
|
@ -71,6 +71,9 @@ def _compute_digest(self) -> str:
|
||||||
hasher.update(PYTHON_EXECUTOR_CASES_C_H.read_bytes())
|
hasher.update(PYTHON_EXECUTOR_CASES_C_H.read_bytes())
|
||||||
hasher.update((self.pyconfig_dir / "pyconfig.h").read_bytes())
|
hasher.update((self.pyconfig_dir / "pyconfig.h").read_bytes())
|
||||||
for dirpath, _, filenames in sorted(os.walk(TOOLS_JIT)):
|
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:
|
for filename in filenames:
|
||||||
hasher.update(pathlib.Path(dirpath, filename).read_bytes())
|
hasher.update(pathlib.Path(dirpath, filename).read_bytes())
|
||||||
return hasher.hexdigest()
|
return hasher.hexdigest()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue