Error with "opam install dune utop ocaml-lsp-server"

C:\Users\omerk>opam install dune utop ocaml-lsp-server
The following actions will be performed:
=== install 44 packages
  ✶ astring             0.8.5      [required by ocaml-lsp-server]
  ✶ base-bytes          base       [required by ocplib-endian]
  ✶ yojson              2.2.2      [required by ocaml-lsp-server]
  ✶ zed                 3.2.3      [required by utop]

Proceed with ✶ 44 installations? [y/n]

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
▼ retrieved camlp-streams.5.0.1  (cached)
▼ retrieved cppo.1.6.9  (cached)
▼ retrieved astring.0.8.5  (cached)
▼ retrieved csexp.1.5.2  (cached)
▼ retrieved lambda-term.3.3.2  (cached)
▼ retrieved fiber.3.7.0  (cached)
▼ retrieved logs.0.7.0  (cached)
▼ retrieved lwt.5.7.0  (cached)
▼ retrieved lwt_react.1.2.0  (cached)
▼ retrieved mew.0.1.0  (cached)
▼ retrieved mew_vi.0.5.0  (cached)

[ERROR] Failed to get sources of chrome-trace.3.16.0, dune.3.16.0, dune-build-info.3.16.0, dune-configurator.3.16.0,
        dune-rpc.3.16.0, dyn.3.16.0, ocamlc-loc.3.16.0, ordering.3.16.0, stdune.3.16.0, xdg.3.16.0
        ( "c:\\windows\\system32\\tar.exe xfj
        -C C:\\Users\\omerk\\AppData\\Local\\Temp\\opam-12228-c0950b" exited with code -1073741510
[ERROR] Failed to get sources of merlin-lib.4.16-501: "c:\\windows\\system32\\tar.exe xfj
        -C C:\\Users\\omerk\\AppData\\Local\\Temp\\opam-12228-e6da7f" exited with code -1073741510

<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ ▼ fetch ocaml-lsp-server 1.17.0
╶─ No changes have been performed

This seems unlikely but just in case … did you press Ctrl-C during the opam install?

That exit code -1073741510 (the lowers bits are 0xC000013A) usually means STATUS_CONTROL_C_EXIT: “{Application Exit by CTRL+C} The application terminated as a result of a CTRL+C.”

Hey, yes that is the case. Sorry for not pointing that out. I have interrupted the program because I had been waiting on it for like 2 hours already. I thought that it shouldn’t take that long. After I interrupted the program, this error showed up (after the [ERROR] user interrupt).

It’s surprising from your previous post that it’s ended up using the tar in system32 and not the Cygwin one. Can I check what your opam config report is giving (still MSYS2-based) but also the output from opam option sys-pkg-manager-cmd?

Hi again,

C:\Users\omerk>opam config report
# opam config report
# opam-version         2.2.0
# self-upgrade         no
# system               arch=x86_64 os=win32 os-distribution=msys2 os-version=10.0.19041
# solver               builtin-mccs+glpk
# install-criteria     -removed,-count[avoid-version,changed],-count[version-lag,request],-count[version-lag,changed],-count[missing-depexts,changed],-changed
# upgrade-criteria     -removed,-count[avoid-version,changed],-count[version-lag,solution],-count[missing-depexts,changed],-new
# jobs                 11
# repositories         1 (http) (default repo at ca7f74d6)
# pinned               0
# current-switch       default
# invariant            ocaml >= 4.05.0
# compiler-packages    arch-x86_64.1, conf-mingw-w64-gcc-x86_64.1, flexdll.0.43, msys2.0.1.0, msys2-mingw64.1, ocaml-base-compiler.5.1.1, ocaml-env-mingw64.1, ocaml-options-vanilla.1, system-mingw.1
# msys2:msystem        MINGW64
# msys2:carch          x86_64
# msys2:chost          x86_64-w64-mingw32
# msys2:root           /mingw64
# msys2:native-root    C:\msys64\mingw64
# msys2:package-prefix mingw-w64-x86_64
# ocaml:native         true
# ocaml:native-tools   true
# ocaml:native-dynlink true
# ocaml:stubsdir       C:\Users\omerk\AppData\Local\opam\default/lib/ocaml/stublibs;C:\Users\omerk\AppData\Local\opam\default/lib/ocaml
# ocaml:preinstalled   false
# ocaml:compiler       5.1.1

C:\Users\omerk>opam option sys-pkg-manager-cmd

Ah, I think I see what’s happened - what does where tar display?

Hi, sorry for the late reply:

C:\Users\omerk>where tar

Hmm, I’m struggling to reproduce it. I had been wondering whether it was a difference between Windows 10 and Windows 11’s tar (the one in Windows 11 has compiled-in bzip2 support, the one in Windows 10 calls out to bzip2 instead, which needs to be supplied separately). However, this seemed to be working on my Windows 10 system. What does where bzip2 give you (I’m expecting C:\msys64\usr\bin\bzip2)? It’s worth saying that it will be slow - the Dune tarball contains ~7000 files and it gets extracted several times for the different package builds (that’s something we hope to improve) - but it shouldn’t be taking 2 hours!

Ahh, I got so frustrated that I formatted my system and installed fedora with windows 10 dual boot.

I’m sorry for not having a follow up to this problem.

Thanks for all your help!