ocaml/ocaml-lsp

Compilation fails

avysk opened this issue · 14 comments

avysk commented

I had to do the following (on FreeBSD 13.2-p4, ocaml 5.1.0, in addition to FreeBSD-specific fix in submodules/lev/lev/vendor/ev.c proposed in another issue)

--- a/ocaml-lsp-server/src/progress.ml
+++ b/ocaml-lsp-server/src/progress.ml
@@ -66,7 +66,7 @@ let build_progress t (progress : Drpc.Progress.t) =
         | Failed -> end_build t ~message:"Build failed"
         | Interrupted -> end_build t ~message:"Build interrupted"
         | Waiting -> end_build t ~message:"Waiting for changes"
-        | In_progress { complete; remaining } ->
+        | In_progress { complete; remaining; _ } ->
           let* token =
             match token with
             | Some token -> Fiber.return token

to be able to compile master branch.

avysk commented

Another issue I've mentioned is #1069

Thanks for reporting the issue. If we want to keep the compatibility with older versions of dune-rpc we might want to locally disable the warning instead.

avysk commented

Won't something along the lines of the patch below preserve compatibility?

--- a/ocaml-lsp-server/src/progress.ml
+++ b/ocaml-lsp-server/src/progress.ml
@@ -66,7 +66,9 @@ let build_progress t (progress : Drpc.Progress.t) =
         | Failed -> end_build t ~message:"Build failed"
         | Interrupted -> end_build t ~message:"Build interrupted"
         | Waiting -> end_build t ~message:"Waiting for changes"
-        | In_progress { complete; remaining } ->
+        | In_progress s ->
+          let complete = s.complete in
+          let remaining = s.remaining in
           let* token =
             match token with
             | Some token -> Fiber.return token

Yes, that's perfect! Do you want to open the PR?

avysk commented

I'll do it tomorrow. It's 7pm here, and I'm going to go away from my machines.

I'll do it tomorrow. It's 7pm here, and I'm going to go away from my machines.

Of course, there's no hurry :-)
Thank you.

#1200

Already did it. Thanks for the report.

Just a note: you're compiling dune with warnings as being fatal. That's not the behavior in release mode.

avysk commented

I just run make install in the source tree -- and it failed.

Yup. When you do that, dune assume you're developing. But in release, the --release flag would make this just a regular warning.

avysk commented

Indeed. Should it be documented?

It's standard with every dune package. And it should be documented there already. However, if you want add a note in the README I wouldn't mind.

avysk commented

I need to compile from source since I am on FreeBSD and I have to patch a submodule first. README says 'make install' and I believed.

avysk commented

To be honest, I did not even look into Makefile. I could do better.