ERROR while compiling dune.3.6.2+shim

Hey guys, I’m on Windows trying to download OCaml and all its necessary components. While doing so, I had to download Merlin and I got this error.
I typed this in my PowerShell ran as administrator:
opam install merlin

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
▼ retrieved cppo.1.6.9  (cached)
▼ retrieved csexp.1.5.1  (cached)
▼ retrieved dune.3.6.2+shim  (cached)
✶ installed seq.base
▼ retrieved dot-merlin-reader.4.6, merlin.4.6-414, merlin-lib.4.6-414  (https://github.com/ocaml/merlin/releases/download/v4.6-414/merlin-4.6-414.tbz)
▼ retrieved ocamlfind.1.9.1  (cached)
▼ retrieved yojson.2.0.2  (https://github.com/ocaml-community/yojson/releases/download/2.0.2/yojson-2.0.2.tbz)
[ERROR] The compilation of ocamlfind.1.9.1 failed at "./configure -bindir
        C:\\Users\\djv60\\AppData\\Local\\opam\\playground\\bin -sitelib
        C:\\Users\\djv60\\AppData\\Local\\opam\\playground\\lib -mandir
        C:\\Users\\djv60\\AppData\\Local\\opam\\playground\\man -config
        C:\\Users\\djv60\\AppData\\Local\\opam\\playground\\lib/findlib.conf -no-custom".
[ERROR] The compilation of dune.3.6.2+shim failed at "ocaml boot/bootstrap.ml -j 11".

#=== ERROR while compiling ocamlfind.1.9.1 ====================================#
# context     2.2.0~alpha0~20221228 | win32/x86_64 | conf-withdkml.2 ocaml-system.4.14.0 | pinned(http://download.camlcity.org/download/findlib-1.9.1.tar.gz)
# path        C:\Users\djv60\AppData\Local\opam\playground\.opam-switch\build\ocamlfind.1.9.1
# command     C:\Users\djv60\AppData\Local\Programs\DISKUV~1\bin\WITH-D~1.EXE ./configure -bindir C:\Users\djv60\AppData\Local\opam\playground\bin -sitelib C:\Users\djv60\AppData\Local\opam\playground\lib -mandir C:\Users\djv60\AppData\Local\opam\playground\man -config C:\Users\djv60\AppData\Local\opam\playground\lib/findlib.conf -no-custom
# exit-code   1
# env-file    C:\Users\djv60\AppData\Local\opam\log\ocamlfind-10476-b7de8c.env
# output-file C:\Users\djv60\AppData\Local\opam\log\ocamlfind-10476-b7de8c.out
### output ###
# [...]
# bytes: found, installing fake library
# Configuration for dynlink written to site-lib-src/dynlink/META
# Configuration for stdlib written to site-lib-src/stdlib/META
# Configuration for unix written to site-lib-src/unix/META
# Configuration for bigarray written to site-lib-src/bigarray/META
# Configuration for compiler-libs written to site-lib-src/compiler-libs/META
# Configuration for ocamldoc written to site-lib-src/ocamldoc/META
# Configuration for threads written to site-lib-src/threads/META
# Configuration for str written to site-lib-src/str/META
# Configuration for bytes written to site-lib-src/bytes/META
# Detecting compiler arguments: (extractor built) ./configure: line 662:   985 Segmentation fault      tools/extract_args/extract_args -o src/findlib/ocaml_args.ml ocamlc ocamlcp ocamloptp ocamlmklib ocamlmktop ocamlopt ocamldep ocamldoc >> ocargs.log 2>&1
# FAILED (see the file ocargs.log for details)


#=== ERROR while compiling dune.3.6.2+shim ====================================#
# context     2.2.0~alpha0~20221228 | win32/x86_64 | conf-withdkml.2 ocaml-system.4.14.0 | pinned(https://github.com/ocaml/dune/releases/download/3.6.2/dune-3.6.2.tbz)
# path        C:\Users\djv60\AppData\Local\opam\playground\.opam-switch\build\dune.3.6.2+shim
# command     C:\Users\djv60\AppData\Local\Programs\DISKUV~1\bin\WITH-D~1.EXE ocaml boot/bootstrap.ml -j 11
# exit-code   2816
# env-file    C:\Users\djv60\AppData\Local\opam\log\dune-10476-2b0935.env
# output-file C:\Users\djv60\AppData\Local\opam\log\dune-10476-2b0935.out
### output ###
# Cannot exec



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build dune      3.6.2+shim
│ λ build ocamlfind 1.9.1
└─
┌─ The following changes have been performed (the rest was aborted)
│ ✶ install seq base
└─
# Run eval $(opam env) to update the current shell environment

The former state can be restored with:
    C:\Users\djv60\AppData\Local\Programs\DISKUV~1\bin\opam-real.exe switch import
"C:\\Users\\djv60\\AppData\\Local\\opam\\playground\\.opam-switch\\backup\\state-20230825032659.export"

You have a Segmentation fault during ./configure of ocamlfind, and a Cannot exec message. Sounds like you have anti-virus/malware/Windows Defender/etc. interfering with the installation (which isn’t surprising because autoconf does system probes like a virus would). If you have a good grasp of what services are running on your PC, temporarily turn those off and redo the installer. Otherwise, you might get past the interference by using a new preview version of the installer (ex. 2.0.2 64-bit Native Installer), but that will just be luck (and the preview version has its own known issues).

2 Likes

Thank you man you’re awesome. I actually installed it with Avast paused before posting this, but I set the pause to only 10 minutes because I thought the installation was going to be quick. But, I redid everything with Avast FULLY off, and thank God it finally worked. Thanks jbeckford. You’re awesome and thanks for your help on the github forums for OCaml DKML installer issues as well. You’re a big help to the community.

4 Likes