mirage / ocaml-crunch

Convert a filesystem into a static OCaml module
Other
73 stars 21 forks source link

file_list not exposed in Mirage_kv.RO.S #41

Closed cfcs closed 5 years ago

cfcs commented 6 years ago

The upstream interface does not include the file_list: https://github.com/mirage/mirage-kv/blob/master/src/mirage_kv.mli

This causes jbuilder test builds with --dev to fail with:

$ jbuilder runtest --dev
      ocamlc src/crunch.{cmi,cmti}
      ocamlc src/main.{cmi,cmo,cmt}
    ocamlopt src/crunch.{cmx,o}
    ocamlopt src/crunch.{a,cmxa}
    ocamlopt src/main.{cmx,o}
    ocamlopt src/main.exe
ocaml-crunch test/t1.{ml,mli}
Generating t1.ml
Generating t1.mli
    ocamldep test/consumer.depends.ocamldep-output
    ocamldep test/consumer.dependsi.ocamldep-output
      ocamlc test/t1.{cmi,cmti}
      ocamlc test/consumer.{cmi,cmo,cmt}
    ocamlopt test/t1.{cmx,o} (exit 2)
(cd _build/default && /home/user/.opam/4.04.2+fPIC/bin/ocamlopt.opt -w @a-4-29-40-41-42-44-45-48-58-59-60-40 -strict-sequence -strict-formats -short-paths -keep-locs -safe-string -g -I /home/user/.opam/4.04.2+fPIC/lib/bytes -I /home/user/.opam/4.04.2+fPIC/lib/cstruct -I /home/user/.opam/4.04.2+fPIC/lib/fmt -I /home/user/.opam/4.04.2+fPIC/lib/io-page -I /home/user/.opam/4.04.2+fPIC/lib/io-page-unix -I /home/user/.opam/4.04.2+fPIC/lib/lwt -I /home/user/.opam/4.04.2+fPIC/lib/mirage-device -I /home/user/.opam/4.04.2+fPIC/lib/mirage-kv -I /home/user/.opam/4.04.2+fPIC/lib/mirage-kv-lwt -I /home/user/.opam/4.04.2+fPIC/lib/ocaml -I /home/user/.opam/4.04.2+fPIC/lib/ocplib-endian -I /home/user/.opam/4.04.2+fPIC/lib/result -I /home/user/.opam/4.04.2+fPIC/lib/sexplib -I /home/user/.opam/4.04.2+fPIC/lib/sexplib/0 -I /home/user/.opam/4.04.2+fPIC/lib/uchar -no-alias-deps -I test -o test/t1.cmx -c -impl test/t1.ml)
File "test/t1.ml", line 21, characters 4-13:
Warning 32: unused value file_list.
File "test/t1.ml", line 1:
Error: Some fatal warnings were triggered (1 occurrences)

It also complains about an unused Arg open in https://github.com/mirage/ocaml-crunch/blob/master/src/crunch.ml#L62

Edit: Just to make clear, I do not think that Mirage_kv.RO.S should expose file_list, but perhaps another (Lwt.t-based) mechanism for listing files would be good to have. This would be useful if we -say- implemented NFS, or some other network-based backend for Mirage_kv.

hannesm commented 5 years ago

thanks for your report, this is now fixed with mirage-kv 2.0.0 interface and crunch 3.0.0.