-
Notifications
You must be signed in to change notification settings - Fork 460
Open
Labels
Description
Motivation
Currently the only way to enable package management requires a change on disk. I.e., either
- creating a lock directory
- writing configurations in the
dune-workspace
However, there are cases where a user may want to enable or disable package management temporarily, from the CLI. E.g.,
- When writing packaging recipes, a user may want to ensure that package management is (or is not) used during a command invocation (for instance, see the discussion at Add doc about making brew package with dune pkg #12744 (comment)).
- When doing an exploratory build of a project that is usually managed by opam, a user may want to have dune manage its dependencies instead for exploratory purposes or for some CI process
- When working on a project that generally uses dune package by default, a user may want to use a different package system, either for exploration, in CI, or some other reason (see, e.g., Add dune pkg binary release workflow quantifyearth/container-image#7 (comment))
In such cases, it would be convenient to be able to run a dune command with package management enabled (or disabled).
Interface ideas
A possible interfaces to consider (I am not attached to any particular interface):
Via env var
DUNE_PKG=1 dune build # enabled
DUNE_PKG=0 dune build # disabled
DUNE_PKG= dune build # will run with the default behavior given the file systems
This should apply to any other relevant subcommands.
Via flag
dune build --pkg=enabled # enabled
dune build --pkg=disabled # disabled
dune build # will run with the default behavior given the file system
This should apply to any other relevant subcommands.