From fae78391033f70ead01241fb59e8e2babcdb55b6 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 1/3] 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. --- service/conf.ml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/service/conf.ml b/service/conf.ml index 01bf7d1b..4c5aa677 100644 --- a/service/conf.ml +++ b/service/conf.ml @@ -116,6 +116,16 @@ 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 ~include_macos opam_version = let v ?(arch = `X86_64) label distro ocaml_version = { @@ -139,7 +149,11 @@ let platforms ~include_macos opam_version = :: List.map (fun arch -> v ~arch label tag ov) (DD.distro_arches ov (distro :> DD.t)) - else [ v label tag ov ] + else + 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 From 2aeb340b86e114ecfbb1739020ddfd1c71fe32cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Wed, 18 Jan 2023 18:01:09 +0100 Subject: [PATCH 2/3] Allow disabling arches --- service/conf.ml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/service/conf.ml b/service/conf.ml index 4c5aa677..b7a129ef 100644 --- a/service/conf.ml +++ b/service/conf.ml @@ -116,6 +116,8 @@ let pool_of_arch = function | `Ppc64le -> "linux-ppc64" | `Riscv64 -> "linux-riscv64" +let disabled_arches = [] + (* 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 @@ -144,16 +146,17 @@ let platforms ~include_macos opam_version = let label = DD.latest_tag_of_distro (distro :> DD.t) in let tag = DD.tag_of_distro (distro :> DD.t) in let ov = OV.(Releases.latest |> with_just_major_and_minor) in + let filter_disabled = + List.filter_map (fun arch -> + if List.mem arch disabled_arches then None + else Some (v ~arch label tag ov)) + in if distro = master_distro then v label tag (OV.with_variant ov (Some "flambda")) - :: List.map - (fun arch -> v ~arch label tag ov) - (DD.distro_arches ov (distro :> DD.t)) + :: filter_disabled (DD.distro_arches ov (distro :> DD.t)) else v label tag ov - :: List.map - (fun arch -> v ~arch label tag ov) - (supplementary_arches ov master_distro distro) + :: filter_disabled (supplementary_arches ov master_distro distro) in let make_release ?arch ov = let distro = DD.tag_of_distro (master_distro :> DD.t) in From e05c3b3b2d8dc53ae1fc53caf1c339837b4302ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Wed, 18 Jan 2023 18:02:46 +0100 Subject: [PATCH 3/3] Disable RISC-V --- service/conf.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/conf.ml b/service/conf.ml index b7a129ef..c0e3a4b9 100644 --- a/service/conf.ml +++ b/service/conf.ml @@ -116,7 +116,7 @@ let pool_of_arch = function | `Ppc64le -> "linux-ppc64" | `Riscv64 -> "linux-riscv64" -let disabled_arches = [] +let disabled_arches = [ `Riscv64 (* Unsufficient capacity in the pool *) ] (* Arches supported by [distro] but unsupported by [DD.master_distro]. *) let supplementary_arches ov master_distro distro =