Skip to content

Commit

Permalink
Only call opam depext on the packages being tested if it contains som…
Browse files Browse the repository at this point in the history
…e depexts

Mitigate ocaml-opam/opam-depext#121
  • Loading branch information
kit-ty-kate committed Oct 14, 2019
1 parent f8a12ac commit 5dd41be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions service/opam_build.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5dd41be

Please sign in to comment.