From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: bug#30729: r-lambda-r not reproducible Date: Fri, 9 Mar 2018 22:43:15 +0100 Message-ID: <87sh99j570.fsf@mdc-berlin.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35301) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1euPo6-0006H2-1v for bug-guix@gnu.org; Fri, 09 Mar 2018 16:44:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1euPo2-0008Na-SU for bug-guix@gnu.org; Fri, 09 Mar 2018 16:44:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:44966) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1euPo2-0008NW-GR for bug-guix@gnu.org; Fri, 09 Mar 2018 16:44:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1euPo2-0002Jj-6r for bug-guix@gnu.org; Fri, 09 Mar 2018 16:44:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: 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: 30729@debbugs.gnu.org Ricardo Wurmus writes: > The r-lambda-r package is not reproducible. The differences in the RDX > files indicates that the package’s RDB file includes references to > environments that differ in size, which leads to variables being stored > at different offsets in the RDB file. […] > │ │ $references$`env::6` > │ │ -[1] 17999 584 > │ │ +[1] 17999 588 > │ │ > │ │ $references$`env::7` > │ │ -[1] 18583 807 > │ │ +[1] 18587 810 > │ │ > │ │ $references$`env::8` > │ │ -[1] 19390 617 > │ │ +[1] 19397 618 > │ │ > │ │ $references$`env::9` > │ │ -[1] 20007 1550 > │ │ +[1] 20015 1548 The problem is indeed that the sizes of the serialised environments differ. But how can I inspect these environments? The RDX file is an index into the compressed binary RDB. The index tells me that `env::6` is found at offset 17999 and has a size of 584 bytes (or 588 in the second build). R internally uses lazyLoadDBfetch to look up values in serialised files without having to load the full file into memory. We can do the same in an R session. Here I use a different offset and size for the new build I have here: --8<---------------cut here---------------start------------->8--- e <- lazyLoadDBfetch(as.integer(c(16386, 659)), file="/gnu/store/z53g4n9frbgcvbkpq0ai1y286177gz3i-r-lambda-r-1.2/site-library/lambda.r/R/lambda.r.rdb", compressed=TRUE, hook=NULL) --8<---------------cut here---------------end--------------->8--- Now looking at the contents of “e”, I see that it has a “bindings” field. And this contains values like this: --8<---------------cut here---------------start------------->8--- $Enc [1] "unknown" $filename [1] "" $fixedNewlines [1] TRUE $isFile [1] FALSE $lines [1] "function(...) UseFunction(describe,\"describe\",...)" […] $timestamp [1] "2018-03-08 01:21:11 CET" $wd [1] "/tmp/guix-build-r-lambda-r-1.2.drv-0/lambda.r" --8<---------------cut here---------------end--------------->8--- “timestamp”? Hah! Searching the R sources indicates that this value is set in “src/library/base/R/srcfile.R”, which I’ve previously encountered in the arguments field of “r-minimal”. It looks like this value is taken from the source file’s mtime, but resetting the timestamps before the “install” phase didn’t seem to have helped. Maybe this needs to be done at some other point that is somewhere deep within R CMD INSTALL. In that case, I think we can do the same as for Python and introduce a check for DETERMINISTIC_BUILD into “srcfile”. -- Ricardo