Brzo_ocaml_be
OCaml domain best-effort helpers.
The type for ambiguous external resolutions. The module name and the list of files that could match.
val resolve_intf_deps : Brzo_b0_ocaml.Mod_resolver.t -> local_mods:B00_ocaml.Mod.Src.t B00_ocaml.Mod.Name.Map.t -> in_dir:B00_std.Fpath.t -> B00_ocaml.Mod.Name.Set.t -> (B00_std.Fpath.t list * B00_std.Fpath.t list * B00_ocaml.Mod.Name.Set.t * ambs) B00_std.Fut.t
resolve_intf_deps
is like resolve_impl_deps
but for compiling and interface.
val resolve_impl_deps : Brzo_b0_ocaml.Mod_resolver.t -> code:B00_ocaml.Conf.code -> local_mods:B00_ocaml.Mod.Src.t B00_ocaml.Mod.Name.Map.t -> in_dir:B00_std.Fpath.t ->
B00_ocaml.Mod.Name.Set.t -> (B00_std.Fpath.t list * B00_std.Fpath.t list * B00_ocaml.Mod.Name.Set.t * ambs) B00_std.Fut.t
resolve_comp_deps r ~code ~local_mods ~in_dir deps
resolve deps
for compiling an implementation to code
assuming local module local_mods
are compiled in in_dir
. This results in local_objs, ext_objs, unresolved, amb
with:
local_deps
are path to compilation objects that corresponds to local_mods
.ext_objs
are external compilatino objects as resolved by r
and its constraints.unresolved
are the elements of deps
that couldn't be resolved.amb
are the external resolutions that were ambiguous.val handle_amb_deps : Brzo_b0_ocaml.Mod_resolver.t -> B00_std.Fpath.t -> unresolved:B00_ocaml.Mod.Name.Set.t -> ambs -> unit B00_std.Fut.t
handle_amb_deps file ~unresolved ambs
continues if ambs
is empty and otherwise fails the fiber (* FIXME *) with help on how to restrict the resolver or getting unresolved dependencies. file
is the file for which amibguities were reported.
val handle_miss_user_deps : Brzo_b0_ocaml.Mod_resolver.t -> [ `Miss_deps of Brzo_b0_ocaml.Mod_resolver.dep list ] -> unit B00_std.Fut.t
handle_miss_user_deps r miss k
continues with k
if miss
is empty and otherwise fails the Fut.t with help on how to try to get the missing dependencies.
val suggest_pkgs_for_mod_name : B00_ocaml.Mod.Name.t -> pkgs:(string * string option) list ->
[ `Fuzzy_prefix_match of string list | `Prefix_match of string | `None ]
suggest_package_for_mod_name m pkgs
does basically what it says.