unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
To: 30729@debbugs.gnu.org
Subject: bug#30729: r-lambda-r not reproducible
Date: Fri, 9 Mar 2018 22:43:15 +0100	[thread overview]
Message-ID: <87sh99j570.fsf@mdc-berlin.de> (raw)
In-Reply-To: <idjk1up2z8b.fsf@bimsb-sys02.mdc-berlin.net>


Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> 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] "<text>"

$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

  reply	other threads:[~2018-03-09 21:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-06 11:57 bug#30729: r-lambda-r not reproducible Ricardo Wurmus
2018-03-09 21:43 ` Ricardo Wurmus [this message]
2018-03-11 11:17   ` Ricardo Wurmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sh99j570.fsf@mdc-berlin.de \
    --to=ricardo.wurmus@mdc-berlin.de \
    --cc=30729@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).