-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Use single .merlin file even when subprojects have dune-project or dune-workspace #1869
Comments
As you said, the solution you propose feels very ad-hoc and hackish. I know it would take much longer to happen, but I feel that it would be more valuable to actually take the time to adapt Dune (and Merlin) to correctly handle your configuration needs (fixes to some of the issues you encountered like the one with copy files would benefit to a lot of users). Meanwhile, I will try to think about a less ad-hoc option. Maybe a flag to specify the list of allowed configuration readers ? |
I thought so at first. I had pushed back a bit when I was initially told my use case doesn't fit with Dune. But now I realize some deeply embedded Dune designs like the directory-centricity of Dune (rather than the target-centricity of most modern build systems) makes it borderline impossible to do a critical use case I need (distributing bytecode). The directory-centric problem is explained in https://gitlab.com/diskuv/registries/public-packages#creating-portable-cmi-files. TLDR:
I'm fine with keeping Dune as a build system for interoperability when the use case matches Dune's primary use case (creating executables, especially native executables).
I think that is okay for the medium term. Or perhaps a narrower flag to disable only the Dune configuration reader. FYI: At the moment the Dune configuration reader does not respect Dune configuration (ex. it doesn't check if a |
Summary
Merlin does not have a way to express using a single
.merlin
file at the root of a unified project. That means vendored subprojects that have their owndune-project
(ordune-workspace
) spawn their owndune ocaml-merlin
processes and consequently mess up the Merlin configuration, even though there is a single build directory. I suspect this is an issue with opam-monorepo style projects as well.Reproduction
I am converting some of my build systems (MlFront/DkCoder) to create
.merlin
files directly. As I transition I have a mix of dune-project and .merlin files. Here is the pertinent structure for one of the projects:Then when I do (PowerShell syntax):
I get a failure:
When I remove the
us/SonicScoutBackend/dune-project
I get success (no failures and many build paths):Mitigation
I can't remove the
dune-project
. But I'lltry tosubmit a PR that will be somewhat hacky since I don't know a clean way to solve this: #1870The text was updated successfully, but these errors were encountered: