`dune tools setup` to install `:with-dev-setup` deps
Currently a user is expected to dune tools install ... for each dev tool they are using, or to wait for other tools like their editor to trigger the install. It would be good to have an easy way to install all the dev tools that a repository might declare.
One way to make this easier for users would be to read :with-dev-setup from the project and install each tool that we understand, warning if we don't. The user would write dune tools setup and if ocamlforamt or ocaml-lsp-server was included with :with-dev-setup, then we can install them also.
We currently completely ignore :with-dev-setup during solving, so it seems like a good fit to make dune tools work with it.
We talked about this in the meeting this week and on slack, and here are the highlights from my notes and what I can recall:
- The current reason we have special-cased the support for dev tools is give more flexibility to the package solver and to eliminate unneeded dependencies when rebuilding. I.e., the way we have approached dev tools makes the solver problems and build problems simpler.
- My naive view is that I don't understand why we wouldn't first provide basic support for
with-dev-setupvia an equivalent to opam's--with-dev-setupflag, and then, as an optimization, add specialized support to build tools that don't need a shared compiler in their own sovler/builder space.- Fragmenting the way to get packages via different sub (sub) commands is confusing to me as user.
- @Alizter noted that to have the kind of support we want for this kind of thing, we would need to have a way of telling whether a given dev tool requires the same compiler or not.
IIRC, our main take acway was that the current approach to this stuff has developed quite organically. While this was valuable for exploring the solution space, we agreed that the next iteration would benefit from upfront design work to figure out a coherent and principled systems for satisfying the need for developers to install tooling to help in their work.
Oh, is this actually a duplicate of https://github.com/ocaml/dune/issues/11001 ?
This has also been requested and discussed earlier in https://github.com/ocaml/dune/issues/10973 , the discussion there has some useful context.