Skip to content

Commit ca242be

Browse files
committed
odoc_driver_voodoo: fix library name issue
When packages have no dependencies, we were failing to parse the META file correctly. This led to a problem where the library name was incorrectly equated with the archive name. Fixes #1351
1 parent 76913b3 commit ca242be

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/driver/library_names.ml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,15 @@ let read_libraries_from_pkg_defs ~library_name pkg_defs =
3030
with _ -> None)
3131
in
3232

33-
let deps_str = Fl_metascanner.lookup "requires" [] pkg_defs in
34-
let deps = Astring.String.fields ~empty:false deps_str in
33+
let deps =
34+
try
35+
let deps_str = Fl_metascanner.lookup "requires" [] pkg_defs in
36+
(* The deps_str is a string of space-separated package names, e.g. "a b c" *)
37+
(* We use Astring to split the string into a list of package names *)
38+
Astring.String.fields ~empty:false deps_str
39+
with _ -> []
40+
in
41+
3542
let dir =
3643
List.find_opt (fun d -> d.Fl_metascanner.def_var = "directory") pkg_defs
3744
in

0 commit comments

Comments
 (0)