Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion Tools/jit/_targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def _compute_digest(self) -> 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()

Expand Down
Loading