Skip to content

Commit 96d28fe

Browse files
Fix determinism workflow: compare hashes only, not file paths
The diff was failing because sha256sum output includes file paths (out1/ vs out2/) which always differ. Extract just the hash values for comparison. Also make cross-platform diff a hard failure. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6e27d2e commit 96d28fe

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

.github/workflows/determinism.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ jobs:
4040
- name: Hash outputs
4141
shell: bash
4242
run: |
43-
sha256sum out1/Test.m2d out1/Test.m2h > hashes-run1.txt
44-
sha256sum out2/Test.m2d out2/Test.m2h > hashes-run2.txt
43+
sha256sum out1/Test.m2d out1/Test.m2h | tee hashes-run1-full.txt | awk '{print $1}' > hashes-run1.txt
44+
sha256sum out2/Test.m2d out2/Test.m2h | tee hashes-run2-full.txt | awk '{print $1}' > hashes-run2.txt
4545
echo "=== Run 1 ==="
46-
cat hashes-run1.txt
46+
cat hashes-run1-full.txt
4747
echo "=== Run 2 ==="
48-
cat hashes-run2.txt
48+
cat hashes-run2-full.txt
4949
5050
- name: Verify same-platform determinism
5151
shell: bash
@@ -93,8 +93,8 @@ jobs:
9393
cat linux/hashes-run1.txt
9494
echo "=== Diff ==="
9595
if diff win/hashes-run1.txt linux/hashes-run1.txt; then
96-
echo "PASS: Cross-platform archives are identical"
96+
echo "PASS: Cross-platform archives are byte-identical!"
9797
else
98-
echo "INFO: Cross-platform archives differ (expected due to native zlib differences)"
99-
echo "This is not a failure — see workflow summary for details."
98+
echo "FAIL: Cross-platform archives differ"
99+
exit 1
100100
fi

0 commit comments

Comments
 (0)