22
33open Dockerfile_opam
44
5+ type win10_release = Distro .win10_release [@@ deriving sexp ]
6+
7+ type win10_ltsc = Distro .win10_ltsc [@@ deriving sexp ]
8+
9+ type win_all = Distro .win_all [@@ deriving sexp ]
10+
11+ type win10_lcu = Distro .win10_lcu [@@ deriving sexp ]
12+
13+ val win10_current_lcu : win10_lcu
14+
15+ type win10_revision = Distro .win10_revision [@@ deriving sexp ]
16+
517type distro = [ Distro .distro | `Macos of [ `V12 | `V13 ] ] [@@ deriving sexp ]
618(* * Supported Docker container distributions without aliases. *)
719
@@ -22,6 +34,10 @@ val opam_repository : os_family -> string
2234(* * [opam_repository os_family] returns the git URL to the default
2335 Opam repository. *)
2436
37+ val personality : os_family -> Ocaml_version .arch -> string option
38+ (* * [personality os_family arch] returns the personality associated to
39+ the architecture, if [os_family] is [`Linux]. *)
40+
2541val is_same_distro : t -> t -> bool
2642(* * [is_same_distro d1 d2] returns whether [d1] is the same distro as
2743 [d2], regardless of their respective versions. *)
@@ -39,6 +55,14 @@ val distros : t list
3955val latest_distros : t list
4056(* * Enumeration of the latest stable (ideally LTS) supported distributions. *)
4157
58+ val win10_latest_release : win10_release
59+ (* * Latest Windows 10 release. *)
60+
61+ val win10_latest_image : win10_release
62+ (* * Latest Windows 10 Docker image available. May differ from
63+ {!win10_latest_release} if the Docker repository hasn't been
64+ updated. *)
65+
4266val master_distro : t
4367(* * The distribution that is the top-level alias for the [latest] tag
4468 in the [ocaml/opam2] Docker Hub build. *)
@@ -84,6 +108,22 @@ val latest_tag_of_distro : t -> string
84108 regularly rewritten to point to any new releases of the
85109 distribution. *)
86110
111+ type win10_docker_base_image = Distro .win10_docker_base_image
112+ (* * Windows containers base images.
113+ @see <https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/container-base-images> *)
114+
115+ val win10_base_tag :
116+ ?win10_revision : win10_lcu ->
117+ win10_docker_base_image ->
118+ win_all ->
119+ string * string
120+ (* * [win10_base_tag base_image release] will return a tuple of Windows
121+ container base image and tag for which the base image of a Windows
122+ base image can be found (e.g.
123+ [mcr.microsoft.com/windows/servercore],[ltsc2022] which maps to
124+ [mcr.microsoft.com/windows/servercore:ltsc2022] on the Microsoft
125+ Container Registry). *)
126+
87127val base_distro_tag :
88128 ?win10_revision : Distro .win10_lcu ->
89129 ?arch : Ocaml_version .arch ->
@@ -96,6 +136,17 @@ val base_distro_tag :
96136 and other OCaml tool Dockerfiles. [arch] defaults to [x86_64] and can vary
97137 the base user/repository since some architecture are built elsewhere. *)
98138
139+ val win10_release_to_string : win10_release -> string
140+ (* * [win10_release_to_string update] converts a Windows 10 version name to
141+ string. *)
142+
143+ val win10_release_of_string : string -> win_all option
144+ (* * [win10_release_of_string] converts a Windows 10 version name as
145+ string to its internal representation. Ignores any KB number. *)
146+
147+ val win10_revision_to_string : win10_revision -> string
148+ val win10_revision_of_string : string -> win10_revision option
149+
99150val distro_arches : Ocaml_version .t -> t -> Ocaml_version .arch list
100151(* * [distro_arches ov t] returns the list of architectures that
101152 distribution [t] is supported on for OCaml compiler version [ov] *)
@@ -105,6 +156,14 @@ val distro_supported_on : Ocaml_version.arch -> Ocaml_version.t -> t -> bool
105156 combination of CPU [arch], compiler version [ov] is available
106157 on the distribution [distro]. *)
107158
159+ type win10_release_status = Distro .win10_release_status
160+ (* * Windows 10 release status. *)
161+
162+ val win10_release_status : win_all -> win10_release_status
163+ (* * [win10_release_status v channel] returns the Microsoft support
164+ status of the specified Windows 10 release.
165+ @see <https://en.wikipedia.org/wiki/Windows_10_version_history#Channels> *)
166+
108167val active_distros : Ocaml_version .arch -> t list
109168(* * [active_distros arch] returns the list of currently supported
110169 distributions in the opam build infrastructure. Distributions
0 commit comments