Source: clasp
Version: 3.1.4-2
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 clasp could not be built reproducibly.
A list of source files is not sorted, which causes a non-deterministic
linking order.

The attached patch fixes this.

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..8e840d1
--- /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/tools/Base.in
++++ b/tools/Base.in
+@@ -6,7 +6,7 @@
+ AR           ?= ar
+ -include .CONFIG
+ -include $(FLAGS)
+-SOURCES      := $(patsubst $(SOURCE_DIR)/%.cpp,%.cpp,$(wildcard $(SOURCE_DIR)/*.cpp))
++SOURCES      := $(patsubst $(SOURCE_DIR)/%.cpp,%.cpp,$(sort $(wildcard $(SOURCE_DIR)/*.cpp)))
+ ifeq ($(OUT_DIR),)
+ DEPS         := $(patsubst %.cpp,%.dep, $(SOURCES))
+ OBJECTS      := $(patsubst %.cpp,%.o, $(SOURCES))
diff --git a/debian/patches/series b/debian/patches/series
index c78dfaa..9fd6edb 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 clasp-manpage.patch
 clasp-parallel-solve.patch
+reproducible-build.patch

Attachment: signature.asc
Description: Digital 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