'Unable to install OCaml on macOS Mac M1

I had installed merlin 6 months ago to be able to compile Ocaml and I had no problems. I have recently upgraded to update everything but it was impossible to make the package work.

When I try to reinstall it I get this error message (opam install -y merlin):

[coq-released] synchronised from https://coq.inria.fr/opam/released
[default] no changes from https://opam.ocaml.org
The following actions will be performed:
  ∗ install ocaml-base-compiler 4.12.0  [required by ocaml]
  ∗ install ocaml-config        2       [required by ocaml]
  ∗ install ocaml               4.12.0  [required by merlin]
  ∗ install ocamlfind           1.9.3   [required by dot-merlin-reader]
  ∗ install dune                2.9.3   [required by merlin]
  ∗ install result              1.5     [required by merlin]
  ∗ install easy-format         1.3.2   [required by yojson]
  ∗ install csexp               1.5.1   [required by merlin]
  ∗ install cppo                1.6.8   [required by yojson]
  ∗ install biniou              1.2.1   [required by yojson]
  ∗ install yojson              1.7.0   [required by merlin]
  ∗ install dot-merlin-reader   4.1     [required by merlin]
  ∗ install merlin              4.4-412
===== ∗ 13 =====

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫 
⬇ retrieved biniou.1.2.1  (cached)
⬇ retrieved csexp.1.5.1  (cached)
⬇ retrieved dot-merlin-reader.4.1  (cached)
⬇ retrieved cppo.1.6.8  (cached)
⬇ retrieved easy-format.1.3.2  (cached)
⬇ retrieved dune.2.9.3  (cached)
⬇ retrieved ocaml-base-compiler.4.12.0  (cached)
⬇ retrieved result.1.5  (cached)
⬇ retrieved ocamlfind.1.9.3  (cached)
⬇ retrieved yojson.1.7.0  (cached)
⬇ retrieved merlin.4.4-412  (cached)
[ERROR] The installation of ocaml-base-compiler failed at "make install".

#=== ERROR while installing ocaml-base-compiler.4.12.0 ========================#
# context     2.1.2 | macos/arm64 |  | https://opam.ocaml.org#71d8d30e
# path        ~/.opam/4.12.0/.opam-switch/build/ocaml-base-compiler.4.12.0
# command     ~/.opam/opam-init/hooks/sandbox.sh install make install
# exit-code   2
# env-file    ~/.opam/log/ocaml-base-compiler-11755-86d59b.env
# output-file ~/.opam/log/ocaml-base-compiler-11755-86d59b.out
### output ###
# if test -f ocamlnat ; then \
# [...]
#        "/Users/theosouchon/.opam/4.12.0/lib/ocaml"; \
#     /usr/bin/install -c -m 644 \
#        toplevel/opttopstart.cmx toplevel/opttopstart.o \
#        "/Users/theosouchon/.opam/4.12.0/lib/ocaml/compiler-libs"; \
#   fi
# cd "/Users/theosouchon/.opam/4.12.0/lib/ocaml/compiler-libs" && \
#      ranlib ocamlcommon.a ocamlbytecomp.a ocamloptcomp.a
# ranlib: error: exactly one archive should be specified
# make[2]: *** [installoptopt] Error 1
# make[1]: *** [installopt] Error 2
# make: *** [install] Error 2

If you ever have an idea to solve this problem I'm interested

Thank you very much, Theo Souchon



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source