Skip to content

Commit

Permalink
datakit: update to latest versions of Irmin/Mirage/Cdmliner
Browse files Browse the repository at this point in the history
This patch make Irmin 1.1 works with DataKit. As Irmin 1.1 only
works with cmdliner >= 1.0 and MirageOS >= 3.0, also update
these dependencies.

The main change is the removal of the body Ivfs_tree to use the new
Irmin API. The new Irmin Tree API is pretty similar (on purpose) but
it seems that we are loosing caching of file hashes. I plan to re-add
that in a later commit, after checking it is really needed.

Ideally datakit-client will also move to something closer to the Irmin API
but it is not a blocker for API compatibility.

Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>

More WIP

use mirage3, use dev version of hvsock + irmin
  • Loading branch information
samoht committed Apr 22, 2017
1 parent 91e7a09 commit 82e9800
Show file tree
Hide file tree
Showing 30 changed files with 753 additions and 1,115 deletions.
6 changes: 4 additions & 2 deletions .merlin
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
PKG lwt result fmt protocol-9p irmin cmdliner git
PKG alcotest rresult github astring fmt irmin logs mtime.os
PKG camlzip irmin.mem irmin-watcher
PKG camlzip irmin-git irmin-watcher
PKG conduit.lwt-unix hvsock named-pipe
PKG asl win-eventlog github-hooks
PKG datakit-client datakit-server.vfs datakit-github asetmap session.redis-lwt
PKG prometheus-app
PKG mirage-flow-lwt

S src/**
S tests/
S tests/*
S bridge/github/*
B _build/**
B _build/tests/
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ depends:

datakit:
ocaml pkg/pkg.ml build --tests $(TESTS) -q
ocaml pkg/pkg.ml test

client:
ocaml pkg/pkg.ml build -n datakit-client -q
Expand Down
12 changes: 6 additions & 6 deletions _tags
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ true: package(bytes lwt astring logs result cstruct fmt rresult)

### datakit-server

<src/datakit-server/*>: package(protocol-9p.unix, mirage-types)
<src/datakit-server/*>: package(protocol-9p.unix)

### datakit

<src/datakit/ivfs*>: package(irmin tc datakit-server.vfs asetmap)
<src/datakit/ivfs*>: package(irmin datakit-server.vfs asetmap)

#### irmin-io
<src/datakit_io.*>: package(conduit.lwt-unix irmin lwt.unix uri camlzip git tc)
<src/datakit_io.*>: package(conduit.lwt-unix irmin lwt.unix uri camlzip git irmin-git)

<src/datakit/*>: package(prometheus-app.unix)
<src/datakit/main.*>: package(cmdliner fmt.cli fmt.tty logs.fmt asetmap)
<src/datakit/main.*>: package(git irmin irmin.git irmin.mem irmin-watcher)
<src/datakit/main.*>: package(git irmin irmin-git irmin-watcher)
<src/datakit/main.*>: package(irmin-watcher), thread
<src/datakit/main.*>: package(protocol-9p.unix camlzip)

Expand All @@ -37,8 +37,8 @@ true: package(bytes lwt astring logs result cstruct fmt rresult)
### Tests

<tests/*>: package(alcotest conduit.lwt-unix str logs.fmt fmt.tty mtime.os)
<tests/*>: package(mirage-types.lwt protocol-9p.unix irmin irmin.mem camlzip)
<tests/*>: package(git irmin.git asetmap)
<tests/*>: package(protocol-9p.unix irmin camlzip)
<tests/*>: package(git irmin-git asetmap)
<tests/*>: thread, package(conduit.lwt-unix hvsock.lwt-unix named-pipe.lwt)

### Painful
Expand Down
2 changes: 1 addition & 1 deletion datakit-bridge-github.opam
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ depends: [
"ocamlfind" {build}
"ocamlbuild" {build}
"topkg" {build}
"cmdliner" {<"1.0.0"}
"cmdliner"
"lwt" {>= "2.7.0"}
"datakit-github"
"logs" "fmt" "mtime" "asl" "win-eventlog"
Expand Down
2 changes: 1 addition & 1 deletion datakit-bridge-local-git.opam
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ depends: [
"ocamlfind" {build}
"ocamlbuild" {build}
"topkg" {build}
"cmdliner" {< "1.0.0"}
"cmdliner"
"irmin" {< "1.0"}
"irmin-watcher"
"irmin-unix"
Expand Down
2 changes: 1 addition & 1 deletion datakit-ci.opam
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ depends: [
"datakit-github" {>= "0.9.0"}
"protocol-9p" {>= "0.8.0"}
"astring"
"cmdliner" {<"1.0.0"}
"cmdliner"
"fmt"
"logs"
"tyxml" {>= "4.0.0"}
Expand Down
3 changes: 1 addition & 2 deletions datakit-server.opam
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ depends: [
"protocol-9p" {>= "0.7.4" & < "0.9.0"}
"sexplib"
"prometheus"
"mirage-types-lwt" {< "3.0.0"}
"cmdliner" {< "1.0.0"}
"cmdliner"
]
8 changes: 4 additions & 4 deletions datakit.opam
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ depends: [
"ocamlfind" {build}
"ocamlbuild" {build}
"topkg" {build}
"cmdliner" {<"1.0.0"}
"cmdliner"
"rresult" "astring" "fmt" "asetmap"
"git" {>= "1.9.3"}
"mirage-tc" "uri"
"mirage-types" {< "3.0.0"}
"irmin" {>= "0.12.0" & < "1.0.0"}
"uri"
"irmin" {>= "1.0.0"}
"irmin-git" {>= "1.0.0"}
"camlzip" {>= "1.06"}
"cstruct" {>= "2.2"}
"result"
Expand Down
3 changes: 2 additions & 1 deletion src/datakit-client/datakit_client_9p.ml
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,8 @@ module Make(P9p : Protocol_9p_client.S) = struct
FS.write_stream t (path / "url") (Cstruct.of_string url) >>*= fun () ->
FS.write_stream t (path / "fetch") (Cstruct.of_string branch) >>*= fun () ->
FS.read_all t (path / "head") >>*= fun commit_id ->
ok { Commit.fs = t; id = Cstruct.to_string commit_id })
let id = String.trim (Cstruct.to_string commit_id) in
ok { Commit.fs = t; id })
(fun () ->
FS.remove t path >|= function
| Error e ->
Expand Down
2 changes: 1 addition & 1 deletion src/datakit-server/fs9p.ml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ module Op9p = struct

end

module Make (Flow: V1_LWT.FLOW) = struct
module Make (Flow: Mirage_flow_lwt.S) = struct

type flow = Flow.flow

Expand Down
2 changes: 1 addition & 1 deletion src/datakit-server/fs9p.mli
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ module type S = sig
end

(** Server builder. *)
module Make (Flow: V1_LWT.FLOW): S with type flow = Flow.flow
module Make (Flow: Mirage_flow_lwt.S): S with type flow = Flow.flow
Loading

0 comments on commit 82e9800

Please sign in to comment.