Source: azure-uamqp-python
Version: 1.2.6-1
Severity: wishlist
Tags: patch
User: [email protected]
Usertags: filesystem buildpath
X-Debbugs-Cc: [email protected]
Hi,
Whilst working on the Reproducible Builds effort [0] we noticed that
azure-uamqp-python could not be built reproducibly.
This is because it generated a .pyx file with the "#include"
directives in a nondeterminstic order as well as included metadata in
a ".c" file that embeded the absolute buildpath. However, it still
embeds the current build path in the binary via assert-like logging
messages ("LogError" IIRC).
Patch attached for the former two issues.
[0] https://reproducible-builds.org/
Regards,
--
,''`.
: :' : Chris Lamb
`. `'` [email protected] / chris-lamb.co.uk
`-
--- a/debian/patches/reproducible-build.patch 1969-12-31 16:00:00.000000000
-0800
--- b/debian/patches/reproducible-build.patch 2020-02-25 08:40:37.020019063
-0800
@@ -0,0 +1,24 @@
+Description: Make the build reproducible
+Author: Chris Lamb <[email protected]>
+Last-Update: 2020-02-25
+
+--- azure-uamqp-python-1.2.6.orig/setup.py
++++ azure-uamqp-python-1.2.6/setup.py
+@@ -45,7 +45,7 @@ cwd = os.path.abspath('.')
+
+ # Headers
+
+-pxd_inc_dir = os.path.join(cwd, "src", "vendor", "inc")
++pxd_inc_dir = os.path.join(".", "src", "vendor", "inc")
+ sys.path.insert(0, pxd_inc_dir)
+
+ include_dirs = [
+@@ -68,7 +68,7 @@ else:
+
+ def create_cython_file():
+ content_includes = ""
+- for f in os.listdir("./src"):
++ for f in sorted(os.listdir("./src")):
+ if f.endswith(".pyx"):
+ print("Adding {}".format(f))
+ content_includes += "include \"src/" + f + "\"\n"
--- a/debian/patches/series 1969-12-31 16:00:00.000000000 -0800
--- b/debian/patches/series 2020-02-25 08:29:13.434683576 -0800
@@ -0,0 +1 @@
+reproducible-build.patch
--- a/setup.py 2020-02-25 08:08:37.986925148 -0800
--- b/setup.py 2020-02-25 08:47:27.151166104 -0800
@@ -45,7 +45,7 @@
# Headers
-pxd_inc_dir = os.path.join(cwd, "src", "vendor", "inc")
+pxd_inc_dir = os.path.join(".", "src", "vendor", "inc")
sys.path.insert(0, pxd_inc_dir)
include_dirs = [
@@ -68,7 +68,7 @@
def create_cython_file():
content_includes = ""
- for f in os.listdir("./src"):
+ for f in sorted(os.listdir("./src")):
if f.endswith(".pyx"):
print("Adding {}".format(f))
content_includes += "include \"src/" + f + "\"\n"