OCaml 5.4 upgrade
This should fix #1937
@kit-ty-kate looks like it requires pulling more changes than bumping the magic numbers, I will not have the time to do that until Monday unfortunately.
@xvw (@pitag-ha, @PizieDust) do you have the time/ want to have a go at this at this ? (apply all patches in branch 5.4 since commit 3e872717d3691511f4d409f5173455fde1e63ff2)
If not we will do it together on Monday :-)
Works for me now. Thanks!
That's great to hear, thanks for the feedback!
Do you think you could cut a preview release with this branch and the corresponding lsp one ? (https://github.com/voodoos/ocaml-lsp.git#504-compat)
now that ocaml 5.4.0~alpha1 has been released, yes
Done in https://github.com/ocaml/opam-repository/pull/27928 and https://github.com/ocaml/opam-repository/pull/27927 using these commands:
-
opam publish --pre-release -v 5.4.2~5.4preview https://github.com/voodoos/merlin/archive/9cd9e4870d5bca509f0f40ee8532ad206a2721a5.tar.gz -
opam publish --pre-release -v 1.22.1~5.4preview ocaml-lsp-server https://github.com/voodoos/ocaml-lsp/archive/ce8357b4e3f3af77305612640b74ede59638a16f.tar.gz
@pitag-ha @xvw The last two commits https://github.com/ocaml/merlin/pull/1938/commits/860ee2d74a634400a064da03acdd52e63d50a65a and https://github.com/ocaml/merlin/pull/1938/commits/f66042b220862f4afe4f67ae4cfd23dd7c1cbde0 are a textbook example of how to break recovery during an upgrade 😉 The fix simply reapply previous patches to the refactored part of typecore.
A good way to debug this kind of things is to print the typed tree in the tests: (in both a working and a broken version of merlin)
$ $MERLIN single dump -what typedtree <<EOF
> let mem = ListLabels.mem
> let _ = mem ~se
> EOF
Look at the diff between merlin's typecore for the stable version and merlin's typecore for the upgraded version, etc.
Print the error with $ $MERLIN single errors is also a very good way to grep your way toward the place in typecore that raised.