Commit 93b6b3f
Fix non-deterministic archive output across runs and platforms
Three sources of non-determinism:
1. Directory.GetFiles returns files in filesystem-dependent order.
Sort by normalized relative paths (forward slashes, ordinal
comparison) so file IDs are assigned identically on any OS.
2. ConcurrentDictionary iteration order is non-deterministic.
Sort files by ID in SaveAsync and SaveConcurrentAsync (MS2Lib
submodule change).
3. Text files with CRLF line endings produce different archive
bytes on Windows vs Linux. Strip all CR bytes from non-binary
files before archiving.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 81e1150 commit 93b6b3f
2 files changed
Lines changed: 24 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | | - | |
97 | | - | |
| 96 | + | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
102 | 119 | | |
103 | 120 | | |
104 | 121 | | |
| |||
108 | 125 | | |
109 | 126 | | |
110 | 127 | | |
111 | | - | |
| 128 | + | |
112 | 129 | | |
113 | 130 | | |
| 131 | + | |
| 132 | + | |
114 | 133 | | |
115 | 134 | | |
116 | 135 | | |
| |||
0 commit comments