From 85f8013655b27332f353745e955df28d2d8e051d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Fri, 15 Jul 2022 16:55:10 +0200 Subject: [PATCH] Run distro on arch if not supported by master distro Enables running jobs on Ubuntu riscv64 since the master distro (Debian) doesn't support them. --- lib/buildkit_syntax.ml | 3 ++- ocaml-dockerfile | 2 +- ocaml-version | 2 +- service/conf.ml | 12 +++++++++++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/buildkit_syntax.ml b/lib/buildkit_syntax.ml index 9be0229c9..6f132941c 100644 --- a/lib/buildkit_syntax.ml +++ b/lib/buildkit_syntax.ml @@ -12,5 +12,6 @@ let add arch = | `X86_64 | `I386 -> `X86_64 | `Aarch64 | `Aarch32 -> `Aarch64 | `Ppc64le -> `Ppc64le - | `S390x -> `S390x) in + | `S390x -> `S390x + | `Riscv64 -> failwith "No support for riscv64 in docker/dockerfile:experimental.") in Printf.sprintf "# syntax = docker/dockerfile:experimental@%s\n" hash diff --git a/ocaml-dockerfile b/ocaml-dockerfile index 25eb9b2df..943696bd3 160000 --- a/ocaml-dockerfile +++ b/ocaml-dockerfile @@ -1 +1 @@ -Subproject commit 25eb9b2df641783c137e8329d3cc073b427975d6 +Subproject commit 943696bd337a0d0fd93ae45e4a762f975782b646 diff --git a/ocaml-version b/ocaml-version index ffb9b0c89..ee6c14c52 160000 --- a/ocaml-version +++ b/ocaml-version @@ -1 +1 @@ -Subproject commit ffb9b0c89c020f995a6f2c988f045d202cb0357e +Subproject commit ee6c14c52e1995d69a134b23df2c1c721ea7a994 diff --git a/service/conf.ml b/service/conf.ml index fa66ef17a..83a0a9ad0 100644 --- a/service/conf.ml +++ b/service/conf.ml @@ -63,6 +63,15 @@ let pool_of_arch = function | `Aarch32 | `Aarch64 -> "linux-arm64" | `S390x -> "linux-s390x" | `Ppc64le -> "linux-ppc64" +| `Riscv64 -> "linux-riscv64" + +(* Arches supported by [distro] but unsupported by [DD.master_distro]. *) +let supplementary_arches ov master_distro distro = + if List.mem distro (List.map DD.resolve_alias DD.latest_distros) then + let master_distro_arches = DD.distro_arches ov (master_distro :> DD.t) + and distro_arches = DD.distro_arches ov (distro :> DD.t) in + List.filter (fun arch -> not (List.mem arch master_distro_arches)) distro_arches + else [] let platforms opam_version = let v ?(arch=`X86_64) label distro ocaml_version = @@ -81,7 +90,8 @@ let platforms opam_version = v label tag (OV.with_variant multicore_latest (Some "domains")) :: List.map (fun arch -> v ~arch label tag ov) (DD.distro_arches ov (distro :> DD.t)) else - [v label tag ov] + v label tag ov + :: List.map (fun arch -> v ~arch label tag ov) (supplementary_arches ov master_distro distro) in let make_release ?arch ov = let distro = DD.tag_of_distro (master_distro :> DD.t) in