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

Bug#792054: ben: please make the build reproducible



Source: ben
Version: 0.7.0
Severity: wishlist
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-builds@lists.alioth.debian.org

Hi!

While working on the "reproducible builds"€ effort [1], we have noticed
that ben could not be built reproducibly.
It embeds the build date/time into a binary.

The attached patch fixes this by using the date from the latest changelog
entry instead.

Regards,
 Reiner

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

diff --git a/myocamlbuild.ml b/myocamlbuild.ml
index a328d65..c4feb8d 100644
--- a/myocamlbuild.ml
+++ b/myocamlbuild.ml
@@ -51,7 +51,7 @@ let try_run cmd = (* reads one single line *)
   line
 
 let version = try_run "dpkg-parsechangelog | sed -n 's/Version: //p'"
-let build_date = try_run "date +'%F %T %Z'"
+let build_date = try_run "dpkg-parsechangelog | sed -n 's/Date: //p' | date -u +'%F %T %Z' -f -"
 
 let require pkg =
   if not (try_exec (sprintf "ocamlfind query %s" pkg)) then

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: