Package: python-setuptools
Version: 5.5.1-1
Severity: wishlist
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: toolchain randomness

Hi!

While working on the “reproducible builds” effort [1], we have noticed
that many Python packages would not build reproducibly because the order
of names in the top_level.txt file would vary from one build to
another [2].

It would be great if these names could be written in a stable order.
With the attached patch, names are sorted before being written.

 [1]: https://wiki.debian.org/ReproducibleBuilds
 [2]: 
https://reproducible.debian.net/userContent/issues/random_order_in_egg_info_top_level_txt_issue.html

-- 
Lunar                                .''`. 
lu...@debian.org                    : :Ⓐ  :  # apt-get install anarchism
                                    `. `'` 
                                      `-   
diff -Nru python-setuptools-5.5.1/debian/changelog python-setuptools-5.5.1/debian/changelog
--- python-setuptools-5.5.1/debian/changelog	2014-08-12 13:52:03.000000000 +0200
+++ python-setuptools-5.5.1/debian/changelog	2014-12-26 11:33:09.000000000 +0100
@@ -1,3 +1,10 @@
+python-setuptools (5.5.1-1.0~reproducible1) UNRELEASED; urgency=medium
+
+  * Output names in toplevel.txt with a stable order to make module
+    builds reproducible.
+
+ -- Jérémy Bobbio <lu...@debian.org>  Fri, 26 Dec 2014 11:32:13 +0100
+
 python-setuptools (5.5.1-1) unstable; urgency=medium
 
   * New upstream version. Closes: #754089.
diff -Nru python-setuptools-5.5.1/debian/patches/series python-setuptools-5.5.1/debian/patches/series
--- python-setuptools-5.5.1/debian/patches/series	2013-12-31 12:31:31.000000000 +0100
+++ python-setuptools-5.5.1/debian/patches/series	2014-12-26 11:26:53.000000000 +0100
@@ -1,2 +1,3 @@
 install-layout.diff
 multiarch-extname.diff
+stable-order-for-toplevel-names.diff
diff -Nru python-setuptools-5.5.1/debian/patches/stable-order-for-toplevel-names.diff python-setuptools-5.5.1/debian/patches/stable-order-for-toplevel-names.diff
--- python-setuptools-5.5.1/debian/patches/stable-order-for-toplevel-names.diff	1970-01-01 01:00:00.000000000 +0100
+++ python-setuptools-5.5.1/debian/patches/stable-order-for-toplevel-names.diff	2014-12-26 11:29:13.000000000 +0100
@@ -0,0 +1,17 @@
+Description: Outpt top-level names in stable order
+ In order to make the build process of Python module reproducible, names in
+ toplevel.txt must be written in a stable order. Here we go for the simple
+ answer by sorting them.
+Author: Jérémy Bobbio <lu...@debian.org>
+
+--- python-setuptools-5.5.1.orig/setuptools/command/egg_info.py
++++ python-setuptools-5.5.1/setuptools/command/egg_info.py
+@@ -389,7 +389,7 @@ def write_toplevel_names(cmd, basename,
+             for k in cmd.distribution.iter_distribution_names()
+         ]
+     )
+-    cmd.write_file("top-level names", filename, '\n'.join(pkgs) + '\n')
++    cmd.write_file("top-level names", filename, '\n'.join(sorted(pkgs)) + '\n')
+ 
+ 
+ def overwrite_arg(cmd, basename, filename):

Attachment: signature.asc
Description: Digital signature

Reply via email to