Source: pikepdf
Version: 1.10.0+dfsg-1
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: randomness filesystem
X-Debbugs-Cc: [email protected]

Hi,

Whilst working on the Reproducible Builds effort [0] we noticed that
pikepdf could not be built reproducibly.

This was due to two reasons:

a) The documentation included tutorial/walthrough like output like so:

   <PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=1000x1520 at 
0x7F04BAC72B90>

   … where the 0x7F04BAC72B90 part is non-determinstic and thus varies
   between builds.


b) The .cpp input files were compiled/linked in an order that was
   determined by their layout on the filesystem which is, at least in
   UNIX systems, non-deterministic.

Patch attached that addresses both these issues.

 [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      [email protected] / chris-lamb.co.uk
       `-
--- a/debian/patches/reproducible-build.patch   1970-01-01 01:00:00.000000000 
+0100
--- b/debian/patches/reproducible-build.patch   2020-01-29 11:33:20.626556034 
+0100
@@ -0,0 +1,37 @@
+Description: Make the build reproducible
+Author: Chris Lamb <[email protected]>
+Last-Update: 2020-01-29
+
+--- pikepdf-1.10.0+dfsg.orig/docs/topics/images.rst
++++ pikepdf-1.10.0+dfsg/docs/topics/images.rst
+@@ -36,7 +36,7 @@ dictionaries.
+ 
+     In [1]: pdfimage = PdfImage(rawimage)
+ 
+-    In [1]: pdfimage
++    In [1]: type(pdfimage)
+ 
+ In Jupyter (or IPython with a suitable backend) the image will be
+ displayed.
+@@ -84,7 +84,7 @@ You can also retrieve the image as a Pil
+ 
+ .. ipython::
+ 
+-    In [1]: pdfimage.as_pil_image()
++    In [1]: type(pdfimage.as_pil_image())
+ 
+ Another way to view the image is using Pillow's ``Image.show()`` method.
+ 
+--- pikepdf-1.10.0+dfsg.orig/setup.py
++++ pikepdf-1.10.0+dfsg/setup.py
+@@ -42,8 +42,8 @@ if 'bsd' in sys.platform:
+ ext_modules = [
+     Extension(
+         'pikepdf._qpdf',
+-        glob('src/qpdf/*.cpp'),
+-        depends=glob('src/qpdf/*.h'),
++        sorted(glob('src/qpdf/*.cpp')),
++        depends=sorted(glob('src/qpdf/*.h')),
+         include_dirs=[
+             # Path to pybind11 headers
+             get_pybind_include(),
--- a/debian/patches/series     2020-01-29 11:09:31.619837542 +0100
--- b/debian/patches/series     2020-01-29 11:19:45.147172680 +0100
@@ -3,3 +3,4 @@
 disable-test_docinfo_problems.patch
 drop-pybind11-from-setup.py.patch
 disable-test_icc_extract.patch
+reproducible-build.patch
_______________________________________________
Python-modules-team mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/python-modules-team

Reply via email to