Hello,
I have the following code which raises an inscrutable error:
open Lwt.Syntax
module Store = Irmin_git_unix.FS.KV(Irmin.Contents.String)
module Info = Irmin_unix.Info(Store.Info)
module Sync = Irmin.Sync.Make(Store)
module Config = struct
let root = "/tmp/irmin/test"
let init () =
let _ = Sys.command (Printf.sprintf "rm -rf %s" root) in
let _ = Sys.command (Printf.sprintf "mkdir -p %s" root) in
Irmin.Backend.Watch.set_listen_dir_hook Irmin_watcher.hook
end
let main_branch config =
let* repo = Store.Repo.v config in
Store.main repo
let main () =
Config.init();
let config = Irmin_git.config Config.root in
let* repo = Store.Repo.v config in
let* upstream = Store.remote "https://git.sr.ht/~jonsterling/public-trees" in
let* t = main_branch config in
let* _ = Sync.pull_exn t upstream `Set in
let+ list = Store.list t [] in
list |>
List.iter (fun (_, store_tree) ->
match Store.Tree.destruct store_tree with
| `Contents _ -> Printf.printf "FILE \n"
| `Node _ -> Printf.printf "DIR \n" )
let () = Lwt_main.run (main ())
File "test/dune", line 2, characters 14-19:
2 | (names parse store)
^^^^^
Fatal error: exception Invalid_argument("Sync.pull_exn: Handshake got an error")
Raised at Lwt.Miscellaneous.poll in file "src/core/lwt.ml", line 3123, characters 20-29
Called from Lwt_main.run.run_loop in file "src/unix/lwt_main.ml", line 27, characters 10-20
Called from Lwt_main.run in file "src/unix/lwt_main.ml", line 106, characters 8-13
Re-raised at Lwt_main.run in file "src/unix/lwt_main.ml", line 112, characters 4-13
Called from Dune__exe__Store in file "test/store.ml", line 41, characters 9-31
Now, the error actually gets raised by ocaml-git, so perhaps I should rather report it in that repo. Nontheless, the code is virtually the same as the one found in the sync example.
Some notes:
I'll try to run my code on my native linux machine. If this ends up working, I can confirm that there is a bug when running ocaml-git on WSL.
Hello,
I have the following code which raises an inscrutable error:
Now, the error actually gets raised by ocaml-git, so perhaps I should rather report it in that repo. Nontheless, the code is virtually the same as the one found in the sync example.
Some notes:
Invalid_argument("Sync.pull_exn: not found")Handshake got an error, so I don't think it has something to do with the particulars of the sourcehut git server.I'll try to run my code on my native linux machine. If this ends up working, I can confirm that there is a bug when running ocaml-git on WSL.