tarides / opam-monorepo

Assemble dune workspaces to build your project and its dependencies as a whole
ISC License
130 stars 27 forks source link

`opam monorepo install` command? #393

Open nojb opened 1 year ago

nojb commented 1 year ago

I played a bit with opam monorepo recently and am wondering if you considered adding a command opam monorepo install <pkg1> <pkg2> ... to install a subset of the vendored packages in a given prefix. The use-case is for monorepos where the vendored dependencies are installed before the main build and then made available to the rest of the build using OCAMLPATH.

Leonidas-from-XIV commented 1 year ago

I am not sure I understand what you mean. What kind of packages would <pkg1> <pkg2> be. Packages that are vendored and part of the lockfile? Or arbitary OPAM packages?

What do you mean with installing in this context? Installing it in the switch? Building them into _build?

nojb commented 1 year ago

I am not sure I understand what you mean. What kind of packages would <pkg1> <pkg2> be. Packages that are vendored and part of the lockfile? Or arbitary OPAM packages?

A subset of the packages that are vendored, mentioned in the lockfile.

What do you mean with installing in this context? Installing it in the switch? Building them into _build?

I mean it in the usual dune install sense which installs packages in an arbitrary prefix specified with --prefix.

Leonidas-from-XIV commented 1 year ago

Ah so basically a loop over some folders in the duniverse folder, calling dune install --prefix?

I am asking because we were indeed considering an opam-monorepo install command, but that one would take the non-vendored dependencies and install them in the switch, to make it easier to go from nothing to a working build.

nojb commented 1 year ago

Ah so basically a loop over some folders in the duniverse folder, calling dune install --prefix?

Something like that, except that today there is no easy way (as far as I can see) to build the necessary artifacts (the @install alias) using opam monorepo.