How to dune install a single package from a multi-package repo (like dune itself)

In trying to manually install dune-configurator and finding it is one of many .opam files in the single dune distribution, it successfully builds with ‘dune build @install -p dune-configurator’ but
then fails to install with ‘dune install -p dune-configurator’ complaining about the lack of all the other defined packages.
one such is dune-rpc-lwt, but this wasn’t a problem for the original install of dune-configurator where lwt itself is not installed.
so there must be a way of installing individual packages from a multi-package project.
can anyone say what the incantation is?

If you are in a source repo containing multiple .opam files the following should work:

  opam install ./the-lucky-package.opam

(but perhaps I’m misunderstanding the question)

You can also dune install dune-configurator (without the -p).

> opam install ./the-lucky-package.opam

I need to not use opam for this as it insists on recompiling everything and that isn’t working.

You can also dune install dune-configurator (without the -p).

then I get:

Error: Unknown package dune-configurator!

here’s the output with -p:

Error: The following <package>.install are missing:
- _build/default/dune.install
- _build/default/dune-action-plugin.install
- _build/default/dune-glob.install
- _build/default/dune-private-libs.install
- _build/default/dune-rpc.install
- _build/default/dune-rpc-lwt.install
- _build/default/dune-site.install
- _build/default/dyn.install
- _build/default/fiber.install
- _build/default/ocamlc-loc.install
- _build/default/stdune.install
Hint: try running: dune build [-p <pkg>] @install

clearly the hint isn’t appropriate even in the dune repo itself!

those other packages can be built with @install too, except
the dune-rpc-lwt, because there is no lwt installed.
given that opam ‘did’ install dune-configurator, clearly it didn’t try to install that package and therefore has a way of selecting.

I’ve never tried it, but what if you first pin and then install ? So (in the top dir of the dune repo):

$ opam pin .
$ opam install dune-configurator


Just spitballin’ here, don’t actually know if it’d work. But I figure: the pin doesn’t install – it just makes the repo+opam files known to the local opam instance, right? then the install actually installs a single package, in the (uh) normal way (maybe?)