guix-commits
[Top][All Lists]
Advanced

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

02/02: gnu: perl: Build deterministically, and make byproducts determini


From: Ludovic Courtès
Subject: 02/02: gnu: perl: Build deterministically, and make byproducts deterministic.
Date: Sun, 13 Dec 2015 10:29:08 +0000

civodul pushed a commit to branch core-updates
in repository guix.

commit 4187fe750f128f934bd6030912133d13d19baafd
Author: Ludovic Courtès <address@hidden>
Date:   Sun Dec 13 11:25:24 2015 +0100

    gnu: perl: Build deterministically, and make byproducts deterministic.
    
    With this, a --rounds=2 build passes, and timestamps in POD files can be
    controlled with 'SOURCE_DATE_EPOCH'.
    
    * gnu/packages/patches/perl-deterministic-ordering.patch,
    gnu/packages/patches/perl-no-build-time.patch,
    gnu/packages/patches/perl-source-date-epoch.patch: New files.
    * gnu/packages/perl.scm (perl)[source]: Use them.
    * gnu-system.am (dist_patch_DATA): Add them.
---
 gnu-system.am                                      |    3 ++
 .../patches/perl-deterministic-ordering.patch      |   29 ++++++++++++++++++++
 gnu/packages/patches/perl-no-build-time.patch      |   26 +++++++++++++++++
 gnu/packages/patches/perl-source-date-epoch.patch  |   19 +++++++++++++
 gnu/packages/perl.scm                              |    5 +++-
 5 files changed, 81 insertions(+), 1 deletions(-)

diff --git a/gnu-system.am b/gnu-system.am
index 1db9d51..0fff8de 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -615,11 +615,14 @@ dist_patch_DATA =                                         
\
   gnu/packages/patches/patchutils-xfail-gendiff-tests.patch    \
   gnu/packages/patches/patch-hurd-path-max.patch               \
   gnu/packages/patches/perl-autosplit-default-time.patch       \
+  gnu/packages/patches/perl-deterministic-ordering.patch       \
   gnu/packages/patches/perl-finance-quote-unuse-mozilla-ca.patch \
   gnu/packages/patches/perl-gd-options-passthrough-and-fontconfig.patch \
   gnu/packages/patches/perl-net-amazon-s3-moose-warning.patch  \
   gnu/packages/patches/perl-net-ssleay-disable-ede-test.patch  \
+  gnu/packages/patches/perl-no-build-time.patch                        \
   gnu/packages/patches/perl-no-sys-dirs.patch                  \
+  gnu/packages/patches/perl-source-date-epoch.patch            \
   gnu/packages/patches/perl-tk-x11-discover.patch              \
   gnu/packages/patches/pidgin-add-search-path.patch            \
   gnu/packages/patches/pingus-sdl-libs-config.patch            \
diff --git a/gnu/packages/patches/perl-deterministic-ordering.patch 
b/gnu/packages/patches/perl-deterministic-ordering.patch
new file mode 100644
index 0000000..92e33ef
--- /dev/null
+++ b/gnu/packages/patches/perl-deterministic-ordering.patch
@@ -0,0 +1,29 @@
+From <https://bugs.debian.org/801523>.
+
+From c01f602d1926b0671fd2c8d91f7e52c4e4c9fb24 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <address@hidden>
+Date: Sun, 11 Oct 2015 19:27:56 +0300
+Subject: [PATCH] Sort the list of XS code files when generating RealPPPort.xs
+
+all_files_in_dir() uses readdir() ordering to make the list of
+input files. This can vary between build systems, breaking build
+reproducibility.
+---
+ cpan/Devel-PPPort/PPPort_xs.PL | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cpan/Devel-PPPort/PPPort_xs.PL b/cpan/Devel-PPPort/PPPort_xs.PL
+index 5f18940..149f2fe 100644
+--- a/cpan/Devel-PPPort/PPPort_xs.PL
++++ b/cpan/Devel-PPPort/PPPort_xs.PL
+@@ -38,7 +38,7 @@ END
+ my $file;
+ my $sec;
+ 
+-for $file (all_files_in_dir('parts/inc')) {
++for $file (sort(all_files_in_dir('parts/inc'))) {
+   my $spec = parse_partspec($file);
+ 
+   my $msg = 0;
+-- 
+2.5.1
diff --git a/gnu/packages/patches/perl-no-build-time.patch 
b/gnu/packages/patches/perl-no-build-time.patch
new file mode 100644
index 0000000..5d78e8f
--- /dev/null
+++ b/gnu/packages/patches/perl-no-build-time.patch
@@ -0,0 +1,26 @@
+Do not record the configuration and build time so that builds can be
+reproduced bit-for-bit.
+
+--- perl-5.22.0/Configure      1970-01-01 01:00:00.000000000 +0100
++++ perl-5.22.0/Configure      2015-12-13 00:14:43.148165080 +0100
+@@ -3834,6 +3817,7 @@ esac
+ 
+ : who configured the system
+ cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
++cf_time='Thu Jan  1 00:00:01 UTC 1970'
+ case "$cf_by" in
+ "")
+       cf_by=`(logname) 2>/dev/null`
+
+--- perl-5.22.0/perl.c 2015-12-13 00:25:30.269156627 +0100
++++ perl-5.22.0/perl.c 2015-12-13 00:25:38.265218175 +0100
+@@ -1795,7 +1795,7 @@ S_Internals_V(pTHX_ CV *cv)
+     PUSHs(Perl_newSVpvn_flags(aTHX_ non_bincompat_options,
+                             sizeof(non_bincompat_options) - 1, SVs_TEMP));
+ 
+-#ifdef __DATE__
++#if 0
+ #  ifdef __TIME__
+     PUSHs(Perl_newSVpvn_flags(aTHX_
+                             STR_WITH_LEN("Compiled at " __DATE__ " " 
__TIME__),
+
diff --git a/gnu/packages/patches/perl-source-date-epoch.patch 
b/gnu/packages/patches/perl-source-date-epoch.patch
new file mode 100644
index 0000000..37330c9
--- /dev/null
+++ b/gnu/packages/patches/perl-source-date-epoch.patch
@@ -0,0 +1,19 @@
+Adapted from <https://bugs.debian.org/801621>.
+Make Pod::Man honor the SOURCE_DATE_EPOCH environment variable.
+
+--- perl-5.22.0/cpan/podlators/lib/Pod/Man.pm  2015-12-12 22:33:03.321787590 
+0100
++++ perl-5.22.0/cpan/podlators/lib/Pod/Man.pm  2015-12-12 22:36:33.367361338 
+0100
+@@ -884,7 +884,12 @@ sub devise_date {
+     my ($self) = @_;
+     my $input = $self->source_filename;
+     my $time;
+-    if ($input) {
++
++    if (defined($ENV{SOURCE_DATE_EPOCH}) &&
++        $ENV{SOURCE_DATE_EPOCH} !~ /\D/) {
++        $time = $ENV{SOURCE_DATE_EPOCH};
++    }
++    elsif ($input) {
+         $time = (stat $input)[9] || time;
+     } else {
+         $time = time;
diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index 8fec270..6afe0b7 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -47,7 +47,10 @@
                "0g5bl8sdpzx9gx2g5jq3py4bj07z2ylk7s1qn0fvsss2yl3hhs8c"))
              (patches (map search-patch
                            '("perl-no-sys-dirs.patch"
-                             "perl-autosplit-default-time.patch")))))
+                             "perl-autosplit-default-time.patch"
+                             "perl-source-date-epoch.patch"
+                             "perl-deterministic-ordering.patch"
+                             "perl-no-build-time.patch")))))
     (build-system gnu-build-system)
     (arguments
      '(#:tests? #f



reply via email to

[Prev in Thread] Current Thread [Next in Thread]