# MSYS2 and ocaml-lsp-server

**URL:** <https://discuss.ocaml.org/t/msys2-and-ocaml-lsp-server/17624>\
**Category:** Ecosystem\
**Tags:** windows, ocaml-lsp-server, opam\
**Created:** [December 22, 2025, 2:58am UTC](https://discuss.ocaml.org/t/msys2-and-ocaml-lsp-server/17624 "2025-12-22T02:58:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ComanderP](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/comanderp/32/5967_2.png) [@ComanderP](https://discuss.ocaml.org/u/ComanderP)\
**Post date:** [December 22, 2025, 2:58am UTC](https://discuss.ocaml.org/t/msys2-and-ocaml-lsp-server/17624/1 "2025-12-22T02:58:52Z")

</div>

Hi everyone,

I reinstalled opam on Windows to try out the MSYS2 mode (instead of the Cygwin one), and well I think it was mostly going well, until I tried to instal `ocaml-lsp-server`. Being a new fresh installation, the default installed switch is currently 5.4.0, and it worked fine for all packages I wanted to test on Windows, except for the lsp:

```auto
➜ opam install ocaml-lsp-server
The following actions will be performed:
=== remove 4 packages
⊘ base-domains base \[conflicts with ocaml\]
⊘ base-effects base \[conflicts with ocaml\]
⊘ base-nnp base \[uses base-domains\]
⊘ ocaml-compiler 5.4.0
=== downgrade 2 packages
↘ ocaml 5.4.0 to 4.14.2 \[required by ocaml-lsp-server\]
↘ ocaml-base-compiler 5.4.0 to 4.14.2 \[required by ocaml\]
=== recompile 9 packages
↻ cppo 1.8.0 \[uses ocaml\]
↻ csexp 1.5.2 \[uses ocaml\]
↻ ctypes 0.24.0 \[uses ocaml\]
↻ ctypes-foreign 0.24.0 \[uses ocaml\]
↻ dune 3.20.2 \[uses ocaml\]
↻ dune-configurator 3.20.2 \[uses ocaml\]
↻ integers 0.7.0 \[uses ocaml\]
↻ ocaml-config 3 \[uses ocaml-base-compiler\]
↻ stdlib-shims 0.3.0 \[uses ocaml\]
=== install 29 packages
∗ astring 0.8.5 \[required by ocaml-lsp-server\]
∗ base v0.16.4 \[required by ocaml-lsp-server\]
∗ base-bytes base
∗ camlp-streams 5.0.1 \[required by ocaml-lsp-server\]
∗ chrome-trace 3.20.2 \[required by ocaml-lsp-server\]
∗ dune-build-info 3.20.2 \[required by ocaml-lsp-server\]
∗ dune-rpc 3.20.2 \[required by ocaml-lsp-server\]
∗ dyn 3.20.2 \[required by ocaml-lsp-server\]
∗ fiber 3.7.0 \[required by ocaml-lsp-server\]
∗ jsonrpc 1.21.0-4.14 \[required by ocaml-lsp-server\]
∗ lsp 1.21.0-4.14 \[required by ocaml-lsp-server\]
∗ merlin-lib 4.19-414 \[required by ocaml-lsp-server\]
∗ ocaml-lsp-server 1.21.0-4.14
∗ ocamlbuild 0.16.1 \[required by astring\]
∗ ocamlc-loc 3.20.2 \[required by ocaml-lsp-server\]
∗ ocamlfind 1.9.8 \[required by astring\]
∗ ocamlformat-rpc-lib 0.28.1 \[required by ocaml-lsp-server\]
∗ ordering 3.20.2 \[required by ocaml-lsp-server\]
∗ pp 2.0.0 \[required by ocaml-lsp-server\]
∗ ppx_yojson_conv_lib v0.16.0 \[required by ocaml-lsp-server\]
∗ re 1.14.0 \[required by ocaml-lsp-server\]
∗ seq base \[required by yojson\]
∗ sexplib0 v0.16.0 \[required by base\]
∗ spawn v0.17.0 \[required by ocaml-lsp-server\]
∗ stdune 3.20.2 \[required by ocaml-lsp-server\]
∗ topkg 1.1.1 \[required by astring\]
∗ uutf 1.0.4 \[required by lsp\]
∗ xdg 3.20.2 \[required by ocaml-lsp-server\]
∗ yojson 2.2.2 \[required by ocaml-lsp-server\]

Proceed with ⊘ 4 removals, ↘ 2 downgrades, ↻ 9 recompilations and ∗ 29 installations? \[Y/n\]

```

Is someone able to make me understand why opam tries to downgrade the switch’s OCaml version back to 4.x? I thought maybe the .opam file of the package was the problem but I don’t know much about those and it seemed fine, I think. Also, this doesn’t happen if opam is configured to use Cygwin.

Anyway, thank you for your help in advance.

---

<div class="post-metadata">

**Author:** ![dra27](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/dra27/32/5294_2.png) [@dra27](https://discuss.ocaml.org/u/dra27)\
**Post date:** [December 22, 2025, 8:59am UTC](https://discuss.ocaml.org/t/msys2-and-ocaml-lsp-server/17624/2 "2025-12-22T08:59:22Z")

</div>

astring and uutf both require `ocamlfind`, and there’s no released version of that which works with OCaml 5.x on MSYS2 (see [ocaml/ocamlfind#112](https://github.com/ocaml/ocamlfind/pull/112)). However, you can work around that with:

```console
$ opam pin add -n ocamlfind git+https://github.com/dra27/ocamlfind.git#win-fixes
$ opam install ocaml-lsp-server

```

---

<div class="post-metadata">

**Author:** ![ComanderP](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/comanderp/32/5967_2.png) [@ComanderP](https://discuss.ocaml.org/u/ComanderP)\
**Post date:** [December 22, 2025, 2:20pm UTC](https://discuss.ocaml.org/t/msys2-and-ocaml-lsp-server/17624/3 "2025-12-22T14:20:02Z")

</div>

Oh, I see, thank you!

Is there any idea of when this will be merged? Just curious.

---

<div class="post-metadata">

**Author:** ![dra27](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/dra27/32/5294_2.png) [@dra27](https://discuss.ocaml.org/u/dra27)\
**Post date:** [December 22, 2025, 3:36pm UTC](https://discuss.ocaml.org/t/msys2-and-ocaml-lsp-server/17624/4 "2025-12-22T15:36:17Z")

</div>

Hopefully early next year, because there’s a follow-up update to `ocamlfind` needed for OCaml 5.5 because of the relocatable OCaml changes!
