From 6f20a3d93806883ba3676c034c6b4c436c7d3acd Mon Sep 17 00:00:00 2001 From: Jeremie Dimino Date: Thu, 18 May 2017 14:31:31 +0100 Subject: [PATCH] external-lib-deps now suggest an opam command --- bin/main.ml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/bin/main.ml b/bin/main.ml index 533f22bf..9ede1a02 100644 --- a/bin/main.ml +++ b/bin/main.ml @@ -490,9 +490,18 @@ let external_lib_deps = Format.eprintf "@{Error@}: The following required libraries are missing \ in the %s context:\n\ - %s@." + %s\n\ + Hint: try: opam install %s@." context_name - (format_external_libs missing); + (format_external_libs missing) + (String_map.bindings missing + |> List.filter_map ~f:(fun (name, kind) -> + match (kind : Build.lib_dep_kind) with + | Optional -> None + | Required -> Some (Findlib.root_package_name name)) + |> String_set.of_list + |> String_set.elements + |> String.concat ~sep:" "); true end end else begin