Skip to content

Commit

Permalink
Run distro on arch if not supported by master distro
Browse files Browse the repository at this point in the history
Enables running jobs on Ubuntu riscv64 since the master
distro (Debian) doesn't support them.
  • Loading branch information
MisterDA committed Jul 15, 2022
1 parent 74db983 commit 85f8013
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/buildkit_syntax.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion ocaml-dockerfile
2 changes: 1 addition & 1 deletion ocaml-version
12 changes: 11 additions & 1 deletion service/conf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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
Expand Down

0 comments on commit 85f8013

Please sign in to comment.