You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
openLwt.SyntaxopenCoremoduleStore=Irmin_git_unix.FS.KV(Rep.Tree)
moduleInfo=Irmin_unix.Info(Store.Info)
moduleSync=Irmin.Sync.Make(Store)
moduleTree=Store.Treelet config =Irmin_git.config ~bare:true"/tmp/irmin"letmain_branchconfig=let* repo =Store.Repo.v config inStore.main repo
letfold~init~ftree=Tree.fold ~order:`Sorted~contents:(funk_vacc -> if k =[]thenLwt.return acc else f k acc) tree init
letmain()=let* t = main_branch config inlet* tree =Store.tree t inlet+ _ = fold ~init:[]~f:(funkacc -> Lwt.return (k::acc)) tree in()let()=Lwt_main.run (main ())
raises the error
Fatal error: exception Invalid_argument("error expected JSON text (JSON value)")
Raised at Stdlib.invalid_arg in file "stdlib.ml", line 30, characters 20-45
Called from Irmin_git__Content_addressable.Make.find.(fun) in file "src/irmin-git/content_addressable.ml", line 46, characters 25-37
Called from Irmin__Tree.Make.Contents.value_of_key in file "src/irmin/tree.ml", line 329, characters 19-61
Called from Irmin__Tree.Make.Contents.fold in file "src/irmin/tree.ml", line 392, characters 19-36
Called from Irmin__Tree.Make.Node.fold.step.apply in file "src/irmin/tree.ml", line 1436, characters 14-73
Called from Lwt.Sequential_composition.bind.create_result_promise_and_callback_if_deferred.callback in file "src/core/lwt.ml", line 1844, characters 16-19
Re-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 25, characters 9-31
I am quite baffled by this, is this a bug?
The perhaps confusingly named Rep.Tree is a custom content type defined in this file
(My apologies for the late reply, I was on holidays!)
This is a bit hard to reproduce on my end, do you have instructions for how /tmp/irmin was created?
The error seems to be coming from your Rep.Tree encoding/decoding functions rather than from Irmin itself (but Irmin or Repr could do a better job at explaining the issue). Tree.fold needs to decode the values and it seems that the decoding function can't read what was encoded on disk. The Jsonm error is because Repr chooses this as the default encoding for all the record/variant that you defined... but that should be fine, however your Asai range definition looks suspicious! :)
Could you try recreating your /tmp/irmin repo (which is likely wrongly encoded?) and rerunning your Tree.fold test with the following definitions for Asai ranges in lib/core/Rep.ml?
The test succeeds after I deleted the git repository. I suppose the error arose because the repo persisted while I was messing around with the representations, so an encoding error makes sense.
The following code from https://github.com/kentookura/ocaml-forester/blob/main/test/store.ml
raises the error
I am quite baffled by this, is this a bug?
The perhaps confusingly named
Rep.Tree
is a custom content type defined in this fileThe end goal is to write a function analogous to https://github.com/kentookura/ocaml-forester/blob/main/bin/forester/Process.ml which takes a git remote as an argument.
The text was updated successfully, but these errors were encountered: