How to Separate Dev environment from Build

I’m currently working on a project where I want to use omd@2.0.0~alpha2 in the project and ocaml-lsp-server to develop it, however OPAM only allows one to be installed at a time due to omd<=1.3 restriction on ocaml-lsp-server.

How would ya’ll suggest configuring environments such that dune can find the ~alpha2 in order to build the project, but it doesn’t need to be installed globally such that I can still have ocaml-lsp-server installed for neovim?

I’m trying to avoid containerizing development builds, because docker on M1 is frustratingly slow… but if that’s what I need to do…

1 Like

You can just clone the omd@2.0.0 repository directly into your Dune workspace, and Dune will make use of it. No need to install it using OPAM.


1 Like

@nojb’s solution works, but to suggest an alternative: you can create a switch with your dev dependencies (including omd at this version), another switch with your tools (in particular ocaml-lsp-server) and copy the binary of ocaml-lsp-server into your dev switch’s bin directory.