Comments (2)
(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
?
(* dune
(library
(name Core)
(preprocess (pps ppx_deriving.show ppx_irmin))
^^^^^^^^^ add this
... *)
(** Reps of Asai types *)
type string_source = Asai.Range.string_source = {
title : string option;
content : string;
}
[@@deriving irmin]
type source = [ `File of string | `String of string_source ] [@@deriving irmin]
type position = Asai.Range.position = {
source : source;
offset : int;
start_of_line : int;
line_num : int;
}
[@@deriving irmin]
type view = [ `Range of position * position | `End_of_file of position ]
[@@deriving irmin]
let range : Range.t ty =
Repr.map view_t
(function
| `Range range -> Asai.Range.make range
| `End_of_file pos -> Asai.Range.eof pos)
Asai.Range.view
(This might not the full fix as I'm not exactly sure what went wrong! Happy to take a deeper look if I can reproduce your /tmp/irmin
:) )
from irmin.
No worries :)
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.
Thanks for your tips re. the asai types!
from irmin.
Related Issues (20)
- irmin-pack: handle LRU purge in read-only instances after a GC
- Invalid conduit source address specified HOT 2
- irmin-pack: improve control file's atomic write properties HOT 1
- irmin-pack: extend GC to unlimited history stores HOT 1
- irmin-pack: integrity check doesn't use ppf for results handling
- index: readonly index creates a folder
- irmin-pack: Unlink can be slow HOT 1
- irmin-pack: change the default indexing strategy
- irmin-pack: clean up OS-specific output for integrity check logging
- irmin-cli: change `--store irf` to `--store fs`
- irmin-cli creates broken git repository HOT 10
- irmin-pack: implement `fresh` for lower layer
- Performance issue in Tree.length HOT 1
- Pack_error: "Invalid_argument" when calling `integrity-check-index` command
- invalid checksum when using irmin-pack HOT 1
- irmin-pack: error `unknown inode key`
- Tutorial - CLI- GraphQL snippet HOT 1
- libirmin fails to build with OCaml 5.2 HOT 1
- GraphQL / Irmin OCaml / Javascript
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from irmin.