Reproducible build of xapian-bindings for python - patch included

Olly Betts olly at survex.com
Mon Dec 3 01:38:08 GMT 2018


On Mon, Nov 26, 2018 at 12:36:32PM +0100, Danny Milosavljevic wrote:
> The reason is that in python3/Makefile.am there's a "cp" statement
> without "-p" - which means it will not preserve timestamps but rather
> generate a new timestamp every time - making every build output
> different.
> 
> (We do have a general snippet to reset timestamps, but it comes too
> late - by that time, the pyc file already contains the ever-changing
> source timestamp and thus is also ever-changing)
> 
> So we patch xapian-bindings to include the "-p" option on our side.
> 
> Would you be willing to apply the patch below?

The patch looks OK (though this should be addressed in git master
first).

However it seems it only solves the problem of .pyc files embedding
timestamps because we currently ship the SWIG-generated .py files (which
we mostly do because there was a period when it was hard to find a SWIG
release which worked for all the languages we use it for - SWIG now has
extensive testsuites which are monitored by CI for most of its target
languages so that's probably no longer a valid concern).

A package which runs SWIG at build time would presumably also have
arbitrary timestamps on the SWIG-generated .py files.

Maybe https://www.python.org/dev/peps/pep-0552/ is better general
solution?

Cheers,
    Olly



More information about the Xapian-devel mailing list