Skip to content

opam install utop fails: ERROR while compiling topkg.1.1.0 (MinGW x64) #3241

@blueglyph

Description

@blueglyph

I'm using opam version 2.4.1 in a Windows 10 x64 environment with MinGW 64. Before trying to install OCaml, I updated with pacman -Syu.

After installing opam and doing opam init by following the instructions on the website and fixing the paths for MSys, I launched:

opam install ocaml-lsp-server odoc ocamlformat utop

The installation of utop fails, but I'm not familiar with those scripts (it's the most obscure language installation I've ever seen):

504:~ $ opam install utop
The following actions will be performed:
=== install 11 packages
  ∗ lambda-term 3.3.2  [required by utop]
  ∗ logs        0.9.0  [required by utop]
  ∗ lwt_react   1.2.0  [required by utop]
  ∗ mew_vi      0.5.0  [required by lambda-term]
  ∗ react       1.2.2  [required by utop]
  ∗ topkg       1.1.0  [required by logs]
  ∗ utop        2.16.0
  ∗ uucp        16.0.0 [required by zed]
  ∗ uuseg       16.0.0 [required by zed]
  ∗ uutf        1.0.4  [required by zed]
  ∗ zed         3.2.3  [required by utop]

Proceed with ∗ 11 installations? [Y/n]

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫
⬇ retrieved lambda-term.3.3.2  (cached)
⬇ retrieved logs.0.9.0  (cached)
⬇ retrieved lwt_react.1.2.0  (cached)
⬇ retrieved mew_vi.0.5.0  (cached)
⬇ retrieved react.1.2.2  (cached)
⬇ retrieved topkg.1.1.0  (cached)
⬇ retrieved utop.2.16.0  (cached)
⬇ retrieved uuseg.16.0.0  (cached)
⬇ retrieved uucp.16.0.0  (cached)
⬇ retrieved uutf.1.0.4  (cached)
⬇ retrieved zed.3.2.3  (cached)
[ERROR] The compilation of topkg.1.1.0 failed at "ocaml pkg/pkg.ml build --pkg-name topkg --dev-pkg false".

#=== ERROR while compiling topkg.1.1.0 ========================================#
# context     2.4.1 | win32/x86_64 | ocaml.5.3.0 | https://opam.ocaml.org#39155538b0d7654773a68bd42b0b7dbb8eb14ad7
# path        C:\Users\xyz\AppData\Local\opam\default\.opam-switch\build\topkg.1.1.0
# command     C:\Users\xyz\AppData\Local\opam\default\bin\ocaml.exe pkg/pkg.ml build --pkg-name topkg --dev-pkg false
# exit-code   125
# env-file    C:\Users\xyz\AppData\Local\opam\log\topkg-8384-f2e4bc.env
# output-file C:\Users\xyz\AppData\Local\opam\log\topkg-8384-f2e4bc.out
### output ###
# Exception: Fl_package_base.No_such_package ("findlib", "").



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫
┌─ The following actions failed
│ λ build topkg 1.1.0
└─
╶─ No changes have been performed

By searching a little, I found that OCAMLPATH had to be set to fix that problem. I set it (in Windows) to "c:\Users\xyz\AppData\Local\opam\default\lib". Now I get a new error:

500:opam $ opam install utop
The following actions will be performed:
=== install 11 packages
  ∗ lambda-term 3.3.2  [required by utop]
  ∗ logs        0.9.0  [required by utop]
  ∗ lwt_react   1.2.0  [required by utop]
  ∗ mew_vi      0.5.0  [required by lambda-term]
  ∗ react       1.2.2  [required by utop]
  ∗ topkg       1.1.0  [required by logs]
  ∗ utop        2.16.0
  ∗ uucp        16.0.0 [required by zed]
  ∗ uuseg       16.0.0 [required by zed]
  ∗ uutf        1.0.4  [required by zed]
  ∗ zed         3.2.3  [required by utop]

Proceed with ∗ 11 installations? [Y/n]

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫
⬇ retrieved lambda-term.3.3.2  (cached)
⬇ retrieved logs.0.9.0  (cached)
⬇ retrieved lwt_react.1.2.0  (cached)
⬇ retrieved mew_vi.0.5.0  (cached)
⬇ retrieved react.1.2.2  (cached)
⬇ retrieved topkg.1.1.0  (cached)
⬇ retrieved utop.2.16.0  (cached)
⬇ retrieved uuseg.16.0.0  (cached)
⬇ retrieved uucp.16.0.0  (cached)
⬇ retrieved uutf.1.0.4  (cached)
⬇ retrieved zed.3.2.3  (cached)
[ERROR] The compilation of topkg.1.1.0 failed at "ocaml pkg/pkg.ml build --pkg-name topkg --dev-pkg false".

#=== ERROR while compiling topkg.1.1.0 ========================================#
# context     2.4.1 | win32/x86_64 | ocaml.5.3.0 | https://opam.ocaml.org#39155538b0d7654773a68bd42b0b7dbb8eb14ad7
# path        C:\Users\xyz\AppData\Local\opam\default\.opam-switch\build\topkg.1.1.0
# command     C:\Users\xyz\AppData\Local\opam\default\bin\ocaml.exe pkg/pkg.ml build --pkg-name topkg --dev-pkg false
# exit-code   1
# env-file    C:\Users\xyz\AppData\Local\opam\log\topkg-6740-ad3276.env
# output-file C:\Users\xyz\AppData\Local\opam\log\topkg-6740-ad3276.out
### output ###
# pkg.ml: [ERROR] cmd ["ocamlbuild" "-use-ocamlfind" "-classic-display" "-j" "4" "-tag" "debug"
# [...]
#      "src/topkg_publish.ml" "src/topkg_publish.mli" "src/topkg_pkg.ml"
#      "src/topkg_pkg.mli" "src/topkg_os.ml" "src/topkg_os.mli"
#      "src/topkg_opam.ml" "src/topkg_opam.mli" "src/topkg_main.ml"
#      "src/topkg_main.mli" "src/topkg_log.ml" "src/topkg_log.mli"
#      "src/topkg_ipc.ml" "src/topkg_ipc.mli" "src/topkg_install.ml"
#      "src/topkg_install.mli" "src/topkg_fpath.ml" "src/topkg_fpath.mli"
#      "src/topkg_fexts.ml" "src/topkg_fexts.mli" "src/topkg_distrib.ml"
#      "src/topkg_distrib.mli" "src/topkg_conf.ml" "src/topkg_conf.mli"
#      "src/topkg_codec.ml" "src/topkg_codec.mli" "src/topkg_cmd.ml"
#      "src/topkg_cmd.mli" "src/topkg_build.ml" "src/topkg_build.mli"
#      "src/topkg.ml" "src/topkg.cmi" "src/topkg.mli" "doc/index-topkg.mld"]: exited with 2

I'm not sure whether the OCAMLPATH should have the backslash type of path or the MSys type, so I also tried the latter ("/c/Users/..."), but it gives the same error.

Is there a simpler way to install OCaml on Windows?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions