Source: gringo
Version: 4.5.4-3
Severity: wishlist
Tags: patch upstream
User: reproducible-bui...@lists.alioth.debian.org
Usertags: fileordering
X-Debbugs-Cc: reproducible-bui...@lists.alioth.debian.org

Hi!

While working on the "reproducible builds" effort [1], we have noticed
that gringo could not be built reproducibly.
During build it links objects in non-deterministic order.

The attached patch fixes this by sorting the list of source files.

Regards,
 Reiner

[1]: https://wiki.debian.org/ReproducibleBuilds
diff --git a/debian/patches/reproducible-build.patch b/debian/patches/reproducible-build.patch
new file mode 100644
index 0000000..f2901a4
--- /dev/null
+++ b/debian/patches/reproducible-build.patch
@@ -0,0 +1,14 @@
+Author: Reiner Herrmann <rei...@reiner-h.de>
+Description: Sort source files for deterministic linking order
+
+--- a/SConscript
++++ b/SConscript
+@@ -43,7 +43,7 @@
+                     target = os.path.join(root, filename[:-3] + ".hh")
+                     source = "#"+os.path.join(root, filename)
+                     env.Re2c(target, source)
+-        return sources
++        return sorted(sources)
+     finally:
+         os.chdir(oldcwd)
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 43a7337..bb3fef4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@ gringo-manpages.patch
 gringo-include-math.patch
 gringo-solve-multi.patch
 gringo-translate-minmax.patch
+reproducible-build.patch

Attachment: signature.asc
Description: PGP signature

-- 
debian-science-maintainers mailing list
debian-science-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-science-maintainers

Reply via email to