···1+diff --git a/serlib/ser_stdlib.ml b/serlib/ser_stdlib.ml
2+index 894d300..11c9217 100644
3+--- a/serlib/ser_stdlib.ml
4++++ b/serlib/ser_stdlib.ml
5+@@ -28,6 +28,7 @@ let ref_to_yojson f x = f !x
6+ let ref_of_yojson f x = Result.map (fun x -> ref x) (f x)
7+ let hash_fold_ref = hash_fold_ref_frozen
8+ let compare_ref = compare_ref
9++let (==) x y = (==) x y
10+11+ module Lazy = struct
12+ type 'a t = 'a lazy_t
13+@@ -35,3 +36,4 @@ module Lazy = struct
14+ end
15+16+ module Option = Stdlib.Option
17++module List = Stdlib.List
···1+diff --git a/lib/engine/scheduler.ml b/lib/engine/scheduler.ml
2+index e32bd0f..93b566b 100644
3+--- a/lib/engine/scheduler.ml
4++++ b/lib/engine/scheduler.ml
5+@@ -601,7 +601,7 @@ module Make(Backend : Backend) = struct
6+ )
7+ )
8+ | Trywith tw -> (
9+- match Table.find sched.traces (Workflow.id tw.w) with
10++ match Hashtbl.find sched.traces (Workflow.id tw.w) with
11+ | Some eventual_trace -> (
12+ eventual_trace >>= function
13+ | Ok (Run r) ->
14+@@ -667,10 +667,10 @@ module Make(Backend : Backend) = struct
15+ let register_build sched ~id ~build_trace =
16+ let open Eval_thread.Infix in
17+ (
18+- match Table.find sched.traces id with
19++ match Hashtbl.find sched.traces id with
20+ | None ->
21+ let trace = build_trace () in
22+- Table.set sched.traces ~key:id ~data:trace ;
23++ Hashtbl.set sched.traces ~key:id ~data:trace ;
24+ trace
25+ | Some trace -> trace
26+ ) >>= fun trace ->
27+@@ -854,7 +854,7 @@ module Make(Backend : Backend) = struct
28+ Eval_thread.join l.elts ~f:(build ?target sched)
29+ | Trywith tw -> (
30+ build sched ?target tw.w >> fun w_result ->
31+- match Table.find sched.traces (Workflow.id tw.w) with
32++ match Hashtbl.find sched.traces (Workflow.id tw.w) with
33+ | Some eventual_trace -> (
34+ eventual_trace >> function
35+ | Ok (Run r) when run_trywith_recovery r.details ->
36+diff --git a/lib/multinode/bistro_multinode.ml b/lib/multinode/bistro_multinode.ml
37+index 01dc5ac..3fc6b0e 100644
38+--- a/lib/multinode/bistro_multinode.ml
39++++ b/lib/multinode/bistro_multinode.ml
40+@@ -130,7 +130,7 @@ module Server = struct
41+ let search (type s) (table : s String.Table.t) ~f =
42+ let module M = struct exception Found of string * s end in
43+ try
44+- String.Table.fold table ~init:() ~f:(fun ~key ~data () -> if f ~key ~data then raise (M.Found (key, data))) ;
45++ Hashtbl.fold table ~init:() ~f:(fun ~key ~data () -> if f ~key ~data then raise (M.Found (key, data))) ;
46+ None
47+ with M.Found (k, v) -> Some (k, v)
48+49+@@ -145,7 +145,7 @@ module Server = struct
50+ match allocation_attempt with
51+ | None -> Some elt
52+ | Some (worker_id, (Resource curr)) ->
53+- String.Table.set pool.available ~key:worker_id ~data:(Resource { np = curr.np - np ; mem = curr.mem - mem }) ;
54++ Hashtbl.set pool.available ~key:worker_id ~data:(Resource { np = curr.np - np ; mem = curr.mem - mem }) ;
55+ Lwt.wakeup u (worker_id, Resource { np ; mem }) ;
56+ None
57+ )
58+@@ -163,12 +163,12 @@ module Server = struct
59+ t
60+61+ let add_worker pool (Worker { id ; np ; mem ; _ }) =
62+- match String.Table.add pool.available ~key:id ~data:(Allocator.Resource { np ; mem }) with
63++ match Hashtbl.add pool.available ~key:id ~data:(Allocator.Resource { np ; mem }) with
64+ | `Ok -> allocation_pass pool
65+ | `Duplicate -> failwith "A worker has been added twice"
66+67+ let release pool worker_id (Allocator.Resource { np ; mem }) =
68+- String.Table.update pool.available worker_id ~f:(function
69++ Hashtbl.update pool.available worker_id ~f:(function
70+ | None -> failwith "Tried to release resources of inexistent worker"
71+ | Some (Resource r) -> Resource { np = r.np + np ; mem = r.mem + mem }
72+ )
73+@@ -235,13 +235,13 @@ module Server = struct
74+ | Subscript { np ; mem } ->
75+ let id = new_id () in
76+ let w = create_worker ~np ~mem id in
77+- String.Table.set state.workers ~key:id ~data:w ;
78++ Hashtbl.set state.workers ~key:id ~data:w ;
79+ Worker_allocator.add_worker state.alloc w ;
80+ log (Logger.Debug (sprintf "new worker %s" id)) ;
81+ Lwt.return (Client_id id)
82+83+ | Get_job { client_id } -> (
84+- match String.Table.find state.workers client_id with
85++ match Hashtbl.find state.workers client_id with
86+ | None -> Lwt.return None
87+ | Some (Worker worker) ->
88+ Lwt.choose [
89+@@ -250,22 +250,22 @@ module Server = struct
90+ ] >>= function
91+ | `Job wp ->
92+ let workflow_id = workflow_id_of_job_waiter wp in
93+- String.Table.set worker.running_jobs ~key:workflow_id ~data:wp ;
94++ Hashtbl.set worker.running_jobs ~key:workflow_id ~data:wp ;
95+ Lwt.return (Some (job_of_job_waiter wp))
96+ | `Stop -> Lwt.return None
97+ )
98+99+ | Plugin_result r ->
100+- let Worker worker = String.Table.find_exn state.workers r.client_id in
101++ let Worker worker = Hashtbl.find_exn state.workers r.client_id in
102+ Lwt.return (
103+- match String.Table.find_exn worker.running_jobs r.workflow_id with
104++ match Hashtbl.find_exn worker.running_jobs r.workflow_id with
105+ | Waiting_plugin wp -> Lwt.wakeup wp.waiter r.result
106+ | Waiting_shell_command _ -> assert false (* should never happen *)
107+ )
108+ | Shell_command_result r ->
109+- let Worker worker = String.Table.find_exn state.workers r.client_id in
110++ let Worker worker = Hashtbl.find_exn state.workers r.client_id in
111+ Lwt.return (
112+- match String.Table.find_exn worker.running_jobs r.workflow_id with
113++ match Hashtbl.find_exn worker.running_jobs r.workflow_id with
114+ | Waiting_plugin _ -> assert false (* should never happen *)
115+ | Waiting_shell_command wp -> Lwt.wakeup wp.waiter r.result
116+ )
117+@@ -307,7 +307,7 @@ module Server = struct
118+119+ let request_resource backend req =
120+ Worker_allocator.request backend.state.alloc req >|= fun (worker_id, resource) ->
121+- String.Table.find_exn backend.state.workers worker_id, resource
122++ Hashtbl.find_exn backend.state.workers worker_id, resource
123+124+ let release_resource backend worker_id res =
125+ Worker_allocator.release backend.state.alloc worker_id res
126+@@ -334,7 +334,7 @@ module Server = struct
127+ * loop () *)
128+129+ let eval backend { worker_id ; workflow_id } f x =
130+- let Worker worker = String.Table.find_exn backend.state.workers worker_id in
131++ let Worker worker = Hashtbl.find_exn backend.state.workers worker_id in
132+ let f () = f x in
133+ let t, u = Lwt.wait () in
134+ let job_waiter = Waiting_plugin { waiter = u ; f ; workflow_id } in
135+@@ -342,7 +342,7 @@ module Server = struct
136+ t
137+138+ let run_shell_command backend { worker_id ; workflow_id } cmd =
139+- let Worker worker = String.Table.find_exn backend.state.workers worker_id in
140++ let Worker worker = Hashtbl.find_exn backend.state.workers worker_id in
141+ let t, u = Lwt.wait () in
142+ let job = Waiting_shell_command { waiter = u ; cmd ; workflow_id } in
143+ Lwt_queue.push worker.pending_jobs job ;
144+diff --git a/lib/utils/dot_output.ml b/lib/utils/dot_output.ml
145+index 90c299f..d13fceb 100644
146+--- a/lib/utils/dot_output.ml
147++++ b/lib/utils/dot_output.ml
148+@@ -24,7 +24,7 @@ module G = struct
149+ (* let successors g u = fold_succ (fun h t -> h :: t) g u [] *)
150+151+ let rec of_workflow_aux seen acc u =
152+- if S.mem seen u then (seen, acc)
153++ if Set.mem seen u then (seen, acc)
154+ else (
155+ let deps = W.Any.deps u in
156+ let seen, acc =
157+@@ -34,7 +34,7 @@ module G = struct
158+ in
159+ let acc = add_vertex acc u in
160+ let acc = List.fold deps ~init:acc ~f:(fun acc v -> add_edge acc u v) in
161+- let seen = S.add seen u in
162++ let seen = Set.add seen u in
163+ seen, acc
164+ )
165+166+@@ -109,7 +109,7 @@ let dot_output ?db oc g ~needed =
167+ ]
168+ in
169+ let vertex_attributes u =
170+- let needed = (match db with None -> true | Some _ -> false) || S.mem needed u in
171++ let needed = (match db with None -> true | Some _ -> false) || Set.mem needed u in
172+ let color = if needed then black else light_gray in
173+ let shape = `Shape (shape u) in
174+ let W.Any w = u in
175+@@ -141,7 +141,7 @@ let dot_output ?db oc g ~needed =
176+ | _ -> []
177+ in
178+ let color =
179+- if (match db with None -> true | Some _ -> false) || (S.mem needed u && not (already_done u))
180++ if (match db with None -> true | Some _ -> false) || (Set.mem needed u && not (already_done u))
181+ then black else light_gray in
182+ style @ [ `Color color ]
183+ in
184+diff --git a/lib/utils/repo.ml b/lib/utils/repo.ml
185+index 06abcd5..206a99e 100644
186+--- a/lib/utils/repo.ml
187++++ b/lib/utils/repo.ml
188+@@ -160,7 +160,7 @@ let protected_set repo =
189+ | Select s -> fold_path_workflow acc (W.Any s.dir)
190+ | Input _ -> acc
191+ | Shell _
192+- | Plugin _ -> String.Set.add acc (W.id w)
193++ | Plugin _ -> Set.add acc (W.id w)
194+ | Trywith tw ->
195+ fold_path_workflow (fold_path_workflow acc (W.Any tw.w)) (W.Any tw.failsafe)
196+ | Ifelse ie ->
197+@@ -187,7 +187,7 @@ let cache_clip_fold ~bistro_dir repo ~f ~init =
198+ let protected = protected_set repo in
199+ let db = Db.init_exn bistro_dir in
200+ Db.fold_cache db ~init ~f:(fun acc id ->
201+- f db acc (if String.Set.mem protected id then `Protected id else `Unprotected id)
202++ f db acc (if Set.mem protected id then `Protected id else `Unprotected id)
203+ )
204+205+ let cache_clip_dry_run ~bistro_dir repo =
···133 grpcio
134 ];
13500136 meta = with lib; {
137 description = "Open source libraries and APIs to build custom preprocessing pipelines for labeling, training, or production machine learning pipelines";
138 homepage = "https://github.com/Unstructured-IO/unstructured";
···133 grpcio
134 ];
135136+ passthru.optional-dependencies = optional-dependencies;
137+138 meta = with lib; {
139 description = "Open source libraries and APIs to build custom preprocessing pipelines for labeling, training, or production machine learning pipelines";
140 homepage = "https://github.com/Unstructured-IO/unstructured";