Your message dated Thu, 20 Aug 2015 10:22:23 +0000
with message-id <[email protected]>
and subject line Bug#795976: fixed in sphinx 1.3.1-5
has caused the Debian Bug report #795976,
regarding sphinx: please make the build reproducible (timestamps, randomness)
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
795976: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=795976
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: sphinx
Version: 1.3.1-4
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: timestamps randomness
X-Debbugs-Cc: [email protected]

Hi!

While working on the “reproducible builds” effort [1], we have noticed
that sphinx could not be built reproducibly.

The attached patch removes build timestamp from the output
documentation, makes domains sorted in HTML documentation, and makes
generated automata (and their pickle dump) deterministic. Once applied,
sphinx (and packages using sphinx) can be built reproducibly in our
current experimental framework.

 [1]: https://wiki.debian.org/ReproducibleBuilds

Regards,
Val
diff -ru sphinx-1.3.1.old/debian/rules sphinx-1.3.1/debian/rules
--- sphinx-1.3.1.old/debian/rules	2015-08-17 17:41:44.557345555 +0000
+++ sphinx-1.3.1/debian/rules	2015-08-18 12:26:01.040804815 +0000
@@ -3,11 +3,14 @@
 
 include /usr/share/python/python.mk
 
+export SOURCE_DATE_EPOCH = $(shell date -d "$$(dpkg-parsechangelog --count 1 -SDate)" +%s)
 export NO_PKG_MANGLE=1
 export PYTHONWARNINGS=d
-export PYTHONHASHSEED=random
 export http_proxy=http://127.0.0.1:9/
 
+# For deterministic pickling
+export PYTHONHASHSEED=0
+
 here = $(dir $(firstword $(MAKEFILE_LIST)))/..
 debian_version = $(word 2,$(shell cd $(here) && dpkg-parsechangelog | grep ^Version:))
 upstream_version = $(subst ~,,$(firstword $(subst -, ,$(debian_version))))
diff -ru sphinx-1.3.1.old/setup.py sphinx-1.3.1/setup.py
--- sphinx-1.3.1.old/setup.py	2015-08-17 17:41:44.557345555 +0000
+++ sphinx-1.3.1/setup.py	2015-08-18 11:41:20.000000000 +0000
@@ -162,7 +162,7 @@
                         messages=jscatalog,
                         plural_expr=catalog.plural_expr,
                         locale=str(catalog.locale)
-                    ), outfile)
+                    ), outfile, sort_keys=True)
                     outfile.write(');')
                 finally:
                     outfile.close()
diff -ru sphinx-1.3.1.old/sphinx/builders/html.py sphinx-1.3.1/sphinx/builders/html.py
--- sphinx-1.3.1.old/sphinx/builders/html.py	2015-08-17 17:41:44.565345555 +0000
+++ sphinx-1.3.1/sphinx/builders/html.py	2015-08-17 19:46:48.000000000 +0000
@@ -824,7 +824,7 @@
                      u'# The remainder of this file is compressed using zlib.\n'
                      % (self.config.project, self.config.version)).encode('utf-8'))
             compressor = zlib.compressobj(9)
-            for domainname, domain in iteritems(self.env.domains):
+            for domainname, domain in sorted(self.env.domains.items()):
                 for name, dispname, type, docname, anchor, prio in \
                         sorted(domain.get_objects()):
                     if anchor.endswith(name):
diff -ru sphinx-1.3.1.old/sphinx/pycode/pgen2/pgen.py sphinx-1.3.1/sphinx/pycode/pgen2/pgen.py
--- sphinx-1.3.1.old/sphinx/pycode/pgen2/pgen.py	2015-08-17 17:41:44.561345555 +0000
+++ sphinx-1.3.1/sphinx/pycode/pgen2/pgen.py	2015-08-18 12:06:30.000000000 +0000
@@ -4,6 +4,7 @@
 from __future__ import print_function
 
 from six import iteritems
+from collections import OrderedDict
 
 # Pgen imports
 
@@ -57,7 +58,7 @@
     def make_first(self, c, name):
         rawfirst = self.first[name]
         first = {}
-        for label in rawfirst:
+        for label in sorted(rawfirst):
             ilabel = self.make_label(c, label)
             ##assert ilabel not in first # X X X failed on <> ... !=
             first[ilabel] = 1
@@ -138,8 +139,8 @@
                 totalset[label] = 1
                 overlapcheck[label] = {label: 1}
         inverse = {}
-        for label, itsfirst in iteritems(overlapcheck):
-            for symbol in itsfirst:
+        for label, itsfirst in sorted(overlapcheck.items()):
+            for symbol in sorted(itsfirst):
                 if symbol in inverse:
                     raise ValueError("rule %s is ambiguous; %s is in the"
                                      " first sets of %s as well as %s" %
@@ -349,6 +350,9 @@
         assert isinstance(next, NFAState)
         self.arcs.append((label, next))
 
+    def __hash__(self):
+        return hash(tuple(x[0] for x in self.arcs))
+
 class DFAState(object):
 
     def __init__(self, nfaset, final):
@@ -357,7 +361,10 @@
         assert isinstance(final, NFAState)
         self.nfaset = nfaset
         self.isfinal = final in nfaset
-        self.arcs = {} # map from label to DFAState
+        self.arcs = OrderedDict() # map from label to DFAState
+
+    def __hash__(self):
+        return hash(tuple(self.arcs))
 
     def addarc(self, next, label):
         assert isinstance(label, str)

Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---
--- Begin Message ---
Source: sphinx
Source-Version: 1.3.1-5

We believe that the bug you reported is fixed in the latest version of
sphinx, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Dmitry Shachnev <[email protected]> (supplier of updated sphinx package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Thu, 20 Aug 2015 11:56:56 +0300
Source: sphinx
Binary: python-sphinx python3-sphinx sphinx-common sphinx-doc libjs-sphinxdoc
Architecture: source all
Version: 1.3.1-5
Distribution: unstable
Urgency: medium
Maintainer: Debian Python Modules Team 
<[email protected]>
Changed-By: Dmitry Shachnev <[email protected]>
Description:
 libjs-sphinxdoc - JavaScript support for Sphinx documentation
 python-sphinx - documentation generator for Python projects (implemented in 
Pytho
 python3-sphinx - documentation generator for Python projects (implemented in 
Pytho
 sphinx-common - documentation generator for Python projects - common data
 sphinx-doc - documentation generator for Python projects - documentation
Closes: 795976
Changes:
 sphinx (1.3.1-5) unstable; urgency=medium
 .
   * Fix remaining reproducibility issues (closes: #795976):
     - Export SOURCE_DATE_EPOCH in debian/rules.
     - Set PYTHONHASHSEED=0 when generating grammar files.
     - Make grammar generation deterministic (reproducible_grammar.diff).
     - Make inventory generation deterministic (reproducible_inventory.diff).
     - Make JavaScript locales deterministic (reproducible_js_locale.diff).
     Many thanks to Val Lorentz for the patches.
   * Drop XS-Testsuite header, no longer needed with dpkg ≥ 1.17.11.
Checksums-Sha1:
 51ca096fdf980710d9a275ac494c643fa31ed133 2978 sphinx_1.3.1-5.dsc
 0e646aed310231aa610e66e97c9e496b5ef5907b 31208 sphinx_1.3.1-5.debian.tar.xz
 c76208b437fe2db0e071d74535df8fb598572b7e 52992 libjs-sphinxdoc_1.3.1-5_all.deb
 e456b2d9e0320ed6caa5c7f919d8af94ec7d3eb4 351952 python-sphinx_1.3.1-5_all.deb
 4ad51291ab8c1afa4e25f58f53d41dd23fe3ce73 350756 python3-sphinx_1.3.1-5_all.deb
 84939129010831f63ad6d2e0b643cc750e1554f0 320284 sphinx-common_1.3.1-5_all.deb
 664b766a61a6a5179b825e2e3292241a908aa46d 1116772 sphinx-doc_1.3.1-5_all.deb
Checksums-Sha256:
 d9fb31c0c3dd17ab5e0e881843ee0ab9868299165f1f539391b312f827fde322 2978 
sphinx_1.3.1-5.dsc
 cbdad7012d85ff34281f6f9fa6dfbd538fac32817f4a55f51818458380a0aed4 31208 
sphinx_1.3.1-5.debian.tar.xz
 c9863126ea183d795c8a63711f603f944066006d0d3d3ff051e66389f3b2b422 52992 
libjs-sphinxdoc_1.3.1-5_all.deb
 83ac626017e39497aa7028b47a93626b6fb429df2018bdd4ed29348b41614dd0 351952 
python-sphinx_1.3.1-5_all.deb
 d8a2ba9f2c89fbfbb0978df9a91f99f034b8ffeba5bb3aa7bcaab5eb7aba4acc 350756 
python3-sphinx_1.3.1-5_all.deb
 590f7b0627de73ee20bf2e325872ebe12e1049d671aee5821f3449adc0a8ac6a 320284 
sphinx-common_1.3.1-5_all.deb
 68b6805c03b2904fe5532914edc898d9909dd8a4a2cf5674129eb3685477503f 1116772 
sphinx-doc_1.3.1-5_all.deb
Files:
 bc2114d82eea4fe069e08ec213523e68 2978 python optional sphinx_1.3.1-5.dsc
 4ffa6e642c2c54883178556c6408c155 31208 python optional 
sphinx_1.3.1-5.debian.tar.xz
 c2dbe62a47da922f8ec6484fbf667f04 52992 web optional 
libjs-sphinxdoc_1.3.1-5_all.deb
 1a88ad945d8c9323444d87006a89eff4 351952 python optional 
python-sphinx_1.3.1-5_all.deb
 e270a09066dd6c04282fbecbfee1c2d5 350756 python optional 
python3-sphinx_1.3.1-5_all.deb
 efbd5031b9a1452657b2012de2d06bf6 320284 python optional 
sphinx-common_1.3.1-5_all.deb
 8ed132e8e9939d387878c5157df984a3 1116772 doc optional 
sphinx-doc_1.3.1-5_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJV1aXBAAoJENb+cQNj+F3TqfYP/ine+b4eAbmPMhuPVNXNtb0a
AppVi0Bhr8vYADP6AANEeeCA+2Pqz23BQi9bVguTKf1rpx2Jgd3DPeGK1xvHgQ+7
GNKYp0rgdTfQmsUDoi543oG1JxdT++jPr9ai+cxzkIGPblpDdOg+uqpuqd7rPUKA
8NckFtmH9w3b2MRZ8JzxvA8f2g9jKVhgF2esMVSizrjc4bAOMLLZ2UkxkuQjwqBQ
ao2gDC6bS+NJuIshX1gPlOWG/QCt0gJ3843NXr53CHcPuHwu6Yt1DIymPwpThD4o
bThZHopnyrFOGmPmQGVUYKteMt70htWrh8VGFZ0byKzJXRwdXVK9SjMOmbnESFDF
RyMg+OF1k3uW8Wd1v5CYIcixgvYb2SQrvHLz73Y/24J46G/tZk6qW6/c7go4bvaa
MWF2Oi/vNww83IompPPD/9N0/+EYKr0Va1h2jl97QRm6JEO/1MelokYajNNpxSkk
q9YLYnG9TCFpedyu72sNm4u/A3jld4/IKocs9hRAdYTyUvJQcL5LRvoqPWXFfN3z
G3Td/6twkx3qtuGmOgKYExtTjPu7iHQhdF7grj4Myz8cbGlgIWm/N2u5w7uQuRin
8kFAiX+mBHjgpXFErnKTBxTGVGl6Gfcom3GThHOPy15P1BPnmA0J88LiUJFG/YnR
T1O+Uyu6wx2p+DXWo1Jj
=g5Ev
-----END PGP SIGNATURE-----

--- End Message ---
_______________________________________________
Python-modules-team mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team

Reply via email to