Make order of files in repaired wheel deterministic
Currently, when running auditwheel repair, the contents of the output whl file are unpredictable:
- The order of entries in the zip archive is unpredictable.
- The order of lines in the "RECORD" file is unpredictable.
In both cases, the order is dependent on the order of entries returned by
os.walk.
This is a problem for build reproducibility - provided that the build process is sufficiently well defined, different people should be able to run the same process on different machines and get identical outputs.
Note that when setuptools or wheel generates a whl file, it does something similar (see WheelFile.write_files in wheel.wheelfile.) The code here won't do quite the same as what setuptools does, but that shouldn't be a problem.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 92.28%. Comparing base (
14c4282) to head (a393a17). Report is 2 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #507 +/- ##
==========================================
+ Coverage 92.25% 92.28% +0.02%
==========================================
Files 20 20
Lines 1266 1270 +4
Branches 305 305
==========================================
+ Hits 1168 1172 +4
Misses 56 56
Partials 42 42
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Sure, that makes sense and is easy to do.
fixed by #517