Subject: Re: bug#22304: Julia not reproducible

From: zimoun <[email-masked]>
Date: Fri, 24 Jan 2020 19:30:20 +0100

Hi,

On Mon, 2 Dec 2019 at 18:28, zimoun <[email-masked]> wrote:

> If I understand well [1], the file .ji are "precompiled" (analogy: .pyc). Hum?!

The non-determinism seems coming from these "precompiled" .ji files
and 2 bugs are opened upstream.

https://github.com/JuliaLang/julia/issues/25900
https://github.com/JuliaLang/julia/issues/34115

Thanks to Nicolò to pointing out these [1] when working on the version update.

[1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=38546#80

With lengthy and clear details. :-)

Let start the container with everything useful.

--8<---------------cut here---------------start------------->8---
mkdir -p /tmp/test-julia && cd /tmp/test-julia

guix time-machine --commit=b5d4d5b \
   environment -u nixbld --no-cwd --container --network \
   --expose=$(realpath determinism) --share=/tmp/test-julia \
   --ad-hoc julia coreutils nss-certs curl tar gzip
--8<---------------cut here---------------end--------------->8---

Then, the path to reproduce is odd because there is no Julia packages
in Guix. So we need to use 'Pkg' from Julia which downloads from
elsewhere and the reproducibility of such is not well controlled but
it gives an idea. :-)

--8<---------------cut here---------------start------------->8---
export SSL_CERT_DIR="$GUIX_ENVIRONMENT/etc/ssl/certs"
export SSL_CERT_FILE="$SSL_CERT_DIR/ca-certificates.crt"
export GIT_SSL_CAINFO="$SSL_CERT_FILE"

# populate the Julia package manager
julia --startup-file=no -q -e 'using Pkg; Pkg.instantiate()'

# install something
julia --startup-file=no -q -e 'using Pkg; Pkg.add("Compat")'

# use something / precompiled it
julia --startup-file=no -q -e 'using Compat'

# check the .ji file
md5sum ~/.julia/compiled/v1.1/Compat/*
--8<---------------cut here---------------end--------------->8---

Then each time one runs this block, one gets different hash.

All the best,
simon