serge-sans-paille/pythran

Pythran extension contains timestamp preventing reproducibility

andyfaff opened this issue · 4 comments

scipy/scipy#18987 reports an issue where a pythran generated extension contains a timestamp in the binary. This prevents bitwise reproducibility of the extension from build to build, which creates issues for some Linux distros.
There is nothing I can see in the python source that would generate such a timestamp. Do you know if pythran is generating those timestamps? Or do we need to look elsewhere?

https://github.com/serge-sans-paille/pythran/blob/master/pythran/toolchain.py#L187 is the culprit. What approach would you recommend here? just getting rid of that value? a compiler flag to enable /disable that info?

I'm not sure. If the date-time is there for a specific reason then you might want to keep it there.

Does pythran use the TIME, DATE or DATETIME macros to implement this functionality? I believe there are ways of turning those macros off with compiler options, or to patch the executable to remove such instances.

All I know on this particular case is gleaned from https://blog.conan.io/2019/09/02/Deterministic-builds-with-C-C++.html. It'll require someone with more C/C++ experience than me (possibly @bmwiedemann) and a knowledge of Python build systems (@rgommers would be the person for scipy). I don't know enough about build systems, or how Pythran processes options to help further.

+1 for getting rid of it completely, or otherwise (in case you need it for something) at least requiring an opt-in to insert that timestamp. I can't think of a reason to do this, and it will always break reproducibility.

ok, I'll just remove it. I can't remind of a good reason for adding this ^^!