Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4184096
Create mingw and msvc images for Windows + various fixes
MisterDA Mar 15, 2021
f4ba276
Build WinGet in servercore
MisterDA Mar 16, 2021
7c9f939
Windows: add noacl to fstab
MisterDA Mar 18, 2021
f131f9c
Introduce Cygwin and Windows (Mingw, Msvc) distributions. Bug fixes.
MisterDA Mar 18, 2021
691cf37
Initial work to get the Cygwin image
MisterDA Mar 19, 2021
671543f
Set WinGet default version to v-0.2.10191-preview instead of master
MisterDA Mar 22, 2021
fbaa864
Add all Windows versions
MisterDA Mar 22, 2021
1746617
Remove latest tag on Windows distributions
MisterDA Mar 23, 2021
8309ebf
Introduce is_same_distro and simplify latest_tag_of_distro
MisterDA Mar 23, 2021
04b0ed8
Bump ocaml-version to 3.1 for Opam.V2.package
MisterDA Mar 24, 2021
008ca8a
Move all Windows versions to active tier 3
MisterDA Mar 24, 2021
37cae92
Allow fetching winget from external images
MisterDA Mar 30, 2021
0e12f2c
Git for Windows won't install on 1809
MisterDA Apr 1, 2021
c185ff9
Ensure that CygSymPathy is executed last
MisterDA Apr 1, 2021
7cf0984
Use CYGWIN=winsymlinks:native in native Windows images
MisterDA Apr 1, 2021
f449a65
CygSymPathy new home is at metastack
MisterDA Apr 1, 2021
b3e88de
Always install VS Build Tools components in a single batch
MisterDA Apr 1, 2021
b532e3f
Take a list of args for run_ocaml_env
MisterDA Apr 2, 2021
449de31
Fix Windows CMD
MisterDA Apr 2, 2021
bf80838
Install winget from release build instead of building from source
MisterDA Apr 6, 2021
2dc7a24
Force git core.longpaths
MisterDA Apr 9, 2021
8dec24d
Allow passing parameters to Cygwin's setup
MisterDA Apr 15, 2021
e47b149
Workaround GNU Linker 2.36 bug, use an older snapshot of Cygwin repo
MisterDA Apr 15, 2021
b6bca91
Disable WinGet telemetry
MisterDA Apr 16, 2021
958f2e4
Manually crunch very simple commands
MisterDA Apr 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ dev
- add `libexecinfo-dev` to Alpine dev packages as it is used
by multicore OCaml (@avsm)
- retrieve cygsympathy script from upstream master (@dra27)
- Fixes to the Windows images, smaller images, fix bugs
(@MisterDA)
- Introduce a Cygwin image, and move Windows Mingw and Windows Msvc at
the distro level. (@MisterDA)

v7.1.0 2021-02-25 Cambridge
---------------------------
Expand Down Expand Up @@ -59,7 +63,7 @@ v6.5.0 2020-06-29 Lockdown At Home

- Add Fedora 32, Alpine 3.12 to the known distros (@avsm)
- Move Fedora 30 to deprecated, and Alpine 3.11 to Tier 2 (@avsm)
- Add i386 architecture build support (@avsm).
- Add i386 architecture build support (@avsm).
- Add a [Dockerfile.from ?platform] argument to specify multiarch
image sources (@avsm)
- Add [Dockerfile.shell] to specify a custom shell to subsequent
Expand Down Expand Up @@ -115,7 +119,7 @@ v6.1.0 2019-02-06 Cambridge
- Demote some releases to Tier 2 from Tier 1.
- Add functions to calculate base distro tags in `Dockerfile_distro`.
- Install bzip2 and rsync on OpenSUSE distros.
- Add a `Dockerfile_opam.deprecated` container for being able to turn off older distros.
- Add a `Dockerfile_opam.deprecated` container for being able to turn off older distros.
- Install `which` into OpenSUSE containers by default.
- Use `+trunk` suffix for dev versions of compiler.
- Remove unused GNU Parallel wrapper in `dockerfile_cmd`.
Expand Down Expand Up @@ -157,7 +161,7 @@ v5.0.0 2018-06-07 Cambridge
- Add concept of a "Tier 1" and "Tier 2" distro so that we can
categorise them more easily for container generation.
- Add support for Alpine 3.7 and Ubuntu 18.04 and Fedora 28.
- Update Ubuntu LTS to 18.04.
- Update Ubuntu LTS to 18.04.
- Deprecate Ubuntu 17.10 and 12.04 (now end-of-life).
- Alter the individual compiler containers to omit the patch version
from the name. They will always have the latest patch version for CI.
Expand Down Expand Up @@ -299,7 +303,7 @@ v1.7.0
install `redhat-rpm-config` which is needed for pthreads.
* Add an `extra` arg the Dockerfile_distro matrix targets to
add more distros to the mix, such as Raspbian.
* Support multiple OPAM versions in the matrix generation,
* Support multiple OPAM versions in the matrix generation,
to make testing OPAM master easier.
* Always do an `rpm --rebuilddb` before a Yum invocation to
deal with possible OverlayFS brokenness.
Expand Down Expand Up @@ -398,4 +402,3 @@ v1.0.0 2014-12-30 Cambridge
---------------------------

* Initial public release.

2 changes: 1 addition & 1 deletion dockerfile-opam.opam
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ depends: [
"ocaml" {>= "4.02.3"}
"dune" {>= "2.0.0"}
"dockerfile" {= version}
"ocaml-version" {>= "1.0.0"}
"ocaml-version" {>= "3.1"}
"cmdliner"
"astring"
"ppx_sexp_conv" {>= "v0.9.0"}
Expand Down
111 changes: 79 additions & 32 deletions src-opam/dockerfile_distro.ml
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,28 @@ type t = [
| `OracleLinux of [ `V7 | `V8 | `Latest ]
| `OpenSUSE of [ `V42_1 | `V42_2 | `V42_3 | `V15_0 | `V15_1 | `V15_2 | `Latest ]
| `Ubuntu of [ `V12_04 | `V14_04 | `V15_04 | `V15_10 | `V16_04 | `V16_10 | `V17_04 | `V17_10 | `V18_04 | `V18_10 | `V19_04 | `V19_10 | `V20_04 | `V20_10 | `LTS | `Latest ]
| `Windows of [ `V20H2 | `Latest ]
| `Cygwin of [ `V20H2 ]
| `Windows of [`Mingw | `Msvc] * [ `V1809 | `V1903 | `V1909 | `V2004 | `V20H2 ]
] [@@deriving sexp]

type os_family = [ `Linux | `Windows ] [@@deriving sexp]
type os_family = [ `Cygwin | `Linux | `Windows ] [@@deriving sexp]

let os_family_of_distro (t:t) : os_family =
match t with
| `Alpine _ | `Archlinux _ | `CentOS _ | `Debian _ | `Fedora _
| `OracleLinux _ | `OpenSUSE _ | `Ubuntu _ -> `Linux
| `Cygwin _ -> `Cygwin
| `Windows _ -> `Windows

let os_family_to_string (os:os_family) =
match os with
| `Linux -> "linux"
| `Windows -> "windows"
| `Cygwin -> "cygwin"

let opam_repository (os:os_family) =
match os with
| `Linux -> "git://github.com/ocaml/opam-repository.git"
| `Cygwin | `Linux -> "git://github.com/ocaml/opam-repository.git"
| `Windows -> "git://github.com/fdopen/opam-repository-mingw.git#opam2"

let personality os_family arch =
Expand All @@ -71,7 +74,9 @@ let distros = [
`Ubuntu `V12_04; `Ubuntu `V14_04; `Ubuntu `V15_04; `Ubuntu `V15_10;
`Ubuntu `V16_04; `Ubuntu `V16_10; `Ubuntu `V17_04; `Ubuntu `V17_10; `Ubuntu `V18_04; `Ubuntu `V18_10; `Ubuntu `V19_04; `Ubuntu `V19_10; `Ubuntu `V20_04; `Ubuntu `V20_10;
`Ubuntu `Latest; `Ubuntu `LTS;
`Windows `V20H2; `Windows `Latest;
`Cygwin `V20H2;
`Windows (`Mingw, `V1809); `Windows (`Mingw, `V1903); `Windows (`Mingw, `V1909); `Windows (`Mingw, `V2004); `Windows (`Mingw, `V20H2);
`Windows (`Msvc, `V1809); `Windows (`Msvc, `V1903); `Windows (`Msvc, `V1909); `Windows (`Msvc, `V2004); `Windows (`Msvc, `V20H2);
]

let distro_status (d:t) : status = match d with
Expand Down Expand Up @@ -104,13 +109,14 @@ let distro_status (d:t) : status = match d with
| `Ubuntu ( `V12_04 | `V14_04 | `V15_04 | `V15_10 | `V16_10 | `V17_04 | `V17_10 | `V18_10 | `V19_04 | `V19_10 ) -> `Deprecated
| `Ubuntu `LTS -> `Alias (`Ubuntu `V20_04)
| `Ubuntu `Latest -> `Alias (`Ubuntu `V20_10)
| `Windows `V20H2 -> `Active `Tier3
| `Windows `Latest -> `Alias (`Windows `V20H2)
| `Cygwin `V20H2 -> `Active `Tier3
| `Windows (_, _) -> `Active `Tier3

let latest_distros =
[ `Alpine `Latest; `Archlinux `Latest; `CentOS `Latest;
`Debian `Stable; `OracleLinux `Latest; `OpenSUSE `Latest;
`Fedora `Latest; `Ubuntu `Latest; `Ubuntu `LTS; `Windows `Latest; ]
`Fedora `Latest; `Ubuntu `Latest; `Ubuntu `LTS;
`Cygwin `V20H2; `Windows (`Mingw, `V20H2); `Windows (`Msvc, `V20H2)]

let master_distro = `Debian `Stable

Expand Down Expand Up @@ -207,11 +213,11 @@ let builtin_ocaml_of_distro (d:t) : string option =
|`OpenSUSE `V15_2 -> Some "4.05.0"
|`OracleLinux `V7 -> Some "4.01.0"
|`OracleLinux `V8 -> Some "4.07.0"
|`Windows `V20H2 -> Some "4.11.1"
|`Cygwin `V20H2 -> Some "4.10.0"
|`Windows _ -> None
|`Alpine `Latest |`CentOS `Latest |`OracleLinux `Latest
|`OpenSUSE `Latest |`Ubuntu `LTS | `Ubuntu `Latest
|`Debian (`Testing | `Unstable | `Stable) |`Fedora `Latest
|`Windows `Latest -> assert false
|`Debian (`Testing | `Unstable | `Stable) |`Fedora `Latest -> assert false

(* The Docker tag for this distro *)
let tag_of_distro (d:t) = match d with
Expand Down Expand Up @@ -279,8 +285,17 @@ let tag_of_distro (d:t) = match d with
|`OpenSUSE `V15_1 -> "opensuse-15.1"
|`OpenSUSE `V15_2 -> "opensuse-15.2"
|`OpenSUSE `Latest -> "opensuse"
|`Windows `V20H2 -> "windows-20H2"
|`Windows `Latest -> "windows"
|`Cygwin `V20H2 -> "cygwin-20H2"
|`Windows (`Mingw, `V1809) -> "windows-mingw-1809"
|`Windows (`Mingw, `V1903) -> "windows-mingw-1903"
|`Windows (`Mingw, `V1909) -> "windows-mingw-1909"
|`Windows (`Mingw, `V2004) -> "windows-mingw-2004"
|`Windows (`Mingw, `V20H2) -> "windows-mingw-20H2"
|`Windows (`Msvc, `V1809) -> "windows-msvc-1809"
|`Windows (`Msvc, `V1903) -> "windows-msvc-1903"
|`Windows (`Msvc, `V1909) -> "windows-msvc-1909"
|`Windows (`Msvc, `V2004) -> "windows-msvc-2004"
|`Windows (`Msvc, `V20H2) -> "windows-msvc-20H2"

let distro_of_tag x : t option = match x with
|"ubuntu-12.04" -> Some (`Ubuntu `V12_04)
Expand Down Expand Up @@ -346,8 +361,17 @@ let distro_of_tag x : t option = match x with
|"opensuse-15.1" -> Some (`OpenSUSE `V15_1)
|"opensuse-15.2" -> Some (`OpenSUSE `V15_2)
|"opensuse" -> Some (`OpenSUSE `Latest)
|"windows-20H2" -> Some (`Windows `V20H2)
|"windows" -> Some (`Windows `Latest)
|"cygwin-20H2" -> Some (`Cygwin `V20H2)
|"windows-mingw-1809" -> Some (`Windows (`Mingw, `V1809))
|"windows-mingw-1903" -> Some (`Windows (`Mingw, `V1903))
|"windows-mingw-1909" -> Some (`Windows (`Mingw, `V1909))
|"windows-mingw-2004" -> Some (`Windows (`Mingw, `V2004))
|"windows-mingw-20H2" -> Some (`Windows (`Mingw, `V20H2))
|"windows-msvc-1809" -> Some (`Windows (`Msvc, `V1809))
|"windows-msvc-1903" -> Some (`Windows (`Msvc, `V1903))
|"windows-msvc-1909" -> Some (`Windows (`Msvc, `V1909))
|"windows-msvc-2004" -> Some (`Windows (`Msvc, `V2004))
|"windows-msvc-20H2" -> Some (`Windows (`Msvc, `V20H2))
|_ -> None

let rec human_readable_string_of_distro (d:t) =
Expand Down Expand Up @@ -410,9 +434,19 @@ let rec human_readable_string_of_distro (d:t) =
|`OpenSUSE `V15_0 -> "OpenSUSE 15.0 (Leap)"
|`OpenSUSE `V15_1 -> "OpenSUSE 15.1 (Leap)"
|`OpenSUSE `V15_2 -> "OpenSUSE 15.2 (Leap)"
|`Windows `V20H2 -> "Windows 20H2"
|`Cygwin `V20H2 -> "Cygwin 20H2"
|`Windows (`Mingw, `V1809) -> "Windows mingw 1809"
|`Windows (`Mingw, `V1903) -> "Windows mingw 1903"
|`Windows (`Mingw, `V1909) -> "Windows mingw 1909"
|`Windows (`Mingw, `V2004) -> "Windows mingw 2004"
|`Windows (`Mingw, `V20H2) -> "Windows mingw 20H2"
|`Windows (`Msvc, `V1809) -> "Windows mingw 1809"
|`Windows (`Msvc, `V1903) -> "Windows mingw 1903"
|`Windows (`Msvc, `V1909) -> "Windows mingw 1909"
|`Windows (`Msvc, `V2004) -> "Windows mingw 2004"
|`Windows (`Msvc, `V20H2) -> "Windows mingw 20H2"
|`Alpine `Latest | `Ubuntu `Latest | `Ubuntu `LTS | `CentOS `Latest | `Fedora `Latest
|`OracleLinux `Latest | `OpenSUSE `Latest |`Windows `Latest -> alias ()
|`OracleLinux `Latest | `OpenSUSE `Latest -> alias ()

let human_readable_short_string_of_distro (t:t) =
match t with
Expand All @@ -424,22 +458,25 @@ let human_readable_short_string_of_distro (t:t) =
|`Alpine _ -> "Alpine"
|`Archlinux _ -> "Archlinux"
|`OpenSUSE _ -> "OpenSUSE"
|`Windows _ -> "Windows"
|`Cygwin _ -> "Cygwin"
|`Windows (`Mingw, _) -> "Windows mingw"
|`Windows (`Msvc, _) -> "Windows mvsc"

let is_same_distro (d1:t) (d2:t) =
match d1, d2 with
| `Ubuntu _, `Ubuntu _ | `Debian _, `Debian _ | `CentOS _, `CentOS _
| `Fedora _, `Fedora _ | `OracleLinux _, `OracleLinux _
| `Alpine _, `Alpine _ | `Archlinux _, `Archlinux _
| `OpenSUSE _, `OpenSUSE _ | `Cygwin _, `Cygwin _ -> true
| `Windows (p1, _), `Windows (p2, _) when p1 = p2 -> true
| _ -> false

(* The alias tag for the latest stable version of this distro *)
let latest_tag_of_distro (t:t) =
match t with
|`Ubuntu _ -> "ubuntu"
|`Debian _ -> "debian"
|`CentOS _ -> "centos"
|`Fedora _ -> "fedora"
|`OracleLinux _ -> "oraclelinux"
|`Alpine _ -> "alpine"
|`Archlinux _ -> "archlinux"
|`OpenSUSE _ -> "opensuse"
|`Windows _ -> "windows"

type package_manager = [ `Apt | `Yum | `Apk | `Zypper | `Pacman | `Cygwin ] [@@deriving sexp]
let latest = List.find (is_same_distro t) latest_distros in
tag_of_distro latest

type package_manager = [ `Apt | `Yum | `Apk | `Zypper | `Pacman | `Cygwin | `Windows ] [@@deriving sexp]

let package_manager (t:t) =
match t with
Expand All @@ -451,7 +488,8 @@ let package_manager (t:t) =
|`Alpine _ -> `Apk
|`Archlinux _ -> `Pacman
|`OpenSUSE _ -> `Zypper
|`Windows _ -> `Cygwin
|`Cygwin _ -> `Cygwin
|`Windows _ -> `Windows

let base_distro_tag ?(arch=`X86_64) d =
match resolve_alias d with
Expand Down Expand Up @@ -554,11 +592,20 @@ let base_distro_tag ?(arch=`X86_64) d =
| `Latest -> assert false
in
"opensuse/leap", tag
| `Windows v ->
| `Cygwin v ->
let tag =
match v with
| `V20H2 -> "20H2"
in
"mcr.microsoft.com/windows/servercore", tag
| `Windows (_, v) ->
let tag =
match v with
| `V1809 -> "1809"
| `V1903 -> "1903"
| `V1909 -> "1909"
| `V2004 -> "2004"
| `V20H2 -> "20H2"
| `Latest -> assert false
in
"mcr.microsoft.com/windows", tag

Expand Down
12 changes: 9 additions & 3 deletions src-opam/dockerfile_distro.mli
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ type t = [
| `OracleLinux of [ `V7 | `V8 | `Latest ]
| `OpenSUSE of [ `V42_1 | `V42_2 | `V42_3 | `V15_0 | `V15_1 | `V15_2 | `Latest ]
| `Ubuntu of [ `V12_04 | `V14_04 | `V15_04 | `V15_10 | `V16_04 | `V16_10 | `V17_04 | `V17_10 | `V18_04 | `V18_10 | `V19_04 | `V19_10 | `V20_04 | `V20_10 | `LTS | `Latest ]
| `Windows of [ `V20H2 | `Latest ]
| `Cygwin of [ `V20H2 ]
| `Windows of [`Mingw | `Msvc] * [ `V1809 | `V1903 | `V1909 | `V2004 | `V20H2 ]
] [@@deriving sexp]
(** Supported Docker container distributions *)

type os_family = [ `Linux | `Windows ] [@@deriving sexp]
(** Supported Docker container operating systems *)
type os_family = [ `Cygwin | `Linux | `Windows ] [@@deriving sexp]
(** The operating system family a distro belongs to. *)

val os_family_of_distro : t -> os_family
(** [os_family_of_distro t] returns the OS family of the distro. *)
Expand All @@ -53,6 +54,10 @@ val personality : os_family -> Ocaml_version.arch -> string option
(** [personality os_family arch] returns the personality associated to
the architecture, if [os_family] is [`Linux]. *)

val is_same_distro : t -> t -> bool
(** [is_same_distro d1 d2] returns whether [d1] is the same distro as
[d2], regardless of their respective versions. *)

val compare : t -> t -> int
(** [compare a b] is a lexical comparison function for {!t}. *)

Expand Down Expand Up @@ -90,6 +95,7 @@ type package_manager = [
| `Zypper (** OpenSUSE Zypper *)
| `Pacman (** Archlinux Pacman *)
| `Cygwin (** Cygwin package manager *)
| `Windows (** Native Windows, WinGet, Cygwin *)
] [@@deriving sexp]
(** The package manager used by a distro. *)

Expand Down
Loading