Skip to content

Commit 6c1d4c4

Browse files
authored
allows bapbuild to work when bap and other defaults are not present (#1419)
The default packages are still the same, but the defaults are not enforced if they are not present.
1 parent d028f7f commit 6c1d4c4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/bap_build/bap_build.ml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ module Plugin_rules = struct
1010

1111
let (/) = Pathname.concat
1212

13-
let default_packages = ["bap"; "core_kernel"; "ppx_bap"]
13+
let is_installed pkg =
14+
try ignore (Fl.package_directory pkg); true
15+
with Fl.No_such_package _ -> false
16+
17+
let default_packages = List.filter ~f:is_installed [
18+
"bap"; "core_kernel"; "ppx_bap"
19+
]
1420
let default_predicates = [
1521
]
1622

0 commit comments

Comments
 (0)