ocaml/opam-repository

Failed to install `ocamlbuild` and `ocaml-lsp-server` on Windows

Closed this issue · 4 comments

Failed to install ocamlbuild and ocaml-lsp-server.

Env: Windows PowerShell / MSYS64 MINGW64

#=== ERROR while compiling ocamlbuild.0.14.2+win ==============================#
# context     2.2.0~beta3 | win32/x86_64 | ocaml.4.14.2 | git+https://github.com/dra27/opam-repository.git#windows-initial
# path        C:\Users\85397\AppData\Local\opam\default\.opam-switch\build\ocamlbuild.0.14.2+win
# command     C:\msys64\usr\bin\make.exe all
# exit-code   2
# env-file    C:\Users\85397\AppData\Local\opam\log\ocamlbuild-1716-a6f06c.env
# output-file C:\Users\85397\AppData\Local\opam\log\ocamlbuild-1716-a6f06c.out
### output ###
# [...]
# ) > src/ocamlbuild_config.ml
# make[1]: 离开目录“/c/Users/85397/AppData/Local/opam/default/.opam-switch/build/ocamlbuild.0.14.2+win”
# ocamlc.opt -w +L -w +R -w +Z -I src -I plugin-lib -I bin -I +unix -safe-string -bin-annot -strict-sequence -c src/ocamlbuild_config.ml
# File "src/ocamlbuild_config.ml", line 3, characters 16-18:
# 3 | let bindir = "C:\Users\85397\AppData\Local\opam\default\bin"
#                     ^^
# Warning 14 [illegal-backslash]: illegal backslash escape in string.
# File "src/ocamlbuild_config.ml", line 3, characters 22-26:
# 3 | let bindir = "C:\Users\85397\AppData\Local\opam\default\bin"
#                           ^^^^
# Error: Illegal backslash escape in string or character (\853): 853 is outside the range of legal characters (0-255).
# make: *** [Makefile:422:src/ocamlbuild_config.cmo] 错误 2

Ping @hhugo

Probably fixed by ocaml/ocamlbuild#329

@Seng-Jik, would you mind testing opam pin add ocamlbuild --dev ?

@Seng-Jik, would you mind testing opam pin add ocamlbuild --dev ?

Ok, After I execute this command, I installed ocamlbuild successfully, and everything is worked.