A fork of mtelver's day10 project

Fix findlib_names_of_installed_libs to extract top-level names only

Subpackage META files (e.g., base/base_internalhash_types/META) were
being returned as nested paths, which aren't valid findlib package
names. Now extracts only the first path component, since jtw opam
discovers subpackages automatically via ocamlfind.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+7 -2
+7 -2
bin/jtw_gen.ml
··· 118 118 (** Extract top-level findlib package names from installed lib file paths. 119 119 Each path is relative to lib/ (e.g., "hmap/hmap.cmi", "hmap/META"). 120 120 A findlib package is identified by the presence of a META file. 121 - Returns deduplicated, sorted list of findlib directory names containing META. *) 121 + Subpackage META files (e.g., "base/base_internalhash_types/META") are 122 + resolved to their top-level package ("base") since jtw opam discovers 123 + subpackages automatically via ocamlfind. 124 + Returns deduplicated, sorted list of top-level findlib package names. *) 122 125 let findlib_names_of_installed_libs installed_libs = 123 126 List.filter_map (fun rel_path -> 124 127 if Filename.basename rel_path = "META" then 125 - Some (Filename.dirname rel_path) 128 + match String.split_on_char '/' (Filename.dirname rel_path) with 129 + | top :: _ -> Some top 130 + | [] -> None 126 131 else None 127 132 ) installed_libs 128 133 |> List.sort_uniq String.compare