Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datakit: update to latest versions of Irmin/Mirage/Cdmliner #529

Merged
merged 12 commits into from
Apr 25, 2017

Conversation

samoht
Copy link
Member

@samoht samoht commented Apr 22, 2017

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

@samoht
Copy link
Member Author

samoht commented Apr 22, 2017

Note: this needs the dev version of hvsock (to support MirageOS 3), + mirage/irmin#432 and mirage/irmin#431 to be merged first (and Irmin 1.1 to be released)

@talex5
Copy link
Contributor

talex5 commented Apr 24, 2017

CI is unhappy because the depext line also adds some (conflicting) pins.

Copy link
Contributor

@talex5 talex5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good so far :-)

@@ -2,11 +2,14 @@ open Astring
open Rresult
open Lwt.Infix

let src = Logs.Src.create "ivfs" ~doc:"Irmin VFS"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be "DataKit" here?

@@ -674,43 +677,38 @@ module Make (Store : Ivfs_tree.STORE) = struct

(* Note: can't use [Store.fast_forward_head] because it can
sometimes return [false] on success (when already up-to-date). *)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still true?


type path = Path.t
type step = Path.Step.t
let src = Logs.Src.create "ivfs.merge" ~doc:"Irmin VFS"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"DataKit"?

@samoht
Copy link
Member Author

samoht commented Apr 24, 2017

I've updated the PR with @talex5 comments, but I haven't fixed the CI yet. Working on that now.

@samoht samoht force-pushed the new-new-irmin branch 5 times, most recently from 7516cdf to d33a472 Compare April 24, 2017 16:47
let pp_buf ppf buf = Fmt.pf ppf "%S" (Cstruct.to_string buf)
let pp ppf t = Fmt.pf ppf "%a" Fmt.(Dump.list pp_buf) !t
let pp_buf ppf buf = Fmt.string ppf (Cstruct.to_string buf)
let pp ppf t = Fmt.pf ppf "%a" Fmt.(list ~sep:(unit "") pp_buf) !t
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the unit "" can be replaced by nop from Fmt

let merge _ = merge []
module Path = Ivfs_tree.Path
end
Irmin.Info.v ~date ~author:"datakit <datakit@docker.com>" msg
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we remove the datakit@docker.com email entirely? This is now a moby/datakit repo, but could the default commit could also just be datakit without an email address if that's valid in Git?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Email is mandatory, so Irmin will add the default irmin@openmirage.org email to it. But yes @docker.com should go away.

protect (Lwt_unix.mkdir dir) 0o755;
) in
Lwt_pool.use mkdir_pool (fun () -> aux dirname)

let file_exists f =
Lwt.catch (fun () -> Lwt_unix.file_exists f) (function
(* See https://github.com/ocsigen/lwt/issues/316 *)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This issue is now fixed in Lwt>=2.7.1 -- update constraint and remove this workaround?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. Note that this is a copy/paste from Irmin-unix to avoid depending on nocrypto and hence libgmp, so it needs to be fixed upstream too.

@samoht samoht force-pushed the new-new-irmin branch 8 times, most recently from 4d2895f to 32152f2 Compare April 25, 2017 06:43
@samoht
Copy link
Member Author

samoht commented Apr 25, 2017

The ci/datakit/github error is legit, it's a regression in Irmin 1.0. Should be fixed by mirage/irmin#438

@samoht samoht force-pushed the new-new-irmin branch 2 times, most recently from 5dfd0c2 to 6b14d2f Compare April 25, 2017 11:01
@samoht
Copy link
Member Author

samoht commented Apr 25, 2017

Yay, all green!

Need a rebase of protocol-9p (that @talex5 is working on) before it can be merged.

@talex5
Copy link
Contributor

talex5 commented Apr 25, 2017

Try pinning my ping-mirage-3 ocaml-9p branch instead.

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>
Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
…xed upstream

Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
@samoht
Copy link
Member Author

samoht commented Apr 25, 2017

All green, merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants