[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#779037: dh-ocaml: please make the build reproducible



Source: dh-ocaml
Version: 1.0.9
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: toolchain randomness
X-Debbugs-Cc: reproducible-builds@lists.alioth.debian.org

Hi,

While working on the "reproducible builds" effort [1], we have noticed
that dh-ocaml generates /var/lib/ocaml/lintian/libfoo-ocaml-dev.info
files with a non-deterministic order.

The attached patch removes this randomness from the build system.

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


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby@debian.org / chris-lamb.co.uk
       `-
diff --git a/debhelper/dh_ocaml b/debhelper/dh_ocaml
index de4535b..05b1981 100755
--- a/debhelper/dh_ocaml
+++ b/debhelper/dh_ocaml
@@ -353,7 +353,7 @@ foreach my $package (keys(%dev_packages), @binary_packages)
 
     # Search for OCaml bytecode binaries and objects
     open(OLIST, ">", $olist_fn) unless $dh{NO_ACT};
-    find sub {
+    find {'wanted' => sub {
         (-f $_)
         &&
         (-x $_ && test_bytecode($_) || /\.cm([iaox]|x[as])$/)
@@ -363,6 +363,10 @@ foreach my $package (keys(%dev_packages), @binary_packages)
         (!$dh{NO_ACT})
         &&
         (print OLIST $File::Find::name."\n")
+      },
+      'preprocess' => sub {
+        return sort @_;
+      }
     }, @search_path;
     close(OLIST) unless $dh{NO_ACT};
     doit("cat $olist_fn") if $dh{VERBOSE};

Reply to: