Library to get OS information (arch, system, distribution, release ...)

Is there any lib that I can use in order to get OS information such as (yes I know about Sys.os_type):

  • arch
  • system
  • distribution name
  • release

I found that in opam there is this module https://github.com/ocaml/opam/blob/master/src/state/opamSysPoll.mli to get all those information. Is there a way to import this module in an OCaml project using something like the opam-lib package which is out of date (https://opam.ocaml.org/packages/opam-lib/).

I think you should be able to get it from the opam-state package.

1 Like

I have a standalone osrelease package here that I’m using for some CI work, but it’s not released yet. Feel free to create an issue there with your usecase, or submit PRs.

2 Likes