From 8917d66c3bf69e5027cf006239ca5477ad323913 Mon Sep 17 00:00:00 2001 From: nojebar Date: Wed, 3 May 2023 01:44:38 +0100 Subject: [PATCH 1/2] dune-rpc: use loopback address on Windows Signed-off-by: nojebar --- otherlibs/dune-rpc/private/where.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/otherlibs/dune-rpc/private/where.ml b/otherlibs/dune-rpc/private/where.ml index c34423d047b..38e994a7557 100644 --- a/otherlibs/dune-rpc/private/where.ml +++ b/otherlibs/dune-rpc/private/where.ml @@ -119,7 +119,7 @@ end) (IO : sig string -> ([ `Unix_socket | `Normal_file | `Other ], exn) result Fiber.t end) : S with type 'a fiber := 'a Fiber.t = struct let default ?(win32 = win32) ~build_dir () = - if win32 then `Ip (`Host "0.0.0.0", `Port default_port) + if win32 then `Ip (`Host (Unix.string_of_inet_addr Unix.inet_addr_loopback), `Port default_port) else `Unix (Filename.concat build_dir rpc_socket_relative_to_build_dir) let ( let** ) x f = From f917d6bdbd55b6edfe50586a28462b6b86c592e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ojeda=20B=C3=A4r?= Date: Wed, 3 May 2023 09:09:38 +0200 Subject: [PATCH 2/2] Format, CHANGES MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolás Ojeda Bär --- CHANGES.md | 2 ++ otherlibs/dune-rpc/private/where.ml | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index e1b89129748..14bbc962088 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -142,6 +142,8 @@ Unreleased - Introduce mdx stanza 0.4 requiring mdx >= 2.3.0 which updates the default list of files to include `*.mld` files (#7582, @Leonidas-from-XIV) +- Fix RPC server on Windows (used for OCaml-LSP). (#7666, @nojb) + 3.7.1 (2023-04-04) ------------------ diff --git a/otherlibs/dune-rpc/private/where.ml b/otherlibs/dune-rpc/private/where.ml index 38e994a7557..d2e4f44d3b1 100644 --- a/otherlibs/dune-rpc/private/where.ml +++ b/otherlibs/dune-rpc/private/where.ml @@ -119,7 +119,10 @@ end) (IO : sig string -> ([ `Unix_socket | `Normal_file | `Other ], exn) result Fiber.t end) : S with type 'a fiber := 'a Fiber.t = struct let default ?(win32 = win32) ~build_dir () = - if win32 then `Ip (`Host (Unix.string_of_inet_addr Unix.inet_addr_loopback), `Port default_port) + if win32 then + `Ip + ( `Host (Unix.string_of_inet_addr Unix.inet_addr_loopback) + , `Port default_port ) else `Unix (Filename.concat build_dir rpc_socket_relative_to_build_dir) let ( let** ) x f =