Open rgrinberg opened 11 months ago
In addition that's a UI issue: dune install
is used by many people because it's at a very prominent place in the CLI, but should actually only be used in situations where opam is not being used.
I think 3. is the best way forward; it will do what people expect and does not break anything.
One thing is the fact that when a package is composed of many sub-projects, say using dune-site
s and plug-ins, the use of dune install
is basically the only way to guarantee that everything will be installed with a simple command.
When a package has many dune-project
s, each project has its own .install
, but Opam only considers the root one. Thus, one would have to list every single subpackage which is not practical and error prone.
In Frama-C, we disable the promotion of install files and force Opam to use dune install
precisely because of this.
Sorry for the naïve question, but in what way is opam-installer
updating the switch state? I took a quick look at the source and it seems to be a light wrapper around cp
, rm
, etc, without any other side effects. What am I missing?
@nojb I think its also updating OCAMLPATH.
@nojb I think its also updating OCAMLPATH.
From a quick glance at the source, I don't see how it could have this effect. @rjbou: any insights?
@nojb There is this file:
.opam/default/.opam-switch/switch-state
which contains:
opam-version: "2.0"
installed: [
"base-bigarray.base"
"base-threads.base"
"base-unix.base"
"ocaml-options-vanilla.1"
]
I gather then from this the OCAMLPATH is created when you do opam env
. (All speculation however).
@nojb is right, I don't see how opam-installer
updates anything in the switch state. @rjbou could you clarify?
Maybe I'm confused about opam-installer
? I thought we were talking about opam install
.
$ dune install
is currently defaulting to install in the opam prefix. This is problematic because it's modifying the switch state without updating the switch state.There's a few ways to address this problem:
opam-installer
which can do the same thing.dune install
can useopam-installer
under the hood when installing to the opam switchcc @rjbou