From 5dd41be4196c5cd3dfd0acb6c3fcb260e5ed2718 Mon Sep 17 00:00:00 2001 From: Kate Date: Mon, 14 Oct 2019 13:36:10 +0100 Subject: [PATCH] Only call opam depext on the packages being tested if it contains some depexts Mitigate ocaml/opam-depext#121 --- service/opam_build.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/service/opam_build.ml b/service/opam_build.ml index 39962d96..06ec093c 100644 --- a/service/opam_build.ml +++ b/service/opam_build.ml @@ -64,14 +64,14 @@ let dockerfile ~base ~info ~repo = if Analyse.Analysis.is_duniverse info then Printf.sprintf "%s %s" download_cache (build_cache repo) else download_cache in - let pkgs = get_opam_packages groups |> String.concat " " in + let pkgs = get_opam_packages groups in let open Dockerfile in comment "syntax = docker/dockerfile:experimental" @@ from (Docker.Image.hash base) @@ workdir "/src" @@ run "sudo chown opam /src" @@ pin_opam_files groups @@ - run "%s opam install %s --dry-run --deps-only -ty | awk '/-> installed/{print $3}' | xargs opam depext -iy" download_cache pkgs @@ - run "opam depext -ty %s" pkgs @@ + run "%s opam install %s --dry-run --deps-only -ty | awk '/-> installed/{print $3}' | xargs opam depext -iy" download_cache (pkgs |> String.concat " ") @@ + List.fold_left (fun acc pkg -> acc @@ run {|test "$(opam show -f depexts: %s)" = "$(printf "\n")" || opam depext -ty %s|} pkg pkg) empty pkgs @@ copy ~chown:"opam" ~src:["."] ~dst:"/src/" () @@ run "%s opam install -tv ." caches