From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: bug#25598: [PATCH] gnu: r: Fix remaining reproducibility problems. Date: Thu, 16 Mar 2017 08:54:02 +0100 Message-ID: <20170316075402.29869-1-rekado@elephly.net> References: <8737fydyma.fsf@gnu.org> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53725) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1coQFX-00013u-9q for bug-guix@gnu.org; Thu, 16 Mar 2017 03:55:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1coQFT-0007qF-48 for bug-guix@gnu.org; Thu, 16 Mar 2017 03:55:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:59716) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1coQFT-0007q8-0D for bug-guix@gnu.org; Thu, 16 Mar 2017 03:55:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1coQFS-0003Si-Gu for bug-guix@gnu.org; Thu, 16 Mar 2017 03:55:02 -0400 In-Reply-To: <8737fydyma.fsf@gnu.org> Sender: "Debbugs-submit" Resent-Message-ID: List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 25598@debbugs.gnu.org Fixes . * gnu/packages/statistics.scm (r)[arguments]: Add remaining reproducibility fixes to "build-reproducibly" phase. --- gnu/packages/statistics.scm | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 656895273..2a20abd86 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -134,11 +134,44 @@ be output in text, PostScript, PDF or HTML.") #t)) (add-after 'unpack 'build-reproducibly (lambda _ - ;; Ensure that gzipped files are reproducible + ;; The documentation contains time stamps to demonstrate + ;; documentation generation in different phases. + (substitute* "src/library/tools/man/Rd2HTML.Rd" + (("\\\\%Y-\\\\%m-\\\\%d at \\\\%H:\\\\%M:\\\\%S") + "(removed for reproducibility)")) + + ;; Remove timestamp from tracing environment. This fixes + ;; reproducibility of "methods.rd{b,x}". + (substitute* "src/library/methods/R/trace.R" + (("dateCreated = Sys.time\\(\\)") + "dateCreated = as.POSIXct(\"1970-1-1 00:00:00\", tz = \"UTC\")")) + + ;; Ensure that gzipped files are reproducible. (substitute* '("src/library/grDevices/Makefile.in" "doc/manual/Makefile.in") (("R_GZIPCMD\\)" line) (string-append line " -n"))) + + ;; The "srcfile" procedure in "src/library/base/R/srcfile.R" + ;; queries the mtime of a given file and records it in an object. + ;; This is acceptable at runtime to detect stale source files, + ;; but it destroys reproducibility at build time. + ;; + ;; Instead of disabling this feature, which may have unexpected + ;; consequences, we reset the mtime of generated files before + ;; passing them to the "srcfile" procedure. + (substitute* "src/library/Makefile.in" + (("@\\(cd base && \\$\\(MAKE\\) mkdesc\\)" line) + (string-append line "\n find $(top_builddir)/library/tools | xargs touch -d '1970-01-01'; \n")) + (("@\\$\\(MAKE\\) Rdobjects" line) + (string-append "@find $(srcdir)/tools | xargs touch -d '1970-01-01'; \n " + line))) + (substitute* "src/library/tools/Makefile.in" + (("@\\$\\(INSTALL_DATA\\) all.R \\$\\(top_builddir\\)/library/\\$\\(pkg\\)/R/\\$\\(pkg\\)" line) + (string-append + line + "\n find $(srcdir)/$(pkg) $(top_builddir)/library/$(pkg) | xargs touch -d \"1970-01-01\"; \n"))) + ;; This library is installed using "install_package_description", ;; so we need to pass the "builtStamp" argument. (substitute* "src/library/tools/Makefile.in" -- 2.12.0