opam icon indicating copy to clipboard operation
opam copied to clipboard

opam 2.1 and virtual packages

Open kit-ty-kate opened this issue 4 years ago • 3 comments

The situation with virtual packages isn't consistent accross distributions.

  • Debian-based distributions' are supported since https://github.com/ocaml/opam/pull/4269 and provide a sometimes vital role (e.g. providing a common package name for a package with several versions or several variants)
  • For some other distribution, virtual packages are not supported: e.g. RHEL-based distributions (incl. OpenSUSE), Homebrew (see #4548), Archlinux (see https://github.com/ocaml/opam-repository/issues/18540), Alpine, …
  • Some distributions have a mixed story where their versions of that are usually simply aliases and are somewhat supported depending on the distribution. e.g. Gentoo, FreeBSD, (maybe homebrew is in this category?), …

The issue can be annoying for distributions that rely on them heavily (e.g. Fedora) and where opam 2.1 also supports the detection of available packages (see ~sys_available) in https://github.com/ocaml/opam/blob/17adc3b7670a7707a7b2ca15d8e9065f1642ee86/src/state/opamSysInteract.ml#L134

kit-ty-kate avatar Jul 21 '21 20:07 kit-ty-kate

xref https://github.com/ocaml/opam-repository/pull/19102

kit-ty-kate avatar Jul 21 '21 21:07 kit-ty-kate

Nevermind, archlinux have them too: https://github.com/ocaml/opam-repository/issues/18540 I'm going to edit the top comment

kit-ty-kate avatar Aug 15 '21 19:08 kit-ty-kate

Some distributions do not have any (as far as i know at least): e.g. alpine, …

Nevermind...... (e.g. llvm-dev)

kit-ty-kate avatar Nov 03 '21 14:11 kit-ty-kate

Following our discussion in ocaml/opam-repository#22548 : on OpenSUSE, you can use the options --provides (with --match-exact) to search for a virtual package, or simply zypper what-provides ; however this requires to actually specify a virtual package name in the query (the output still lists the "real" package), while from my understanding opam calls zypper without any package name, so as to list all available and installed packages. I'm still investigating.

ddeclerck avatar Nov 24 '22 17:11 ddeclerck