matthew-brett / delocate

Find and copy needed dynamic libraries into python wheels
BSD 2-Clause "Simplified" License
262 stars 59 forks source link

`delocate-fuse` merge strategies if file contents differ #180

Open rgommers opened 1 year ago

rgommers commented 1 year ago

In https://github.com/pypackaging-native/pypackaging-native/pull/27#discussion_r1142744075, @freakboy3742 pointed out a potential problem with delocate-fuse: when two files (.py, .h, or any other file type other than the binaries that actually need fusing) differ, it is unclear what to do.

At the moment, delocate-fuse doesn't check and just keeps one of the two files. For reproducible builds this is fine, but if you have for example a generated header file which depends on the architecture (e.g., contains size of long double, a real bug we had in numpy), there is a problem. There are a few possible merge strategies possible:

The safest bet would be to error out, and allow users to specify a list of files that are known to differ between x86-64 and arm64, with the specification of which to pick. This is likely to catch some bugs, and improve the reproducibility of wheel builds.