Search code examples
pythonwindowspython-wheel

What is the current state of wheel build reproducibility in Windows?


I know there has been effort around making the wheel files reproducible when building the same python package twice, per release notes for 0.27.0 of wheel: https://wheel.readthedocs.io/en/stable/news.html

By "reproducible" I mean: "wheel files hash to the same hash each time built".

Reproducibility when compiling on the same machine with the same code / resources would be a good start --- across different machines with same code / resources would be even better.

I've been trying to determine if there is similar progress on reproducible builds on Windows, and if not, what "hacks" can I do to make that happen? (for example, overriding an environment variable)

The hack of last resort is spinning up a docker container just to compile my wheel file. If I have to, I will.


Solution

  • I figured it out. On Windows 10, I included a line like this in my setup.py:

    os.environ["SOURCE_DATE_EPOCH"] = "315532800"