unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Julien Lepiller <julien@lepiller.eu>
To: zimoun <zimon.toutoune@gmail.com>
Cc: 43745@debbugs.gnu.org
Subject: [bug#43745] [PATCH 04/27] gnu: ocaml-migrate-parsetree: Update to 1.7.3.
Date: Tue, 13 Oct 2020 04:03:45 +0200	[thread overview]
Message-ID: <20201013040345.73b2367d@tachikoma.lepiller.eu> (raw)
In-Reply-To: <86wnzvnjig.fsf@gmail.com>

Le Tue, 13 Oct 2020 00:53:43 +0200,
zimoun <zimon.toutoune@gmail.com> a écrit :

> 
> On Thu, 01 Oct 2020 at 15:41, Julien Lepiller <julien@lepiller.eu>
> wrote:
> > * gnu/packages/ocaml.scm (ocaml-migrate-parsetree): Update to 1.7.3.
> > ---
> >  gnu/packages/ocaml.scm | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> LGTM but '--check' returns:
> 
> --8<---------------cut here---------------start------------->8---
> guix build: error: derivation
> `/gnu/store/fgkmww5s1srlh8frn1jbzz952mkn4pvi-ocaml-migrate-parsetree-1.7.3.drv'
> may not be deterministic: output
> `/gnu/store/3pb3cz6s0p37p4737gm6cj50p1vh02q8-ocaml-migrate-parsetree-1.7.3'
> differs --8<---------------cut
> here---------------end--------------->8---
> 
> Could you open a bug report when you will merge to master?
> 
> 
> All the best,
> simon

Thank you! I've been investigating this, but I don't really understand
what's happening.  So, I've created myself an environment in which I
could compile the sources of migrate-parsetree:

cd s1
/my/guix/repo/pre-inst-env guix environment -C ocaml-migrate-parsetree
dune build @install
exit

mv s1 s2
copy sources to s1 again (to prevent issues due to recorded build
paths), and build again.

This allows me to keep and compare all the intermediate build products.
From diffoscope and _build/log, I found the first differing file that
is a cmo file.  I note that the build is not in order, but arguments
are always sorted. This is expected, as dune runs with 4 cores.

Next, I've created this very simple file (one line), called test.ml:

module Ast_402 = Migrate_parsetree__Ast_402

(this is the first line of Ast_402.ml-gen, which is the file that
builds the first differing cmo.

Then, I build it using:

OCAMLC=ocamlc.opt -w @1..3@5..28@30..39@43@46..47@49..57@61..62-40
-strict-sequence -strict-formats-short-paths -keep-locs -w -49
-nopervasives -nostdlib -g -bin-annot -no-alias-deps -opaque -o a.cmo
-c -implem test.ml

using exactly the same options as dune, excluding a -I (include).  This
creates a.cmo, a.cmt and a.cmi. Then, using sha256sum, I can see if the
files differ.  Removing these files and trying again gives me always
the same result.  However, if I instead move them to b.cm{o,t,i}, the
next time I build a.cmo, there is a difference between a.cmo and b.cmo,
as well as the cmt files (but not the cmi files):

${OCAMLC}
sha256sum a.cmo
de1caa8b636e97e3e7c964ea84ea52bc532d80653afd13a5a106687886255861  a.cmo
rm a.cm*
${OCAMLC}
sha256sum a.cmo
de1caa8b636e97e3e7c964ea84ea52bc532d80653afd13a5a106687886255861  a.cmo
...
mv {a,b}.cmo; mv {a,b}.cmt; mv {a,b}.cmi
${OCAMLC}
sha256sum a.cmo
8cfd4b3d214d924f8229bd3697cc3eace58d4e20eb7cb27c27e7b670fa9809e6  a.cmo
rm a.cm*
${OCAMLC}
sha256sum a.cmo
8cfd4b3d214d924f8229bd3697cc3eace58d4e20eb7cb27c27e7b670fa9809e6  a.cmo
...


and with every additional files (c.cmo, d.cmo, ...) I get a different
hash, but as long as I keep the same files there, nothing changes.

The hash also changes if I create additional files, such as:

touch e.cmi (the cmi file seems to be the only one whose presence
changes the content of the cmo and cmt files).


So, my hypothesis is that dune is building files out of order, but lets
ocaml read the generated cmi files.  Since the build is not in order,
when it builds the same file in two different builds, the cmi are not
the same and the result is different.  Since dune will always use all
my cores, I used a trick I learned from LFS:

echo 0 > /sys/devices/system/cpu/cpu1/online
(and similar for every other core, except cpu0)

This way, I have a single-core machine and, hopefully, dune runs
sequentially. This time, --rounds=2 passed (after removing the existing
store item of course).




  reply	other threads:[~2020-10-13  2:05 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-01 13:39 [bug#43745] [PATCH] gnu: dune: Update to 2.7.1 Julien Lepiller
2020-10-01 13:41 ` [bug#43745] [PATCH 01/27] gnu: unison: Build with ocaml-4.09 Julien Lepiller
2020-10-01 13:41   ` [bug#43745] [PATCH 02/27] gnu: camlp5: Update to 7.13 Julien Lepiller
2020-10-12 22:47     ` zimoun
2020-10-01 13:41   ` [bug#43745] [PATCH 03/27] gnu: ocaml-mccs: Update to 1.1+11 Julien Lepiller
2020-10-12 22:50     ` zimoun
2020-10-01 13:41   ` [bug#43745] [PATCH 04/27] gnu: ocaml-migrate-parsetree: Update to 1.7.3 Julien Lepiller
2020-10-12 22:53     ` zimoun
2020-10-13  2:03       ` Julien Lepiller [this message]
2020-10-13 12:09         ` zimoun
2020-10-13 15:24           ` Julien Lepiller
2020-10-13 15:37             ` zimoun
2020-10-01 13:41   ` [bug#43745] [PATCH 05/27] gnu: ocaml-ppx-tools-versioned: Update to 5.4.0 Julien Lepiller
2020-10-12 22:56     ` zimoun
2020-10-01 13:41   ` [bug#43745] [PATCH 06/27] gnu: ocaml-qtest: Do not use deprecated jbuilder Julien Lepiller
2020-10-12 23:05     ` zimoun
2020-10-01 13:41   ` [bug#43745] [PATCH 07/27] gnu: ocaml-bitstring: " Julien Lepiller
2020-10-12 23:06     ` zimoun
2020-10-01 13:41   ` [bug#43745] [PATCH 08/27] gnu: ocaml-lwt-log: " Julien Lepiller
2020-10-12 23:09     ` zimoun
2020-10-01 13:41   ` [bug#43745] [PATCH 09/27] gnu: ocaml-easy-format: " Julien Lepiller
2020-10-12 23:11     ` zimoun
2020-10-01 13:41   ` [bug#43745] [PATCH 10/27] gnu: ocaml4.07-zed: " Julien Lepiller
2020-10-12 23:18     ` zimoun
2020-10-01 13:41   ` [bug#43745] [PATCH 11/27] gnu: ocaml4.07-utop: " Julien Lepiller
2020-10-12 23:20     ` zimoun
2020-10-01 13:41   ` [bug#43745] [PATCH 12/27] gnu: ocaml4.07-merlin: " Julien Lepiller
2020-10-12 23:23     ` zimoun
2020-10-01 13:41   ` [bug#43745] [PATCH 13/27] gnu: ocaml4.07-ppx-expect: " Julien Lepiller
2020-10-12 23:24     ` zimoun
2020-10-01 13:41   ` [bug#43745] [PATCH 14/27] gnu: ocaml4.07-core: " Julien Lepiller
2020-10-12 23:33     ` zimoun
2020-10-01 13:41   ` [bug#43745] [PATCH 15/27] gnu: ocaml-tyxml: " Julien Lepiller
2020-10-12 23:36     ` zimoun
2020-10-01 13:41   ` [bug#43745] [PATCH 16/27] gnu: Add ocaml-stdlib-shims Julien Lepiller
2020-10-12 23:40     ` zimoun
2020-10-01 13:41   ` [bug#43745] [PATCH 17/27] gnu: opam: Update to 2.0.7 Julien Lepiller
2020-10-12 23:43     ` zimoun
2020-10-01 13:41   ` [bug#43745] [PATCH 18/27] gnu: ocaml-base64: Update to 3.4.0 Julien Lepiller
2020-10-12 23:46     ` zimoun
2020-10-01 13:41   ` [bug#43745] [PATCH 19/27] gnu: ocaml-logs: Update to 0.7.0 Julien Lepiller
2020-10-13 11:20     ` zimoun
2020-10-01 13:41   ` [bug#43745] [PATCH 20/27] gnu: ocaml-fmt: Update to 0.8.9 Julien Lepiller
2020-10-13 11:19     ` zimoun
2020-10-01 13:41   ` [bug#43745] [PATCH 21/27] gnu: ocaml-alcotest: Update to 1.0.0 Julien Lepiller
2020-10-13 11:22     ` zimoun
2020-10-01 13:41   ` [bug#43745] [PATCH 22/27] gnu: ocaml-result: Update to 1.5 Julien Lepiller
2020-10-13 11:23     ` zimoun
2020-10-01 13:41   ` [bug#43745] [PATCH 23/27] gnu: Add ocaml-csexp Julien Lepiller
2020-10-13 11:44     ` zimoun
2020-10-01 13:41   ` [bug#43745] [PATCH 24/27] gnu: ocaml-compiler-libs: Build only with OCaml 4.07 Julien Lepiller
2020-10-13 11:27     ` zimoun
2020-10-01 13:41   ` [bug#43745] [PATCH 25/27] gnu: ocaml-jane-street-headers: " Julien Lepiller
2020-10-13 11:46     ` zimoun
2020-10-13 11:51       ` Julien Lepiller
2020-10-13 15:13         ` zimoun
2020-10-01 13:41   ` [bug#43745] [PATCH 26/27] gnu: ocaml-4.07: Ensure build with ocaml4.7-dune Julien Lepiller
2020-10-13 11:41     ` zimoun
2020-10-13 11:50       ` Julien Lepiller
2020-10-01 13:41   ` [bug#43745] [PATCH 27/27] gnu: dune: Update to 2.7.1 Julien Lepiller
2020-10-02  8:56     ` zimoun
2020-10-02 12:42       ` Julien Lepiller
2020-10-05 14:55         ` zimoun
2020-10-13 11:57     ` zimoun
2020-10-12 22:47   ` [bug#43745] [PATCH 01/27] gnu: unison: Build with ocaml-4.09 zimoun
2020-10-12 23:14     ` Julien Lepiller
2020-10-02  2:41 ` [bug#43745] [PATCH] gnu: dune: Update to 2.7.1 Brett Gilio
2020-10-15 16:04 ` bug#43745: " Julien Lepiller

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=20201013040345.73b2367d@tachikoma.lepiller.eu \
    --to=julien@lepiller.eu \
    --cc=43745@debbugs.gnu.org \
    --cc=zimon.toutoune@gmail.com \
    /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).