reproducible .pyc files (& python-for-android)

Chris Lamb chris at reproducible-builds.org
Mon Jan 4 10:23:11 UTC 2021


Hi Felix,

> p4a compiles those with "hostpython -OO -m compileall -b -f" (where
> hostpython is the cross-compiled Python for the target -- arm64-v8a or
> armeabi-v7a -- which is thus definitely the same version on both
> machines).

As I understand it, recent versions Python can use SOURCE_DATE_EPOCH
in its internal py_compile routine to ensure that .pyc files are
reproducible.

You may find more info here:

  https://bugs.python.org/issue29708

In the first instance, could you try exporting SOURCE_DATE_EPOCH
and/or confirming which Python versions you are working with?

I suspect that Bernhard (who worked on the above issue and associated
PR for cpython (#296) may be able to shed more light on this. I
personally do have any much insight on .pyc reproducibility beyond
this as Debian, my 'home' distribution, does not ship these files in
its binary artifacts. PEP 552 may also be useful but, again, this is
not quite my area.


Best wishes,

--
      o
    ⬋   ⬊      Chris Lamb
   o     o     reproducible-builds.org 💠
    ⬊   ⬋
      o


More information about the rb-general mailing list