[Libguestfs] [libguestfs/libnbd] Make the build reproducible (#2)

Richard W.M. Jones rjones at redhat.com
Fri Sep 6 08:47:32 UTC 2019


Thanks, I have pushed this.

There are various other projects using a similar/derived POD wrapper
script, so I have pushed the same patch to those too.

https://github.com/libguestfs/libnbd/commit/2a955696cde1be60d468fdc662b4f70ec862b866

https://github.com/libguestfs/libguestfs/commit/d58c4e79d8a282b68ba9a19b944289bd66c8d648

https://github.com/libguestfs/nbdkit/commit/b485ade71464fc351828e2fcce54464709bf234d

Pino: The attached patch should be considered for virt-p2v too.
I could not push it myself.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW
-------------- next part --------------
>From 22cfcb69cbf4dc40cf46e1b6fe8d21cfc888cde2 Mon Sep 17 00:00:00 2001
From: Chris Lamb <lamby at debian.org>
Date: Fri, 6 Sep 2019 09:09:16 +0100
Subject: [PATCH] Make the build reproducible

Whilst working on the Reproducible Builds effort [0] we noticed
that libnbd could not be built reproducibly.

This is due to it shipping a pod generation wrapper that
does not use/respect SOURCE_DATE_EPOCH [1] and additionally
varies the output depending on the build user's current
timezone.

(This was originally filed in Debian as #939546 [2].)

 [0] https://reproducible-builds.org/
 [1] https://reproducible-builds.org/docs/source-date-epoch/
 [2] https://bugs.debian.org/939546

Signed-off-by: Chris Lamb <lamby at debian.org>
---
 podwrapper.pl.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/podwrapper.pl.in b/podwrapper.pl.in
index 978134a..dd0551e 100755
--- a/podwrapper.pl.in
+++ b/podwrapper.pl.in
@@ -227,7 +227,7 @@ if (!$date && -d $filename) {
     $date = $1 if /^(\d+-\d+-\d+)\s/;
 }
 if (!$date) {
-    my ($day, $month, $year) = (localtime)[3,4,5];
+    my ($day, $month, $year) = (gmtime($ENV{SOURCE_DATE_EPOCH} || time))[3,4,5];
     $date = sprintf ("%04d-%02d-%02d", $year+1900, $month+1, $day);
 }
 


More information about the Libguestfs mailing list