From d03ff110093d9ed6c802c1f741fcab4f884a81b5 Mon Sep 17 00:00:00 2001 From: ivg Date: Wed, 2 Feb 2022 11:11:31 -0500 Subject: [PATCH] allows bapbuild to work when bap and other defaults are not present The default packages are still the same, but the defaults are not enforced if they are not present. --- lib/bap_build/bap_build.ml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/bap_build/bap_build.ml b/lib/bap_build/bap_build.ml index 9b8ba0daf..de28d8b81 100644 --- a/lib/bap_build/bap_build.ml +++ b/lib/bap_build/bap_build.ml @@ -10,7 +10,13 @@ module Plugin_rules = struct let (/) = Pathname.concat - let default_packages = ["bap"; "core_kernel"; "ppx_bap"] + let is_installed pkg = + try ignore (Fl.package_directory pkg); true + with Fl.No_such_package _ -> false + + let default_packages = List.filter ~f:is_installed [ + "bap"; "core_kernel"; "ppx_bap" + ] let default_predicates = [ ]