ocaml-multicore / multicoretests

PBT testsuite and libraries for testing multicore OCaml
https://ocaml-multicore.github.io/multicoretests/
BSD 2-Clause "Simplified" License
37 stars 16 forks source link

[dune-issue] dune fails build under trunk/5.3 on macOS #433

Closed jmid closed 6 months ago

jmid commented 8 months ago

dune.3.12.2 no longer builds under trunk/5.3 on macOS which effectively disables this CI workflow:

Install dune
  /Users/runner/hostedtoolcache/opam/2.1.5/x86_64/opam install dune
  Constructing initial basis...
  Number of 0-1 knapsack inequalities = 28
  Constructing conflict graph...
  Conflict graph has 28 + 6 = 34 vertices
  The following actions will be performed:
    ∗ install dune 3.12.2

  <><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫 
  ⬇ retrieved dune.3.12.2  (https://github.com/ocaml/dune/releases/download/3.12.2/dune-3.12.2.tbz)
  [ERROR] The compilation of dune.3.12.2 failed at "ocaml boot/bootstrap.ml -j 4".

  #=== ERROR while compiling dune.3.12.2 ========================================#
  # context     2.1.5 | macos/x86_64 | ocaml-variants.5.3.0+trunk | git+https://github.com/ocaml/opam-repository.git
  # path        ~/work/multicoretests/multicoretests/_opam/.opam-switch/build/dune.3.12.2
  # command     ~/.opam/opam-init/hooks/sandbox.sh build ocaml boot/bootstrap.ml -j 4
  # exit-code   2
  # env-file    ~/.opam/log/dune-26017-16d463.env
  # output-file ~/.opam/log/dune-26017-16d463.out
  ### output ###
  # ocamlc -output-complete-exe -w -24 -g -o .duneboot.exe -I boot -I +unix unix.cma boot/libs.ml boot/duneboot.ml
  # ./.duneboot.exe -j 4
  # cd _boot && /Users/runner/work/multicoretests/multicoretests/_opam/bin/ocamlopt.opt -c -g -I +unix -I +threads dune_digest_stubs.c
  # In file included from src/dune_digest/dune_digest_stubs.c:10:
  # In file included from /Users/runner/work/multicoretests/multicoretests/_opam/lib/ocaml/caml/md5.h:24:
  # In file included from /Users/runner/work/multicoretests/multicoretests/_opam/lib/ocaml/caml/io.h:26:
  # /Users/runner/work/multicoretests/multicoretests/_opam/lib/ocaml/caml/platform.h:79:17: error: implicit declaration of function 'atomic_load_acquire' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  #     uintnat v = atomic_load_acquire(p);
  #                 ^
  # 1 error generated.
  # 

The reason is that https://github.com/ocaml/ocaml/pull/12839 removed a macro definition for atomic_load_acquire in CAML_INTERNALS combined with dune not following the OCaml manual's instructions for using the this internal API.

The error has been reported and fixed upstream in dune in https://github.com/ocaml/dune/pull/9733.

jmid commented 7 months ago

The fix for this should be available from the next 3.14.0 release. I can see a 3.14.0~alpha1 being rolled out https://github.com/ocaml/opam-repository/pull/25220

jmid commented 6 months ago

Closing, as the latest macOS trunk run in https://github.com/ocaml-multicore/multicoretests/pull/437 installed the latest dune.3.14 which includes the fix, and hence no longer triggers the issue.