ocaml-opam / opam-depext

Attempt to automate the installation of system packages required by OPAM packages
Other
33 stars 28 forks source link

alternatives in `depexts` field? #140

Closed c-cube closed 3 years ago

c-cube commented 3 years ago

opam 2.1 made me confront the harsh reality that conf-rust is a bit lacking (as it's now mandatory that it works well), at least on arch.

the problem is that I do have rust, but it's installed via rustup. There are several ways to install rust on arch, so I'd like to specify something like:

if rustup is installed: run `rustup toolchain add stable`
if cargo is installed: do nothing

then, check it worked by running `rustc --version` and `cargo --version`

I don't find any docs so I'm not sure if this is possible at all.

AltGr commented 3 years ago

My feeling is that this is really outside the scope of opam: "depexts" allow it to somewhat interact with the whole system, but in a limited and pre-defined way, in particular it's never expected to run package-specified commands that might affect the outside of the current switch.

The depexts feature has been designed from the start to allow manual bypassing for such cases though. The current interface may be lacking, requiring you to find your way in a series of yes/no questions, but it does allow to skip installation through the package manager, wait while you manually install the package, skip detection if required, and record the exception in order not to prompt you again about this package.

Alternatively, you may tell users of rustup to run opam install conf-rust --no-depexts (possibly through the messages: or post-messages: fields).

c-cube commented 3 years ago

I guess it'll have to suffice, thank you.

dra27 commented 3 years ago

There are two possible features in the mid-term plan which may help here, but not soon: