From fbe971ae63c4522a0cbbc0da989ca44c8dbd302b Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Mon, 25 Feb 2019 19:54:10 +0100 Subject: [PATCH 1/2] mirage_kv_lwt.RO/RW --- README.md | 5 +++-- mirage-kv-unix.opam | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b75b756..e739e2e 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,9 @@ This is a Mirage key-value store backed by an underlying Unix directory. -The current version supports the `Mirage_kv.S` and `Mirage_kv_lwt.S` signatures -defined in the `mirage-kv` package. +The current version supports the `Mirage_kv.RO` and `Mirage_kv_lwt.RW` +signatures defined in the `[mirage-kv-lwt](https://github.com/mirage/mirage-kv)` +package. * WWW: * E-mail: diff --git a/mirage-kv-unix.opam b/mirage-kv-unix.opam index 88564e5..eb23569 100644 --- a/mirage-kv-unix.opam +++ b/mirage-kv-unix.opam @@ -28,6 +28,6 @@ synopsis: "Key-value store for MirageOS backed by Unix filesystem" description: """ This is a Mirage key-value store backed by an underlying Unix directory. -The current version supports the `Mirage_kv.S` and `Mirage_kv_lwt.S` signatures -defined in the `mirage-kv` package. +The current version supports the `Mirage_kv_lwt.RO` and `Mirage_kv_lwt.RW` +signatures defined in the `mirage-kv-lwt` package. """ From 91652fd8f4ac2edee80d12290e7dbb20090021c7 Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Fri, 25 Oct 2019 18:21:56 +0200 Subject: [PATCH 2/2] adapt to mirage-kv 3.0.0 API changes --- .travis.yml | 9 +++++---- mirage-kv-unix.opam | 8 ++++---- src/dune | 2 +- src/mirage_kv_unix.ml | 3 --- src/mirage_kv_unix.mli | 2 +- test/dune | 4 ++-- test/test_kv_unix.ml | 4 +--- 7 files changed, 14 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index f25cc0a..11c36bd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,10 +6,11 @@ services: sudo: false env: global: - - PRE_INSTALL_HOOK="cd /home/opam/opam-repository && git pull origin master && opam update -u -y" - PACKAGE="mirage-kv-unix" - TESTS="true" + - DISTRO=alpine matrix: - - DISTRO=alpine OCAML_VERSION=4.05 - - DISTRO=alpine OCAML_VERSION=4.06 - - DISTRO=alpine OCAML_VERSION=4.07 + - OCAML_VERSION=4.06 + - OCAML_VERSION=4.07 + - OCAML_VERSION=4.08 + - OCAML_VERSION=4.09 diff --git a/mirage-kv-unix.opam b/mirage-kv-unix.opam index eb23569..5116467 100644 --- a/mirage-kv-unix.opam +++ b/mirage-kv-unix.opam @@ -15,13 +15,13 @@ build: [ depends: [ "dune" {>= "1.0"} - "ocaml" {>= "4.05.0"} - "cstruct" {>= "3.2.0"} - "mirage-kv-lwt" {>= "1.0.0"} + "ocaml" {>= "4.06.0"} + "mirage-kv" {>= "3.0.0"} "lwt" "ptime" + "cstruct" {with-test & >= "3.2.0"} "rresult" {with-test} - "mirage-clock-unix" {with-test & >= "2.0.0"} + "mirage-clock-unix" {with-test & >= "3.0.0"} "alcotest" {with-test & >= "0.7.1"} ] synopsis: "Key-value store for MirageOS backed by Unix filesystem" diff --git a/src/dune b/src/dune index e36ab10..ab0571a 100644 --- a/src/dune +++ b/src/dune @@ -1,4 +1,4 @@ (library (name mirage_kv_unix) (public_name mirage-kv-unix) - (libraries mirage-kv-lwt lwt.unix ptime)) + (libraries mirage-kv lwt.unix ptime)) diff --git a/src/mirage_kv_unix.ml b/src/mirage_kv_unix.ml index bd1d9f1..2fb2d08 100644 --- a/src/mirage_kv_unix.ml +++ b/src/mirage_kv_unix.ml @@ -18,10 +18,7 @@ open Lwt.Infix -type +'a io = 'a Lwt.t - type key = Mirage_kv.Key.t -type value = string type t = { base: string diff --git a/src/mirage_kv_unix.mli b/src/mirage_kv_unix.mli index 728016c..b012cd5 100644 --- a/src/mirage_kv_unix.mli +++ b/src/mirage_kv_unix.mli @@ -22,7 +22,7 @@ type error = [ Mirage_kv.error | `Storage_error of Mirage_kv.Key.t * string ] type write_error = [ Mirage_kv.write_error | `Storage_error of Mirage_kv.Key.t * string | `Key_exists of Mirage_kv.Key.t ] -include Mirage_kv_lwt.RW +include Mirage_kv.RW with type error := error and type write_error := write_error diff --git a/test/dune b/test/dune index 8527db7..241dbc0 100644 --- a/test/dune +++ b/test/dune @@ -1,7 +1,7 @@ (executables (names test_kv_unix) - (libraries unix ptime mirage-clock-unix alcotest rresult mirage-kv-lwt - mirage-kv-unix)) + (libraries unix ptime mirage-clock-unix alcotest rresult mirage-kv + mirage-kv-unix cstruct)) (alias (name runtest) diff --git a/test/test_kv_unix.ml b/test/test_kv_unix.ml index 3a9be0a..2020af6 100644 --- a/test/test_kv_unix.ml +++ b/test/test_kv_unix.ml @@ -35,10 +35,8 @@ let assert_write_fail e = failf "%a" KV.pp_write_error e let connect_present_dir () = KV.connect test_kv >>= fun _kv -> Lwt.return_unit -let clock = lwt_run (fun () -> Pclock.connect ()) () - let append_timestamp s = - let now = Ptime.v (Pclock.now_d_ps clock) in + let now = Ptime.v (Pclock.now_d_ps ()) in let str = Fmt.strf "%s-%a" s (Ptime.pp_rfc3339 ~space:false ()) now in Mirage_kv.Key.v str