While working on reproducible builds for openSUSE, I found that our ocaml-dune 3.12.1 package varies depending on the amount of parallelism.
Expected Behavior
Build output should be deterministic - as it still was in the previous version 3.11.1
Actual Behavior
Binaries produced by -j 1 and -j 4 vary even in length.
A diff of strings output looks thus:
camlDune_rules__Package_db__fun_2964
-camlOpamSystem__303
camlDune_engine__Action_exec__fun_5160
camlDune_engine__Action_builder0__code_begin
+camlStdune__Signal__3410
camlDune_re__Core__witness_2586
camlDune_rules__Modules__fun_4126
+camlNotty_uucp_data__16639
camlDune_rpc_impl__fun_970
[...snipped...]
one created a _boot/compiled_ml_files and the other a _boot/mods_list. Build logs also differ a lot.
Reproduction
- PR with a reproducing test:
- on openSUSE or Debian
#!/bin/sh
osc co openSUSE:Factory/ocaml-dune && cd $_ || exit 1
for N in 1 2 ; do
osc build -j $N --vm-type=kvm --noservice --no-preinstallimage --keep-pkg=RPMS.$N
unrpm RPMS.$N/ocaml-dune-*.x86_64.rpm
strings usr/bin/dune > $N.strings
done
diff -u {1,2}.strings
Specifications
- Version of
dune (output of dune --version): 3.12.1
- Version of
ocaml (output of ocamlc --version): 4.14.1
- Operating system (distribution and version): openSUSE Tumbleweed 20231213
Additional information
While working on reproducible builds for openSUSE, I found that our
ocaml-dune3.12.1 package varies depending on the amount of parallelism.Expected Behavior
Build output should be deterministic - as it still was in the previous version 3.11.1
Actual Behavior
Binaries produced by
-j 1and-j 4vary even in length.A diff of
stringsoutput looks thus:one created a
_boot/compiled_ml_filesand the other a_boot/mods_list. Build logs also differ a lot.Reproduction
Specifications
dune(output ofdune --version): 3.12.1ocaml(output ofocamlc --version): 4.14.1Additional information
dunewith the--verboseflag):https://gist.github.com/bmwiedemann/c05ab97a162d966ae40b7a39065efd6e