Stream: Dune devs & users

Topic: Merlin errors on plugins with "wrong" name


view this post on Zulip Lasse Blaauwbroek (May 06 2021 at 10:04):

I´m able to compile the entire Coq codebase using dune without problems. However, it seems there are some problems with merlin not finding modules in plugins with "wrong" names. For example, in the firstorder plugin, in file instance.ml there are many errors related to modules not found. The first error is actually Unbound module Ground_plugin, which is strange, because that is not what the plugin is called. The same happens in the funind plugin, where merlin is looking for the Recdef_plugin. Other plugins, like ltac, do not have this problem. Can anyone else reproduce this?

view this post on Zulip Emilio Jesús Gallego Arias (May 06 2021 at 12:08):

Works for me, ocaml version, merlin version, dune version?

view this post on Zulip Lasse Blaauwbroek (May 07 2021 at 00:02):

opam list merlin dune ocaml --installed
# Packages matching: installed & (name-match(merlin) | name-match(dune) | name-match(ocaml))
# Name # Installed # Synopsis
dune   2.8.5       Fast, portable, and opinionated build system
merlin 4.2-411     Editor helper, provides completion, typing and source browsing in Vim and Emacs
ocaml  4.11.1      The OCaml compiler (virtual package)

view this post on Zulip Lasse Blaauwbroek (May 07 2021 at 02:53):

Mhm, I reinstalled everything in a clean switch, and now it is all working again. I guess I screwed something up in my install somewhere. Sorry for the bother.

view this post on Zulip Lasse Blaauwbroek (May 07 2021 at 04:45):

Ah, I think I know what was going on: I had old .merlin files in the repo that were never cleaned up. Since these files are still in the .gitignore, they did not appear in my git status and git clean also left them alone

view this post on Zulip Emilio Jesús Gallego Arias (May 07 2021 at 11:28):

Yes, the transition to the .merlin-less setup is a bit tricky due to dune still accepting them in case users want to override the default setup.

view this post on Zulip Matthieu Sozeau (May 17 2021 at 13:12):

Interesting, should I stop using .merlin with ocaml lsp for example?

view this post on Zulip Matthieu Sozeau (May 17 2021 at 13:12):

(only if dune is present?)

view this post on Zulip Emilio Jesús Gallego Arias (May 17 2021 at 14:15):

dune 2.8.5 will indeed not generate merlin files anymore, tho there is a compat flag somewhere

view this post on Zulip Emilio Jesús Gallego Arias (May 17 2021 at 14:15):

but if merlin files are around they are kept; problem with merlin files was that they are actually an overapproximation

view this post on Zulip Emilio Jesús Gallego Arias (May 17 2021 at 14:16):

so this is why it was replaced with a small protocol that queries the build system for the particular flags of files, tuareg + merlin mode in emacs provides a command to inspect this, it is quite useful when things don't work

view this post on Zulip Rudi Grinberg (Oct 21 2021 at 02:27):

To add to what Emilio said, ocamllsp will stop supporting .merlin files in the next version anyway.
If you're using dune, you will not notice any difference.

view this post on Zulip Théo Zimmermann (Oct 21 2021 at 06:03):

Lasse said:

Ah, I think I know what was going on: I had old .merlin files in the repo that were never cleaned up. Since these files are still in the .gitignore, they did not appear in my git status and git clean also left them alone

Probably you are not using strong enough options with git clean then. git clean xfd should have removed them.

view this post on Zulip Gaëtan Gilbert (Oct 21 2021 at 08:31):

some repos have committed merlin files


Last updated: Feb 04 2023 at 02:03 UTC