Stream: Coq Platform devs & users

Topic: opam os-family values


view this post on Zulip Michael Soegtrop (Sep 01 2020 at 10:17):

I need to create some opam conf packages, e.g. for bison, and wonder what opam's os-family values might be. I think it makes most sense to switch over the os-family, not over the os-distribution or os. Grepping through opam packages, I got this list of used os-family values: debian|suse|windows|archlinux|fedora|homebrew|macports and rarely arch|rhel|mageia|alpine|bsd|gentoo. I guess the gentoo as family is a bug (it appears only in one opam package). Would you agree that it makes most sense to switch over the os-family (maybe wit some special handling for windows/cyhwin/MinGW)?

I would appreciate if you could look at the output of opam var and tell me if you have an os-family not in the above short list+bsd and if your package managers package name for bison is not bison.

What would be the os-family for nix?

view this post on Zulip Michael Soegtrop (Sep 01 2020 at 10:53):

P.S.: I just found an interesting tool: (https://github.com/whohas/whohas) - a script which searches the package list of various distros for a package. It is a bit old and needs some adjustment of current distro versiosn but works reasonably well then.

view this post on Zulip Michael Soegtrop (Sep 01 2020 at 10:56):

And a website which serves a similar purpose: (https://pkgs.org/search/)

view this post on Zulip Théo Zimmermann (Sep 01 2020 at 12:00):

You also have https://repology.org/. It is very complete and very up-to-date.

view this post on Zulip Théo Zimmermann (Sep 01 2020 at 12:00):

What would be the os-family for nix?

Sorry I have no idea.

view this post on Zulip Karl Palmskog (Sep 01 2020 at 12:05):

this should be possible to find out by running:

opam var os-family

if opam is installed inside Nix.

view this post on Zulip Théo Zimmermann (Sep 01 2020 at 12:07):

This returns nixos.

view this post on Zulip Karl Palmskog (Sep 01 2020 at 12:15):

@Michael Soegtrop so the os-family for Nix is: nixos

view this post on Zulip Karl Palmskog (Sep 01 2020 at 12:16):

I don't think gentoo is a bug, Gentoo Linux is a Linux distribution with a very particular package system (similar to BSD ports)

view this post on Zulip Enrico Tassi (Sep 01 2020 at 12:17):

If the objective is to have depext work, then the list (of known labels) is here https://github.com/ocaml/opam/blob/6aefe95e60084e63d01b1c7c028b6b77de1f839f/src/state/opamSysInteract.ml#L84-L123

view this post on Zulip Michael Soegtrop (Sep 01 2020 at 12:42):

If the objective is to have depext work, then the list (of known labels) is here https://github.com/ocaml/opam/blob/6aefe95e60084e63d01b1c7c028b6b77de1f839f/src/state/opamSysInteract.ml#L84-L123

Thanks, most useful - indeed I thought about how to write depext conf packages without decade long trial and error or massive testing.

Just I wonder how can this be nixos when nixos is not in this list ...

view this post on Zulip Théo Zimmermann (Sep 01 2020 at 12:45):

No idea, and no idea if opam-depext really works on NixOS given how non-imperative package management is on this system.

view this post on Zulip Michael Soegtrop (Sep 01 2020 at 12:47):

You also have https://repology.org/. It is very complete and very up-to-date.

Thanks - this is indeed a vey helpful page for this purpose! Especially because it also lists which distros don't contain a certain package.

view this post on Zulip Michael Soegtrop (Sep 01 2020 at 12:50):

No idea, and no idea if opam-depext really works on NixOS given how non-imperative package management is on this system.

So should I ignore dependencies on nixos for the platform for the time being and just add documentation what is needed?

view this post on Zulip Enrico Tassi (Sep 01 2020 at 13:44):

Michael Soegtrop said:

Just I wonder how can this be nixos when nixos is not in this list ...

There is some funny code in opam to find the value of these variables, eg scraping files in /etc.. The values are just strings, but then when you try to run depext, it has to really understand which commands to run, and there is the code I pointed to. So on nixos you would get the error. Still the conf-whatever packages makes sense to me, they test if whatever is in PATH: If the nix user enables the whatever package in his (current) shell, then the opam package should install just fine, if not it should report a meaningful error.

view this post on Zulip Théo Zimmermann (Sep 01 2020 at 13:59):

Yes, don't worry about NixOS. We'll probably have a separate packaging process to have the platform there.


Last updated: Jun 03 2023 at 04:30 UTC