GNU bug report logs

#22304 Build for Julia is not reproducible

PackageSource(s)Maintainer(s)
guix PTS Buildd Popcon
Reply or subscribe to this bug. View this bug as an mbox, status mbox, or maintainer mbox

Report forwarded to bug-guix@gnu.org:
bug#22304; Package guix. (Mon, 04 Jan 2016 16:30:02 GMT) (full text, mbox, link).


Acknowledgement sent to Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>:
New bug report received and forwarded. Copy sent to bug-guix@gnu.org. (Mon, 04 Jan 2016 16:30:02 GMT) (full text, mbox, link).


Message #5 received at submit@debbugs.gnu.org (full text, mbox, reply):

From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
To: <bug-guix@gnu.org>
Subject: Build for Julia is not reproducible
Date: Mon, 4 Jan 2016 17:28:42 +0100
When building “julia” twice we get different binaries for

  $out/lib/julia/sys.so

and

  $out/lib/julia/sys-debug.so

I could not determine the exact differences, because instead of a diff I
just see something like this:

--- /gnu/store/6njfyp46b22b0wb0r0ccg2wdzjx7066g-julia-0.4.2/lib/julia/sys.so
+++ 6njfyp46b22b0wb0r0ccg2wdzjx7066g-julia-0.4.2/lib/julia/sys.so
├── objdump --disassemble --full-contents {}
│ @@ -99994,8 +99994,8 @@
│   186a00 05a3d38a 01488985 38ffffff 488b0515  .....H..8...H...
│   186a10 5b8b0148 898540ff ffff4c89 ad48ffff  [..H..@...L..H..
│   186a20 ff31ffba 03000000 4c8db538 ffffff4c  .1......L..8...L
│   186a30 89f64989 f4e8b653 f0ff4889 8538ffff  ..I....S..H..8..
│   186a40 ff31ffba 03000000 488d9d28 ffffff49  .1......H..(...I
│   186a50 89de4c89 f6e89653 f0ff4889 8528ffff  ..L....S..H..(..
│   186a60 ff488b05 38d08a01 48898530 ffffff48  .H..8...H..0...H
│ -[ Too much input for diff ]                     
│ +[ Too much input for diff ]                         

...

--- /gnu/store/6njfyp46b22b0wb0r0ccg2wdzjx7066g-julia-0.4.2/lib/julia/sys-debug.so
+++ 6njfyp46b22b0wb0r0ccg2wdzjx7066g-julia-0.4.2/lib/julia/sys-debug.so
├── objdump --disassemble --full-contents {}
│ @@ -99994,8 +99994,8 @@
│   1869f0 01488b38 be370200 00e84257 f0ffe89d  .H.8.7....BW....
│   186a00 56f0ff66 6666662e 0f1f8400 00000000  V..ffff.........
│   186a10 554889e5 488b3e48 8b7608e8 e0fdffff  UH..H.>H.v......
│   186a20 4889c7e8 2856f0ff 5dc3660f 1f440000  H...(V..].f..D..
│   186a30 554889e5 4883ec10 64488b04 25280000  UH..H...dH..%(..
│   186a40 00488945 f848833d fb4d8d01 00740948  .H.E.H.=.M...t.H
│   186a50 8b0df24d 8d01eb1f 488d3591 ac190048  ...M....H.5....H
│ -[ Too much input for diff ]                     
│ +[ Too much input for diff ]                         
╵

~~ Ricardo




Information forwarded to bug-guix@gnu.org:
bug#22304; Package guix. (Tue, 05 Jan 2016 22:31:01 GMT) (full text, mbox, link).


Message #8 received at 22304@debbugs.gnu.org (full text, mbox, reply):

From: ludo@gnu.org (Ludovic Courtès)
To: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
Cc: 22304@debbugs.gnu.org
Subject: Re: bug#22304: Build for Julia is not reproducible
Date: Tue, 05 Jan 2016 23:30:48 +0100
Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> skribis:

> When building “julia” twice we get different binaries for
>
>   $out/lib/julia/sys.so
>
> and
>
>   $out/lib/julia/sys-debug.so

Apparently there’s no __DATE__ and __TIME__ in the C code.

I would check if the order of object files on the command line that
links those shared objects is always the same.

Ludo’.




Information forwarded to bug-guix@gnu.org:
bug#22304; Package guix. (Thu, 04 Feb 2016 14:53:01 GMT) (full text, mbox, link).


Message #11 received at 22304@debbugs.gnu.org (full text, mbox, reply):

From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
To: Ludovic Courtès <ludo@gnu.org>
Cc: 22304@debbugs.gnu.org
Subject: Re: bug#22304: Build for Julia is not reproducible
Date: Thu, 4 Feb 2016 15:51:51 +0100
Ludovic Courtès <ludo@gnu.org> writes:

> Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> skribis:
>
>> When building “julia” twice we get different binaries for
>>
>>   $out/lib/julia/sys.so
>>
>> and
>>
>>   $out/lib/julia/sys-debug.so
>
> Apparently there’s no __DATE__ and __TIME__ in the C code.
>
> I would check if the order of object files on the command line that
> links those shared objects is always the same.

As far as I could tell the order of shared objects in two consecutive
runs is the same.

~~ Ricardo




Information forwarded to bug-guix@gnu.org:
bug#22304; Package guix. (Thu, 28 Nov 2019 17:15:01 GMT) (full text, mbox, link).


Message #14 received at 22304@debbugs.gnu.org (full text, mbox, reply):

From: zimoun <zimon.toutoune@gmail.com>
To: 22304@debbugs.gnu.org, Ricardo Wurmus <rekado@elephly.net>, Ludovic Courtès <ludo@gnu.org>
Subject: bug#22304: Julia not reproducible
Date: Thu, 28 Nov 2019 18:14:00 +0100
Hi,

This bug [1] is still present even with the version 1.1.1 of Julia.

[1] http://issues.guix.gnu.org/issue/22304


--8<---------------cut here---------------start------------->8---
guix describe
Generation 57   Nov 25 2019 14:26:15    (current)
  guix b5d4d5b
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: b5d4d5b9bcf267fddd02fcc14b88eac0bebf979f
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
guix build julia # populate the store with dependencies
guix build julia --check -K --no-grafts
[...]
guix build: error: derivation
`/gnu/store/xdy3jjz7dzg1lr231b8zbss8xn44ldjj-julia-1.1.1.drv' may not
be deterministic: output
`/gnu/store/s2vj70fgv4v4wq66dbi797ss15f8xd3b-julia-1.1.1' differs from
‘/gnu/store/s2vj70fgv4v4wq66dbi797ss15f8xd3b-julia-1.1.1-check’
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
diff -r /gnu/store/s2vj70fgv4v4wq66dbi797ss15f8xd3b-julia-1.1.1
/gnu/store/s2vj70fgv4v4wq66dbi797ss15f8xd3b-julia-1.1.1-check
Binary files /gnu/store/s2vj70fgv4v4wq66dbi797ss15f8xd3b-julia-1.1.1/lib/julia/sys.so
and /gnu/store/s2vj70fgv4v4wq66dbi797ss15f8xd3b-julia-1.1.1-check/lib/julia/sys.so
differ
Binary files /gnu/store/s2vj70fgv4v4wq66dbi797ss15f8xd3b-julia-1.1.1/share/julia/test/depot/compiled/v1.1/Bar/HXSAn.ji
and /gnu/store/s2vj70fgv4v4wq66dbi797ss15f8xd3b-julia-1.1.1-check/share/julia/test/depot/compiled/v1.1/Bar/HXSAn.ji
differ
Binary files /gnu/store/s2vj70fgv4v4wq66dbi797ss15f8xd3b-julia-1.1.1/share/julia/test/depot/compiled/v1.1/Baz/rONVA.ji
and /gnu/store/s2vj70fgv4v4wq66dbi797ss15f8xd3b-julia-1.1.1-check/share/julia/test/depot/compiled/v1.1/Baz/rONVA.ji
differ
Binary files /gnu/store/s2vj70fgv4v4wq66dbi797ss15f8xd3b-julia-1.1.1/share/julia/test/depot/compiled/v1.1/Foo/MYb1d.ji
and /gnu/store/s2vj70fgv4v4wq66dbi797ss15f8xd3b-julia-1.1.1-check/share/julia/test/depot/compiled/v1.1/Foo/MYb1d.ji
differ
Binary files /gnu/store/s2vj70fgv4v4wq66dbi797ss15f8xd3b-julia-1.1.1/share/julia/test/depot/compiled/v1.1/Foo/TeeT6.ji
and /gnu/store/s2vj70fgv4v4wq66dbi797ss15f8xd3b-julia-1.1.1-check/share/julia/test/depot/compiled/v1.1/Foo/TeeT6.ji
differ
Binary files /gnu/store/s2vj70fgv4v4wq66dbi797ss15f8xd3b-julia-1.1.1/share/julia/test/depot/compiled/v1.1/Qux/YFfiR.ji
and /gnu/store/s2vj70fgv4v4wq66dbi797ss15f8xd3b-julia-1.1.1-check/share/julia/test/depot/compiled/v1.1/Qux/YFfiR.ji
differ
--8<---------------cut here---------------end--------------->8---


Well, then I try to explore with diffoscope but hum? I do not do
correctly because the resulting diff is 845MB ouch!


All the best,
simon




Information forwarded to bug-guix@gnu.org:
bug#22304; Package guix. (Fri, 29 Nov 2019 16:20:01 GMT) (full text, mbox, link).


Message #17 received at 22304@debbugs.gnu.org (full text, mbox, reply):

From: Ludovic Courtès <ludo@gnu.org>
To: zimoun <zimon.toutoune@gmail.com>
Cc: Ricardo Wurmus <rekado@elephly.net>, 22304@debbugs.gnu.org
Subject: Re: bug#22304: Julia not reproducible
Date: Fri, 29 Nov 2019 17:19:46 +0100
Hi,

zimoun <zimon.toutoune@gmail.com> skribis:

> Binary files /gnu/store/s2vj70fgv4v4wq66dbi797ss15f8xd3b-julia-1.1.1/share/julia/test/depot/compiled/v1.1/Qux/YFfiR.ji
> and /gnu/store/s2vj70fgv4v4wq66dbi797ss15f8xd3b-julia-1.1.1-check/share/julia/test/depot/compiled/v1.1/Qux/YFfiR.ji
> differ
>
>
> Well, then I try to explore with diffoscope but hum? I do not do
> correctly because the resulting diff is 845MB ouch!

Pro tip: just run

  diffoscope \
  /gnu/store/s2vj70fgv4v4wq66dbi797ss15f8xd3b-julia-1.1.1{,-check}/share/julia/test/depot/compiled/v1.1/Qux/YFfiR.ji

That’ll already be enough info for a start!

Ludo’.




Information forwarded to bug-guix@gnu.org:
bug#22304; Package guix. (Mon, 02 Dec 2019 17:29:01 GMT) (full text, mbox, link).


Message #20 received at 22304@debbugs.gnu.org (full text, mbox, reply):

From: zimoun <zimon.toutoune@gmail.com>
To: Ludovic Courtès <ludo@gnu.org>
Cc: Ricardo Wurmus <rekado@elephly.net>, 22304@debbugs.gnu.org
Subject: Re: bug#22304: Julia not reproducible
Date: Mon, 2 Dec 2019 18:28:39 +0100
Hi Ludo,

On Fri, 29 Nov 2019 at 17:19, Ludovic Courtès <ludo@gnu.org> wrote:

> Pro tip: just run

I think that I have already did the pro tip. :-)

--8<---------------cut here---------------end--------------->8---
diffoscope /gnu/store/s2vj70fgv4v4wq66dbi797ss15f8xd3b-julia-1.1.1{,-check}/lib/julia/sys.so
\
   > /tmp/sys.diffoscope
du -sh /tmp/sys.diffoscope
845M    /tmp/sys.diffoscope
--8<---------------cut here---------------end--------------->8---

Maybe I am doing incorrectly...

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

[1] https://docs.julialang.org/en/v1/devdocs/sysimg/


Cheers,
simon




Information forwarded to bug-guix@gnu.org:
bug#22304; Package guix. (Fri, 24 Jan 2020 18:31:01 GMT) (full text, mbox, link).


Message #23 received at 22304@debbugs.gnu.org (full text, mbox, reply):

From: zimoun <zimon.toutoune@gmail.com>
To: Ludovic Courtès <ludo@gnu.org>
Cc: Ricardo Wurmus <rekado@elephly.net>, 22304@debbugs.gnu.org
Subject: Re: bug#22304: Julia not reproducible
Date: Fri, 24 Jan 2020 19:30:20 +0100
Hi,

On Mon, 2 Dec 2019 at 18:28, zimoun <zimon.toutoune@gmail.com> 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




Information forwarded to bug-guix@gnu.org:
bug#22304; Package guix. (Wed, 13 May 2020 18:45:03 GMT) (full text, mbox, link).


Message #26 received at 22304@debbugs.gnu.org (full text, mbox, reply):

From: zimoun <zimon.toutoune@gmail.com>
To: 22304@debbugs.gnu.org, Nicolò Balzarotti <anothersms@gmail.com>, Efraim Flashner <efraim@flashner.co.il>
Subject: Julia v1.4.1 still not reproducible
Date: Wed, 13 May 2020 20:44:32 +0200
Hi Efraim,

On Wed, 13 May 2020 at 13:04, Efraim Flashner <efraim@flashner.co.il> wrote:

> guix build: error: derivation `/gnu/store/z21c12ijspavaclcins5pja8z1s8wbm0-julia-1.4.1.drv' may not be deterministic: output `/gnu/store/ri931fk8hf5wvagk76zhmwbphq2pwgnp-julia-1.4.1' differs from ?/gnu/store/ri931fk8hf5wvagk76zhmwbphq2pwgnp-julia-1.4.1-check?
>
> I built it on bayfront twice. I'll get the diffoscope output once it
> finally builds.

Thank you.

Cheers,
simon




Information forwarded to bug-guix@gnu.org:
bug#22304; Package guix. (Sun, 17 May 2020 13:56:01 GMT) (full text, mbox, link).


Message #29 received at 22304@debbugs.gnu.org (full text, mbox, reply):

From: anothersms@gmail.com (Nicolò Balzarotti)
To: 22304@debbugs.gnu.org
Subject: [Nicolò Balzarotti] Re: Julia v1.4.1 still not reproducible
Date: Sun, 17 May 2020 15:55:22 +0200
[Message part 1 (text/plain, inline)]
Ops, I sent it to 22304@debuugs.gnu.org instead of 22304@debbugs.gnu.org

[Message part 2 (message/rfc822, inline)]
From: Nicolò Balzarotti <anothersms@gmail.com>
To: Efraim Flashner <efraim@flashner.co.il>, zimoun <zimon.toutoune@gmail.com>
Cc: 22304@debuugs.gnu.org
Subject: Re: Julia v1.4.1 still not reproducible
Date: Sun, 17 May 2020 15:51:00 +0200
[Message part 3 (text/plain, inline)]
Hi Efraim, Simon,

The attached patches provide Simon's suggested julia-deterministic
build.

With this, I get deterministic julia build, *but* only on a single
machine.  Building on a different machine I get a different output.  I
still need to investigate why.  Also, some of the patches are probably
not needed at all.  In the near future, as discussed previously, I aim
at submitting required patches upstream.

I disabled tests in julia-deterministic, so it get built quite fast
(~10minutes).  If you want to try to see if this is reproducible//know
how to figure out what might be happening on different machines,
feedback is wellcome!

My ouptut is (patches applied on 75741af9b2):
guix hash -r /gnu/store/mp8hl7j09nfnsxbb3a6ka23ww44gq0z2-julia-deterministic-1.4.1
1k6mak38nkiaj0b9l6rcmxfcjwvbijmczxs703hgawwi6z0jikxl

[0001-gnu-julia-Specify-correct-llvm-version.patch (text/x-patch, attachment)]
[0002-gnu-Add-julia-deterministic.patch (text/x-patch, attachment)]
[Message part 6 (text/plain, inline)]
Thanks, Nicolò

Efraim Flashner <efraim@flashner.co.il> writes:

> On Wed, May 13, 2020 at 08:43:08PM +0200, zimoun wrote:
>> Hi Efraim,
>> 
>> On Wed, 13 May 2020 at 13:04, Efraim Flashner <efraim@flashner.co.il> wrote:
>> 
>> > guix build: error: derivation `/gnu/store/z21c12ijspavaclcins5pja8z1s8wbm0-julia-1.4.1.drv' may not be deterministic: output `/gnu/store/ri931fk8hf5wvagk76zhmwbphq2pwgnp-julia-1.4.1' differs from ?/gnu/store/ri931fk8hf5wvagk76zhmwbphq2pwgnp-julia-1.4.1-check?
>> >
>> > I built it on bayfront twice. I'll get the diffoscope output once it
>> > finally builds.
>
> I wasn't able to provide the output of diffoscope, it turns out that the
> output was too large to attach.
>
> -- 
> Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
> GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
> Confidentiality cannot be guaranteed on emails sent or received unencrypted

Information forwarded to bug-guix@gnu.org:
bug#22304; Package guix. (Sun, 27 Jun 2021 10:41:02 GMT) (full text, mbox, link).


Message #32 received at 22304@debbugs.gnu.org (full text, mbox, reply):

From: Ludovic Courtès <ludo@gnu.org>
To: 22304@debbugs.gnu.org
Subject: Re: bug#22304: Build for Julia is not reproducible
Date: Sun, 27 Jun 2021 12:40:13 +0200
Hi!

FWIW Julia 1.5.3 is also not reproducible:

--8<---------------cut here---------------start------------->8---
$ guix challenge julia
/gnu/store/d077a9ggqlcyhnhcg4ng2ibnlarxq8zf-julia-1.5.3 contents differ:
  no local build for '/gnu/store/d077a9ggqlcyhnhcg4ng2ibnlarxq8zf-julia-1.5.3'
  https://ci.guix.gnu.org/nar/lzip/d077a9ggqlcyhnhcg4ng2ibnlarxq8zf-julia-1.5.3: 097czl5kmmdbgljqjrmamkpzsfmkkpy578i1niwm2fizxslyxws6
  https://bordeaux.guix.gnu.org/nar/lzip/d077a9ggqlcyhnhcg4ng2ibnlarxq8zf-julia-1.5.3: 047bd3qgar4c17i9xp5g564xac4vsqy5h7hzd0ss824f367idh9c
  differing files:
    /share/julia/test/depot/compiled/v1.5/Qux/YFfiR_w3IH9.ji
    /share/julia/test/depot/compiled/v1.5/Foo/TeeT6_w3IH9.ji
    /share/julia/test/depot/compiled/v1.5/Foo/MYb1d_w3IH9.ji
    /share/julia/test/depot/compiled/v1.5/Baz/rONVA_w3IH9.ji
    /share/julia/test/depot/compiled/v1.5/Bar/HXSAn_w3IH9.ji
    /share/julia/stdlib/v1.5/REPL/src/Terminals.jl.6161.mem
    /share/julia/stdlib/v1.5/REPL/src/Terminals.jl.6152.mem
    /share/julia/stdlib/v1.5/REPL/src/Terminals.jl.6143.mem
    /share/julia/stdlib/v1.5/Logging/src/ConsoleLogger.jl.6161.mem
    /share/julia/stdlib/v1.5/Logging/src/ConsoleLogger.jl.6152.mem
    /share/julia/stdlib/v1.5/Logging/src/ConsoleLogger.jl.6143.mem
    /lib/julia/sys.so

1 store items were analyzed:
  - 0 (0.0%) were identical
  - 1 (100.0%) differed
  - 0 (0.0%) were inconclusive
$ guix describe
Generacio 186	Jun 25 2021 11:36:00	(nuna)
  guix e4305e4
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: e4305e4562f1bcedf888d8a5473aad256df38e81
--8<---------------cut here---------------end--------------->8---

Ludo’.




Information forwarded to bug-guix@gnu.org:
bug#22304; Package guix. (Wed, 01 Nov 2023 09:42:01 GMT) (full text, mbox, link).


Message #35 received at 22304@debbugs.gnu.org (full text, mbox, reply):

From: Christopher Baines <mail@cbaines.net>
To: 22304@debbugs.gnu.org
Subject: Julia
Date: Wed, 01 Nov 2023 09:39:47 +0000
[Message part 1 (text/plain, inline)]
Just checking this, looks like 1.8.3 is still not reproducible, just one
file differs though:

→ guix challenge --diff=simple julia
/gnu/store/h5mgc7ar7a05f9rwrd1makhzays5wd3s-julia-1.8.3 contents differ:
  no local build for '/gnu/store/h5mgc7ar7a05f9rwrd1makhzays5wd3s-julia-1.8.3'
  https://ci.guix.gnu.org/nar/lzip/h5mgc7ar7a05f9rwrd1makhzays5wd3s-julia-1.8.3: 0jzli7ym7ihj7zhqwqp8lgwn6c38n44ld1rdn39pa7n8qp1q154r
  https://bordeaux.guix.gnu.org/nar/lzip/h5mgc7ar7a05f9rwrd1makhzays5wd3s-julia-1.8.3: 0616kaa8pbhzrkvcnj191yw1pcd4gy73rvmcr2cv6j7pfxyrzj7y
  differing file:
    /lib/julia/sys.so
[signature.asc (application/pgp-signature, inline)]

Send a report that this bug log contains spam.


debbugs.gnu.org maintainers <help-debbugs@gnu.org>. Last modified: Sun Dec 22 11:52:14 2024; Machine Name: wallace-server

GNU bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.