From ce81e4b59acef9f32b06ecf2110072f01d6fd448 Mon Sep 17 00:00:00 2001 From: Darren Li Date: Sun, 30 Jun 2024 12:42:17 +1000 Subject: [PATCH] Using temporary workaround for eio windows path --- bin/BLAKE2B.ml | 2 +- bin/document.ml | 15 +++++++-------- bin/proc_utils.ml | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/bin/BLAKE2B.ml b/bin/BLAKE2B.ml index e16b0ec..47b391d 100644 --- a/bin/BLAKE2B.ml +++ b/bin/BLAKE2B.ml @@ -6,7 +6,7 @@ let hash_of_file ~env ~path = let fs = Eio.Stdenv.fs env in let ctx = ref B.empty in try - Eio.Path.(with_open_in (fs / File_utils.fix_path_for_eio path)) + Eio.Path.(with_open_in (fst fs, File_utils.fix_path_for_eio path)) (fun flow -> match Eio.Buf_read.parse ~max_size:Params.hash_chunk_size diff --git a/bin/document.ml b/bin/document.ml index 07225d1..a2ad3af 100644 --- a/bin/document.ml +++ b/bin/document.ml @@ -122,12 +122,11 @@ let save_index ~env ~hash index : (unit, string) result = | Some cache_dir -> ( let fs = Eio.Stdenv.fs env in let path = - Eio.Path.( - fs / - File_utils.fix_path_for_eio - (Filename.concat - cache_dir - (Fmt.str "%s%s" hash Params.index_file_ext)) + (fst fs, + File_utils.fix_path_for_eio + (Filename.concat + cache_dir + (Fmt.str "%s%s" hash Params.index_file_ext)) ) in let json = Index.to_json index in @@ -150,7 +149,7 @@ let find_index ~env ~hash : Index.t option = |> File_utils.fix_path_for_eio in let path = - Eio.Path.(fs / path_str) + (fst fs, path_str) in refresh_modification_time ~path:path_str; let json = Yojson.Safe.from_string (Eio.Path.load path) in @@ -163,7 +162,7 @@ module Of_path = struct let text ~env pool search_mode path : (t, string) result = let fs = Eio.Stdenv.fs env in try - Eio.Path.(with_lines (fs / path)) + Eio.Path.(with_lines (fst fs, File_utils.fix_path_for_eio path)) (fun lines -> Ok (parse_lines pool search_mode ~path lines) ) diff --git a/bin/proc_utils.ml b/bin/proc_utils.ml index 7697f84..0e7323b 100644 --- a/bin/proc_utils.ml +++ b/bin/proc_utils.ml @@ -17,7 +17,7 @@ let run_in_background (cmd : string) = let run_return_stdout ~proc_mgr ~fs (cmd : string list) : string list option = Eio.Path.(with_open_out ~create:`Never - (fs / (if Sys.win32 then "nul" else "/dev/null"))) + (if Sys.win32 then (fst fs, "nul") else (fs / "/dev/null"))) (fun stderr -> let output = try