auditwheel icon indicating copy to clipboard operation
auditwheel copied to clipboard

Make order of files in repaired wheel deterministic

Open bemoody opened this issue 1 year ago • 2 comments

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.

bemoody avatar Aug 06 '24 01:08 bemoody

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.

codecov[bot] avatar Aug 11 '24 09:08 codecov[bot]

Sure, that makes sense and is easy to do.

bemoody avatar Sep 16 '24 21:09 bemoody

fixed by #517

mayeut avatar Jan 03 '25 22:01 mayeut