[Python-Dev] Deterministic builds of the interpreter

Freddy Rietdijk freddyrietdijk at fridh.nl
Thu Feb 9 04:27:29 EST 2017


I'm attempting to make the builds of the Python interpreters for Nixpkgs
[1] deterministic.

In the case of Python 2.7 we have a patch [2] that fixes the timestamp used
in .pyc files in case the env var `DETERMINISTIC_BUILD` is set. We also
remove `wininst*.exe`. This works fine, although there are 4 small issues
left [3]. Do you have any idea what is going on in these files that could
make them indeterministic?

For Python 3.x I disabled ensurepip, removed `wininst*.exe`, and modified
`py_compile` to use `0` instead of `source_stats['mtime']`. The builds are
not yet deterministic [4]. Any suggestions what could be fixed here?

Kind regards,


[1] https://github.com/NixOS/nixpkgs
[3] https://github.com/NixOS/nixpkgs/issues/22570#issuecomment-278474082
[4] https://gist.github.com/anonymous/7cc147af6511dee2dc5a5b8d110f0e6b
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20170209/c02656e9/attachment.html>

More information about the Python-Dev mailing list