https://github.com/python/cpython/commit/e96367da1fdc1e1cf17ca523e93a127b1961b443 commit: e96367da1fdc1e1cf17ca523e93a127b1961b443 branch: 3.13 author: Miss Islington (bot) <[email protected]> committer: savannahostrowski <[email protected]> date: 2025-12-09T18:50:32Z summary:
[3.13] gh-142454: Make the JIT digest more deterministic by sorting the files in Tools/jit (GH-142455) (#142484) gh-142454: Make the JIT digest more deterministic by sorting the files in Tools/jit (GH-142455) (cherry picked from commit bcf90de8ba2ea087540a5f632656ef880ee46b5c) Co-authored-by: Miro HronĨok <[email protected]> Co-authored-by: Ken Jin <[email protected]> files: A Misc/NEWS.d/next/Build/2025-12-09-13-33-46.gh-issue-142454.cqUxzQ.rst M Tools/jit/_targets.py diff --git a/Misc/NEWS.d/next/Build/2025-12-09-13-33-46.gh-issue-142454.cqUxzQ.rst b/Misc/NEWS.d/next/Build/2025-12-09-13-33-46.gh-issue-142454.cqUxzQ.rst new file mode 100644 index 00000000000000..4de16866f28851 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2025-12-09-13-33-46.gh-issue-142454.cqUxzQ.rst @@ -0,0 +1,4 @@ +When calculating the digest of the JIT stencils input, sort the hashed files +by filenames before adding their content to the hasher. This ensures +deterministic hash input and hence deterministic hash, independent on +filesystem order. diff --git a/Tools/jit/_targets.py b/Tools/jit/_targets.py index fe953ddddcfc08..c50bd63545c2fe 100644 --- a/Tools/jit/_targets.py +++ b/Tools/jit/_targets.py @@ -56,7 +56,7 @@ def _compute_digest(self, out: pathlib.Path) -> str: # Exclude cache files from digest computation to ensure reproducible builds. if dirpath.endswith("__pycache__"): continue - for filename in filenames: + for filename in sorted(filenames): hasher.update(pathlib.Path(dirpath, filename).read_bytes()) return hasher.hexdigest() _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
