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 32d021d commit e751514
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion service/conf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ let pool_of_arch = function
| `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 =
{ arch; label; builder = Builders.local; pool = pool_of_arch arch; distro;
Expand All @@ -82,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 e751514

Please sign in to comment.