From 1ea06ec933ab5d6c414ccf829969b34f51e05fc2 Mon Sep 17 00:00:00 2001 From: Alpha DIALLO Date: Wed, 11 Oct 2023 14:15:09 +0200 Subject: [PATCH 1/2] Fix x32_86bit job caused by capnproto --- lib/opam_build.ml | 29 ++++++++++++++++++++++------- service/conf.ml | 1 + 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/lib/opam_build.ml b/lib/opam_build.ml index fe4e02a8..9c283f40 100644 --- a/lib/opam_build.ml +++ b/lib/opam_build.ml @@ -143,6 +143,24 @@ let install_project_deps ~opam_version ~opam_files ~selection = | `linux -> None | `freeBSD -> None in + let capnproto = + [ + run ~network ~cache + "sudo apt update && sudo apt install autoconf automake libtool -y"; + run ~network ~cache + "git clone https://github.com/moyodiallo/capnproto.git && cd capnproto \ + && git reset --hard 37032615f1948327d7def94671a4335c251581b3"; + run + "cd capnproto/c++ && autoupdate && autoreconf -i && ./configure && \ + make -j6 check && sudo make install"; + run "rm -fr capnproto"; + ] + (* TODO: Will be removed when until a new version of debian in which capnproto has this fix + * "https://github.com/capnproto/capnproto/pull/1824" or similar. + * + * related to this bug "https://github.com/mirage/capnp-rpc/issues/273" + * *) + in (* XXX: don't overwrite default config? *) let opamrc = "" in let opam_version_str = Opam_version.to_string opam_version in @@ -184,13 +202,10 @@ let install_project_deps ~opam_version ~opam_files ~selection = commit commit; ] @ pin_opam_files ~network ?work_dir groups - @ [ - env "DEPS" non_root_pkgs; - env "CI" "true"; - env "OCAMLCI" "true"; - opam_depext; - run ~network ~cache "opam install $DEPS"; - ] + @ [ env "DEPS" non_root_pkgs; env "CI" "true"; env "OCAMLCI" "true" ] + @ (if Variant.arch variant |> Ocaml_version.arch_is_32bit then capnproto + else []) + @ [ opam_depext; run ~network ~cache "opam install $DEPS" ] let spec ~base ~opam_version ~opam_files ~selection = let open Obuilder_spec in diff --git a/service/conf.ml b/service/conf.ml index aebada1e..b290cbbb 100644 --- a/service/conf.ml +++ b/service/conf.ml @@ -206,6 +206,7 @@ let platforms ~profile ~include_macos ~include_freebsd opam_version = List.rev OV.Releases.recent in List.map make_release [ latest; previous ] + @ [ make_release ~arch:`I386 OV.Releases.v4_14_1 ] (** When we have the same platform differing only in [lower_bound], for the purposes of Docker pulls, take only the platform with [lower_bound = true]. From cb26398ddabb2e596f7dab9c1e07c73f879cb831 Mon Sep 17 00:00:00 2001 From: Alpha DIALLO Date: Mon, 16 Oct 2023 16:56:17 +0200 Subject: [PATCH 2/2] Sikp building capnproto for some projects There are projects that not depend to capnproto. --- lib/opam_build.ml | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/lib/opam_build.ml b/lib/opam_build.ml index 9c283f40..eb69ef63 100644 --- a/lib/opam_build.ml +++ b/lib/opam_build.ml @@ -144,17 +144,27 @@ let install_project_deps ~opam_version ~opam_files ~selection = | `freeBSD -> None in let capnproto = - [ - run ~network ~cache - "sudo apt update && sudo apt install autoconf automake libtool -y"; - run ~network ~cache - "git clone https://github.com/moyodiallo/capnproto.git && cd capnproto \ - && git reset --hard 37032615f1948327d7def94671a4335c251581b3"; - run - "cd capnproto/c++ && autoupdate && autoreconf -i && ./configure && \ - make -j6 check && sudo make install"; - run "rm -fr capnproto"; - ] + List.find_map + (fun pkg -> + match Astring.String.cut ~sep:"." pkg with + | Some (pkg, _) when pkg = "conf-capnproto" -> + Some + [ + run ~network ~cache + "sudo apt update && sudo apt install autoconf automake \ + libtool -y"; + run ~network ~cache + "git clone https://github.com/moyodiallo/capnproto.git && cd \ + capnproto && git reset --hard \ + 37032615f1948327d7def94671a4335c251581b3"; + run + "cd capnproto/c++ && autoupdate && autoreconf -i && \ + ./configure && make -j6 && sudo make install"; + run "rm -fr capnproto"; + ] + | Some (_, _) | None -> None) + non_root_pkgs + |> Option.value ~default:[] (* TODO: Will be removed when until a new version of debian in which capnproto has this fix * "https://github.com/capnproto/capnproto/pull/1824" or similar. *