Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow running on arches unsupported by the master distro and disabling arches (RISC-V) #494

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
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
25 changes: 21 additions & 4 deletions service/conf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,18 @@ let pool_of_arch = function
| `Ppc64le -> "linux-ppc64"
| `Riscv64 -> "linux-riscv64"

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 =
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 =
{
Expand All @@ -134,12 +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))
else [ v label tag ov ]
:: filter_disabled (DD.distro_arches ov (distro :> DD.t))
else
v label tag ov
:: 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
Expand Down