let load_plugins plugins_to_load =
wrap_preemptively Findlib.init ~on_exn:(fun e -> `Dyn_plugin (`Findlib e))
>>= fun () ->
Deferred_list.while_sequential plugins_to_load ~f:(function
| `Compiled path -> dynlink path
| `OCamlfind package ->
let to_load = files_to_load_from_package package in
Log.(s "Going to load: " % OCaml.list quote to_load @ verbose);
Deferred_list.while_sequential to_load ~f:dynlink
>>= fun (_ : unit list) ->
return ()
)
>>= fun (_ : unit list) ->
return ()