From 87212cf17f0f8076fcbf7fc158a50935150bec28 Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Sun, 5 Jan 2025 10:23:50 +0100 Subject: [PATCH 01/15] Add experimental support for Miou --- dune-project | 36 +++++++++++++ headache.sh | 2 + lib/vcs_git_miou/src/dune | 30 +++++++++++ lib/vcs_git_miou/src/runtime.ml | 37 ++++++++++++++ lib/vcs_git_miou/src/runtime.mli | 26 ++++++++++ lib/vcs_git_miou/src/vcs_git_miou.ml | 34 +++++++++++++ lib/vcs_git_miou/src/vcs_git_miou.mli | 73 +++++++++++++++++++++++++++ vcs-git-miou.opam | 57 +++++++++++++++++++++ vcs-git-miou.opam.template | 16 ++++++ volgo-tests.opam | 22 ++++---- 10 files changed, 323 insertions(+), 10 deletions(-) create mode 100644 lib/vcs_git_miou/src/dune create mode 100644 lib/vcs_git_miou/src/runtime.ml create mode 100644 lib/vcs_git_miou/src/runtime.mli create mode 100644 lib/vcs_git_miou/src/vcs_git_miou.ml create mode 100644 lib/vcs_git_miou/src/vcs_git_miou.mli create mode 100644 vcs-git-miou.opam create mode 100644 vcs-git-miou.opam.template diff --git a/dune-project b/dune-project index 30d9a7ba..3c287b9c 100644 --- a/dune-project +++ b/dune-project @@ -228,6 +228,42 @@ (volgo-git-backend (= :version)))) +(package + (name vcs-git-miou) + (synopsis + "A Git provider for Vcs based on Vcs_git_provider for Miou programs") + (depends + (ocaml + (>= 5.2)) + (miou + (>= 0.3.0)) + (fpath + (>= 0.7.3)) + (fpath-sexp0 + (>= 0.2.2)) + (ppx_sexp_conv + (and + (>= v0.17) + (< v0.18))) + (ppx_sexp_value + (and + (>= v0.17) + (< v0.18))) + (ppxlib + (>= 0.33)) + (provider + (>= 0.0.11)) + (sexplib0 + (and + (>= v0.17) + (< v0.18))) + (vcs + (= :version)) + (vcs-git-blocking + (= :version)) + (vcs-git-provider + (= :version)))) + (package (name vcs-test-helpers) (synopsis "Helper library to write tests using vcs") diff --git a/headache.sh b/headache.sh index 712428bb..a0148269 100755 --- a/headache.sh +++ b/headache.sh @@ -16,6 +16,8 @@ dirs=( "lib/volgo_git_eio/test" "lib/volgo_git_backend/src" "lib/volgo_git_backend/test" + "lib/vcs_git_miou/src" + "lib/vcs_git_miou/test" "lib/vcs_test_helpers/src" "lib/vcs_test_helpers/test" "test/expect" diff --git a/lib/vcs_git_miou/src/dune b/lib/vcs_git_miou/src/dune new file mode 100644 index 00000000..e40224fd --- /dev/null +++ b/lib/vcs_git_miou/src/dune @@ -0,0 +1,30 @@ +(library + (name vcs_git_miou) + (public_name vcs-git-miou) + (flags + :standard + -w + +a-4-40-41-42-44-45-48-66 + -warn-error + +a + -open + Fpath_sexp0 + -open + Sexplib0 + -open + Sexplib0.Sexp_conv) + (libraries + fpath + fpath-sexp0 + miou + provider + sexplib0 + vcs + vcs-git-blocking + vcs-git-provider) + (instrumentation + (backend bisect_ppx)) + (lint + (pps ppx_js_style -allow-let-operators -check-doc-comments)) + (preprocess + (pps -unused-code-warnings=force ppx_sexp_conv ppx_sexp_value))) diff --git a/lib/vcs_git_miou/src/runtime.ml b/lib/vcs_git_miou/src/runtime.ml new file mode 100644 index 00000000..6edd49ec --- /dev/null +++ b/lib/vcs_git_miou/src/runtime.ml @@ -0,0 +1,37 @@ +(*******************************************************************************) +(* Vcs - a Versatile OCaml Library for Git Operations *) +(* Copyright (C) 2024 Mathieu Barbin *) +(* *) +(* This file is part of Vcs. *) +(* *) +(* Vcs is free software; you can redistribute it and/or modify it under *) +(* the terms of the GNU Lesser General Public License as published by the *) +(* Free Software Foundation either version 3 of the License, or any later *) +(* version, with the LGPL-3.0 Linking Exception. *) +(* *) +(* Vcs is distributed in the hope that it will be useful, but WITHOUT ANY *) +(* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *) +(* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *) +(* the file `NOTICE.md` at the root of this repository for more details. *) +(* *) +(* You should have received a copy of the GNU Lesser General Public License *) +(* and the LGPL-3.0 Linking Exception along with this library. If not, see *) +(* and , respectively. *) +(*******************************************************************************) + +module Impl = Vcs_git_blocking.Runtime + +type t = Impl.t + +let create () = Impl.create () +let load_file t ~path = Miou.call (fun () -> Impl.load_file t ~path) |> Miou.await_exn + +let save_file ?perms t ~path ~file_contents = + Miou.call (fun () -> Impl.save_file ?perms t ~path ~file_contents) |> Miou.await_exn +;; + +let read_dir t ~dir = Miou.call (fun () -> Impl.read_dir t ~dir) |> Miou.await_exn + +let git ?env t ~cwd ~args ~f = + Miou.call (fun () -> Impl.git ?env t ~cwd ~args ~f) |> Miou.await_exn +;; diff --git a/lib/vcs_git_miou/src/runtime.mli b/lib/vcs_git_miou/src/runtime.mli new file mode 100644 index 00000000..3a0144fa --- /dev/null +++ b/lib/vcs_git_miou/src/runtime.mli @@ -0,0 +1,26 @@ +(*_******************************************************************************) +(*_ Vcs - a Versatile OCaml Library for Git Operations *) +(*_ Copyright (C) 2024 Mathieu Barbin *) +(*_ *) +(*_ This file is part of Vcs. *) +(*_ *) +(*_ Vcs is free software; you can redistribute it and/or modify it under *) +(*_ the terms of the GNU Lesser General Public License as published by the *) +(*_ Free Software Foundation either version 3 of the License, or any later *) +(*_ version, with the LGPL-3.0 Linking Exception. *) +(*_ *) +(*_ Vcs is distributed in the hope that it will be useful, but WITHOUT ANY *) +(*_ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *) +(*_ FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *) +(*_ the file `NOTICE.md` at the root of this repository for more details. *) +(*_ *) +(*_ You should have received a copy of the GNU Lesser General Public License *) +(*_ and the LGPL-3.0 Linking Exception along with this library. If not, see *) +(*_ and , respectively. *) +(*_******************************************************************************) + +type t + +include Vcs_git_provider.Runtime.S with type t := t + +val create : unit -> t diff --git a/lib/vcs_git_miou/src/vcs_git_miou.ml b/lib/vcs_git_miou/src/vcs_git_miou.ml new file mode 100644 index 00000000..22b97a59 --- /dev/null +++ b/lib/vcs_git_miou/src/vcs_git_miou.ml @@ -0,0 +1,34 @@ +(*******************************************************************************) +(* Vcs - a Versatile OCaml Library for Git Operations *) +(* Copyright (C) 2024 Mathieu Barbin *) +(* *) +(* This file is part of Vcs. *) +(* *) +(* Vcs is free software; you can redistribute it and/or modify it under *) +(* the terms of the GNU Lesser General Public License as published by the *) +(* Free Software Foundation either version 3 of the License, or any later *) +(* version, with the LGPL-3.0 Linking Exception. *) +(* *) +(* Vcs is distributed in the hope that it will be useful, but WITHOUT ANY *) +(* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *) +(* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *) +(* the file `NOTICE.md` at the root of this repository for more details. *) +(* *) +(* You should have received a copy of the GNU Lesser General Public License *) +(* and the LGPL-3.0 Linking Exception along with this library. If not, see *) +(* and , respectively. *) +(*******************************************************************************) + +type 'a t = ([> Vcs_git_provider.Trait.t ] as 'a) Vcs.t +type t' = Vcs_git_provider.Trait.t t + +module Impl = struct + include Runtime + include Vcs_git_provider.Make (Runtime) +end + +let create () = + Vcs.create (Provider.T { t = Impl.create (); provider = Impl.provider () }) +;; + +module Runtime = Runtime diff --git a/lib/vcs_git_miou/src/vcs_git_miou.mli b/lib/vcs_git_miou/src/vcs_git_miou.mli new file mode 100644 index 00000000..2314f627 --- /dev/null +++ b/lib/vcs_git_miou/src/vcs_git_miou.mli @@ -0,0 +1,73 @@ +(*_******************************************************************************) +(*_ Vcs - a Versatile OCaml Library for Git Operations *) +(*_ Copyright (C) 2024 Mathieu Barbin *) +(*_ *) +(*_ This file is part of Vcs. *) +(*_ *) +(*_ Vcs is free software; you can redistribute it and/or modify it under *) +(*_ the terms of the GNU Lesser General Public License as published by the *) +(*_ Free Software Foundation either version 3 of the License, or any later *) +(*_ version, with the LGPL-3.0 Linking Exception. *) +(*_ *) +(*_ Vcs is distributed in the hope that it will be useful, but WITHOUT ANY *) +(*_ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *) +(*_ FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *) +(*_ the file `NOTICE.md` at the root of this repository for more details. *) +(*_ *) +(*_ You should have received a copy of the GNU Lesser General Public License *) +(*_ and the LGPL-3.0 Linking Exception along with this library. If not, see *) +(*_ and , respectively. *) +(*_******************************************************************************) + +(** Implementation of a git provider for the {!module:Vcs} library, based on + [Miou], and {!module:Vcs_git_provider}. + + This implementation is based on the [git] command line tool. We run it as an + external program with utils from [Stdlib] and [Unix], producing the right + command line invocation and parsing the output to produce a typed version of + the expected results with [Vcs_git_provider]. Note that [git] must be found + in the PATH of the running environment. + + The current implementation runs blocking calls with [Miou.call], and then + awaits the result cooperatively from the calling domain with + [Miou.await_exn]. This only works if there are at least 1 extra domain + available. *) + +type 'a t = ([> Vcs_git_provider.Trait.t ] as 'a) Vcs.t + +(** This is a convenient type alias that may be used to designate a provider + with the exact list of traits supported by this implementation. *) +type t' = Vcs_git_provider.Trait.t t + +val create : unit -> _ t + +(** The implementation of the provider is exported for convenience and tests. + Casual users should prefer using [Vcs] directly. *) +module Impl : sig + type t + + val create : unit -> t + + (** {1 Provider interfaces} *) + + module Add : Vcs.Trait.Add.S with type t = t + module Branch : Vcs.Trait.Branch.S with type t = t + module Commit : Vcs.Trait.Commit.S with type t = t + module Config : Vcs.Trait.Config.S with type t = t + module File_system : Vcs.Trait.File_system.S with type t = t + module Git : Vcs.Trait.Git.S with type t = t + module Init : Vcs.Trait.Init.S with type t = t + module Log : Vcs.Trait.Log.S with type t = t + module Ls_files : Vcs.Trait.Ls_files.S with type t = t + module Name_status : Vcs.Trait.Name_status.S with type t = t + module Num_status : Vcs.Trait.Num_status.S with type t = t + module Refs : Vcs.Trait.Refs.S with type t = t + module Rev_parse : Vcs.Trait.Rev_parse.S with type t = t + module Show : Vcs.Trait.Show.S with type t = t +end + +(** {1 Runtime} + + Exposed if you need to extend it. *) + +module Runtime = Runtime diff --git a/vcs-git-miou.opam b/vcs-git-miou.opam new file mode 100644 index 00000000..7bf8a989 --- /dev/null +++ b/vcs-git-miou.opam @@ -0,0 +1,57 @@ +# This file is generated by dune, edit dune-project instead +opam-version: "2.0" +synopsis: + "A Git provider for Vcs based on Vcs_git_provider for Miou programs" +maintainer: ["Mathieu Barbin "] +authors: ["Mathieu Barbin"] +license: "LGPL-3.0-or-later WITH LGPL-3.0-linking-exception" +homepage: "https://github.com/mbarbin/vcs" +doc: "https://mbarbin.github.io/vcs/" +bug-reports: "https://github.com/mbarbin/vcs/issues" +depends: [ + "dune" {>= "3.17"} + "ocaml" {>= "5.2"} + "miou" {>= "0.3.0"} + "fpath" {>= "0.7.3"} + "fpath-sexp0" {>= "0.2.2"} + "ppx_sexp_conv" {>= "v0.17" & < "v0.18"} + "ppx_sexp_value" {>= "v0.17" & < "v0.18"} + "ppxlib" {>= "0.33"} + "provider" {>= "0.0.11"} + "sexplib0" {>= "v0.17" & < "v0.18"} + "vcs" {= version} + "vcs-git-blocking" {= version} + "vcs-git-provider" {= version} + "odoc" {with-doc} +] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] +dev-repo: "git+https://github.com/mbarbin/vcs.git" +description: """\ + +[vcs] is a set of OCaml libraries for interacting with Git +repositories. It provides a type-safe and direct-style API to +programmatically perform Git operations, ranging from creating commits +and branches to loading and navigating commit graphs in memory, +computing diffs between revisions, and more. + +[Vcs_git_miou] implements a Git provider for [vcs] based on [miou]. It +runs the [git] CLI as a subprocess in a non-blocking fashion. + +[miou]: https://github.com/robur-coop/miou + +""" +tags: [ "miou" "git" "vcs" "non-blocking-io" ] +x-maintenance-intent: [ "(latest)" ] diff --git a/vcs-git-miou.opam.template b/vcs-git-miou.opam.template new file mode 100644 index 00000000..90b8599d --- /dev/null +++ b/vcs-git-miou.opam.template @@ -0,0 +1,16 @@ +description: """\ + +[vcs] is a set of OCaml libraries for interacting with Git +repositories. It provides a type-safe and direct-style API to +programmatically perform Git operations, ranging from creating commits +and branches to loading and navigating commit graphs in memory, +computing diffs between revisions, and more. + +[Vcs_git_miou] implements a Git provider for [vcs] based on [miou]. It +runs the [git] CLI as a subprocess in a non-blocking fashion. + +[miou]: https://github.com/robur-coop/miou + +""" +tags: [ "miou" "git" "vcs" "non-blocking-io" ] +x-maintenance-intent: [ "(latest)" ] diff --git a/volgo-tests.opam b/volgo-tests.opam index b7ca9807..5d7e55a4 100644 --- a/volgo-tests.opam +++ b/volgo-tests.opam @@ -1,6 +1,6 @@ # This file is generated by dune, edit dune-project instead opam-version: "2.0" -synopsis: "Tests & Examples for volgo" +synopsis: "Tests & Examples for [Vcs]" maintainer: ["Mathieu Barbin "] authors: ["Mathieu Barbin"] license: "LGPL-3.0-or-later WITH LGPL-3.0-linking-exception" @@ -16,6 +16,9 @@ depends: [ "base_quickcheck" {>= "v0.17" & < "v0.18"} "bisect_ppx" {with-dev-setup & >= "2.8.3"} "cmdlang" {>= "0.0.9"} + "cmdlang-cmdliner-runner" {>= "0.0.8"} + "cmdlang-to-cmdliner" {>= "0.0.9"} + "cmdliner" {>= "1.3.0"} "core" {>= "v0.17" & < "v0.18"} "eio" {>= "1.0"} "eio_main" {>= "1.0"} @@ -24,8 +27,7 @@ depends: [ "fpath-base" {>= "0.2.2"} "fpath-sexp0" {>= "0.2.2"} "mdx" {with-doc & >= "2.4"} - "pp" {>= "2.0.0"} - "pplumbing" {>= "0.0.13"} + "pp-log" {>= "0.0.8"} "ppx_compare" {>= "v0.17" & < "v0.18"} "ppx_enumerate" {>= "v0.17" & < "v0.18"} "ppx_expect" {>= "v0.17" & < "v0.18"} @@ -37,17 +39,17 @@ depends: [ "ppx_sexp_message" {>= "v0.17" & < "v0.18"} "ppx_sexp_value" {>= "v0.17" & < "v0.18"} "ppxlib" {>= "0.33"} + "provider" {>= "0.0.11"} "re" {>= "1.8.0"} "sexp_pretty" {>= "v0.17" & < "v0.18"} - "shexp" {>= "v0.17" & < "v0.18"} "stdio" {>= "v0.17" & < "v0.18"} + "vcs" {= version} + "vcs-base" {= version} + "vcs-command" {= version} + "vcs-git-blocking" {= version} + "vcs-git-eio" {= version} + "vcs-git-provider" {= version} "vcs-test-helpers" {= version} - "volgo" {= version} - "volgo-base" {= version} - "volgo-git-backend" {= version} - "volgo-git-eio" {= version} - "volgo-git-unix" {= version} - "volgo-vcs" {= version} "sherlodoc" {with-doc & >= "0.2"} "odoc" {with-doc} ] From 8b6c5094475578e9e170992e34eff162ef04e60f Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Sun, 5 Jan 2025 10:23:58 +0100 Subject: [PATCH 02/15] Add tests for miou backend --- lib/vcs_git_miou/test/dune | 42 +++++++++ lib/vcs_git_miou/test/test__hello_commit.ml | 89 +++++++++++++++++++ lib/vcs_git_miou/test/test__hello_commit.mli | 20 +++++ .../test/test__no_domain_available.ml | 67 ++++++++++++++ .../test/test__no_domain_available.mli | 20 +++++ lib/vcs_git_miou/test/test__no_run.ml | 30 +++++++ lib/vcs_git_miou/test/test__no_run.mli | 20 +++++ 7 files changed, 288 insertions(+) create mode 100644 lib/vcs_git_miou/test/dune create mode 100644 lib/vcs_git_miou/test/test__hello_commit.ml create mode 100644 lib/vcs_git_miou/test/test__hello_commit.mli create mode 100644 lib/vcs_git_miou/test/test__no_domain_available.ml create mode 100644 lib/vcs_git_miou/test/test__no_domain_available.mli create mode 100644 lib/vcs_git_miou/test/test__no_run.ml create mode 100644 lib/vcs_git_miou/test/test__no_run.mli diff --git a/lib/vcs_git_miou/test/dune b/lib/vcs_git_miou/test/dune new file mode 100644 index 00000000..6aeca5df --- /dev/null +++ b/lib/vcs_git_miou/test/dune @@ -0,0 +1,42 @@ +(library + (name vcs_git_miou_test) + (public_name vcs-tests.vcs_git_miou_test) + (inline_tests) + (flags + :standard + -w + +a-4-40-41-42-44-45-48-66 + -warn-error + +a + -open + Base + -open + Fpath_sexp0 + -open + Expect_test_helpers_base) + (libraries + base + miou + miou.unix + expect_test_helpers_core.expect_test_helpers_base + fpath + fpath-sexp0 + unix + vcs + vcs_git_miou + vcs_test_helpers) + (instrumentation + (backend bisect_ppx)) + (lint + (pps ppx_js_style -check-doc-comments)) + (preprocess + (pps + -unused-code-warnings=force + ppx_compare + ppx_enumerate + ppx_expect + ppx_hash + ppx_here + ppx_let + ppx_sexp_conv + ppx_sexp_value))) diff --git a/lib/vcs_git_miou/test/test__hello_commit.ml b/lib/vcs_git_miou/test/test__hello_commit.ml new file mode 100644 index 00000000..25aa57f1 --- /dev/null +++ b/lib/vcs_git_miou/test/test__hello_commit.ml @@ -0,0 +1,89 @@ +(*******************************************************************************) +(* Vcs - a Versatile OCaml Library for Git Operations *) +(* Copyright (C) 2024 Mathieu Barbin *) +(* *) +(* This file is part of Vcs. *) +(* *) +(* Vcs is free software; you can redistribute it and/or modify it under *) +(* the terms of the GNU Lesser General Public License as published by the *) +(* Free Software Foundation either version 3 of the License, or any later *) +(* version, with the LGPL-3.0 Linking Exception. *) +(* *) +(* Vcs is distributed in the hope that it will be useful, but WITHOUT ANY *) +(* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *) +(* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *) +(* the file `NOTICE.md` at the root of this repository for more details. *) +(* *) +(* You should have received a copy of the GNU Lesser General Public License *) +(* and the LGPL-3.0 Linking Exception along with this library. If not, see *) +(* and , respectively. *) +(*******************************************************************************) + +(* This is a simple test to make sure we can initialize a repo and commit a + file, and verify the mock rev mapping. *) + +let%expect_test "hello commit" = + Miou_unix.run + @@ fun () -> + let vcs = Vcs_git_miou.create () in + let mock_revs = Vcs.Mock_revs.create () in + let repo_root = + let path = Stdlib.Filename.temp_dir ~temp_dir:(Unix.getcwd ()) "vcs" "test" in + Vcs_test_helpers.init vcs ~path:(Absolute_path.v path) + in + let hello_file = Vcs.Path_in_repo.v "hello.txt" in + Vcs.save_file + vcs + ~path:(Vcs.Repo_root.append repo_root hello_file) + ~file_contents:(Vcs.File_contents.create "Hello World!"); + print_s + [%sexp + (Vcs.load_file vcs ~path:(Vcs.Repo_root.append repo_root hello_file) + : Vcs.File_contents.t)]; + [%expect {| "Hello World!" |}]; + print_s + [%sexp + (Vcs.read_dir vcs ~dir:(Vcs.Repo_root.to_absolute_path repo_root) : Fsegment.t list)]; + [%expect {| (.git hello.txt) |}]; + Vcs.add vcs ~repo_root ~path:hello_file; + let rev = + Vcs.commit vcs ~repo_root ~commit_message:(Vcs.Commit_message.v "hello commit") + in + let mock_rev = Vcs.Mock_revs.to_mock mock_revs ~rev in + print_s [%sexp (mock_rev : Vcs.Rev.t)]; + [%expect {| 1185512b92d612b25613f2e5b473e5231185512b |}]; + print_s + [%sexp + (Vcs.Result.show_file_at_rev + vcs + ~repo_root + ~rev:(Vcs.Mock_revs.of_mock mock_revs ~mock_rev |> Option.value_exn ~here:[%here]) + ~path:hello_file + : [ `Present of Vcs.File_contents.t | `Absent ] Vcs.Result.t)]; + [%expect {| (Ok (Present "Hello World!")) |}]; + print_s + [%sexp + (Vcs.Result.show_file_at_rev vcs ~repo_root ~rev ~path:hello_file + : [ `Present of Vcs.File_contents.t | `Absent ] Vcs.Result.t)]; + [%expect {| (Ok (Present "Hello World!")) |}]; + (* Using [Vcs] from within cooperative [Miou.async] constructs. *) + let p1 = + Miou.async (fun () -> [%sexp (Vcs.current_branch vcs ~repo_root : Vcs.Branch_name.t)]) + in + let p2 = + Miou.async (fun () -> + [%sexp + (Vcs.ls_files vcs ~repo_root ~below:Vcs.Path_in_repo.root + : Vcs.Path_in_repo.t list)]) + in + Miou.await_all [ p1; p2 ] + |> List.iter ~f:(function + | Ok sexp -> print_s sexp + | Error exn -> raise exn [@coverage off]); + [%expect + {| + main + (hello.txt) + |}]; + () +;; diff --git a/lib/vcs_git_miou/test/test__hello_commit.mli b/lib/vcs_git_miou/test/test__hello_commit.mli new file mode 100644 index 00000000..45af050a --- /dev/null +++ b/lib/vcs_git_miou/test/test__hello_commit.mli @@ -0,0 +1,20 @@ +(*_******************************************************************************) +(*_ Vcs - a Versatile OCaml Library for Git Operations *) +(*_ Copyright (C) 2024 Mathieu Barbin *) +(*_ *) +(*_ This file is part of Vcs. *) +(*_ *) +(*_ Vcs is free software; you can redistribute it and/or modify it under *) +(*_ the terms of the GNU Lesser General Public License as published by the *) +(*_ Free Software Foundation either version 3 of the License, or any later *) +(*_ version, with the LGPL-3.0 Linking Exception. *) +(*_ *) +(*_ Vcs is distributed in the hope that it will be useful, but WITHOUT ANY *) +(*_ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *) +(*_ FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *) +(*_ the file `NOTICE.md` at the root of this repository for more details. *) +(*_ *) +(*_ You should have received a copy of the GNU Lesser General Public License *) +(*_ and the LGPL-3.0 Linking Exception along with this library. If not, see *) +(*_ and , respectively. *) +(*_******************************************************************************) diff --git a/lib/vcs_git_miou/test/test__no_domain_available.ml b/lib/vcs_git_miou/test/test__no_domain_available.ml new file mode 100644 index 00000000..8a7444db --- /dev/null +++ b/lib/vcs_git_miou/test/test__no_domain_available.ml @@ -0,0 +1,67 @@ +(*******************************************************************************) +(* Vcs - a Versatile OCaml Library for Git Operations *) +(* Copyright (C) 2024 Mathieu Barbin *) +(* *) +(* This file is part of Vcs. *) +(* *) +(* Vcs is free software; you can redistribute it and/or modify it under *) +(* the terms of the GNU Lesser General Public License as published by the *) +(* Free Software Foundation either version 3 of the License, or any later *) +(* version, with the LGPL-3.0 Linking Exception. *) +(* *) +(* Vcs is distributed in the hope that it will be useful, but WITHOUT ANY *) +(* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *) +(* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *) +(* the file `NOTICE.md` at the root of this repository for more details. *) +(* *) +(* You should have received a copy of the GNU Lesser General Public License *) +(* and the LGPL-3.0 Linking Exception along with this library. If not, see *) +(* and , respectively. *) +(*******************************************************************************) + +(* As explained in the documentation, [Vcs_git_miou] requires one extra domain + to run the blocking calls to git. In this test we monitor what happens if + there is no such domain available. *) + +let%expect_test "hello commit" = + Miou_unix.run ~domains:0 + @@ fun () -> + let vcs = Vcs_git_miou.create () in + require_does_raise [%here] (fun () -> + Vcs_test_helpers.init vcs ~path:(Absolute_path.v (Unix.getcwd ()))); + [%expect {| (Miou.No_domain_available) |}]; + () +;; + +(* In the next test, we look at a case where the call to git is itself run from + within a call to [Miou.call] when there is no other domain available. This + should be considered a programming error. *) + +let%expect_test "hello commit" = + Miou_unix.run ~domains:1 + @@ fun () -> + let vcs = Vcs_git_miou.create () in + let repo_root = + let path = Stdlib.Filename.temp_dir ~temp_dir:(Unix.getcwd ()) "vcs" "test" in + Vcs_test_helpers.init vcs ~path:(Absolute_path.v path) + in + let hello_file = Vcs.Path_in_repo.v "hello.txt" in + Vcs.save_file + vcs + ~path:(Vcs.Repo_root.append repo_root hello_file) + ~file_contents:(Vcs.File_contents.create "Hello World!"); + print_s + [%sexp + (Vcs.load_file vcs ~path:(Vcs.Repo_root.append repo_root hello_file) + : Vcs.File_contents.t)]; + [%expect {| "Hello World!" |}]; + require_does_raise [%here] (fun () -> + Miou.call (fun () -> + Vcs.save_file + vcs + ~path:(Vcs.Repo_root.append repo_root hello_file) + ~file_contents:(Vcs.File_contents.create "Hello World Again!")) + |> Miou.await_exn); + [%expect {| (Miou.No_domain_available) |}]; + () +;; diff --git a/lib/vcs_git_miou/test/test__no_domain_available.mli b/lib/vcs_git_miou/test/test__no_domain_available.mli new file mode 100644 index 00000000..45af050a --- /dev/null +++ b/lib/vcs_git_miou/test/test__no_domain_available.mli @@ -0,0 +1,20 @@ +(*_******************************************************************************) +(*_ Vcs - a Versatile OCaml Library for Git Operations *) +(*_ Copyright (C) 2024 Mathieu Barbin *) +(*_ *) +(*_ This file is part of Vcs. *) +(*_ *) +(*_ Vcs is free software; you can redistribute it and/or modify it under *) +(*_ the terms of the GNU Lesser General Public License as published by the *) +(*_ Free Software Foundation either version 3 of the License, or any later *) +(*_ version, with the LGPL-3.0 Linking Exception. *) +(*_ *) +(*_ Vcs is distributed in the hope that it will be useful, but WITHOUT ANY *) +(*_ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *) +(*_ FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *) +(*_ the file `NOTICE.md` at the root of this repository for more details. *) +(*_ *) +(*_ You should have received a copy of the GNU Lesser General Public License *) +(*_ and the LGPL-3.0 Linking Exception along with this library. If not, see *) +(*_ and , respectively. *) +(*_******************************************************************************) diff --git a/lib/vcs_git_miou/test/test__no_run.ml b/lib/vcs_git_miou/test/test__no_run.ml new file mode 100644 index 00000000..48fd28ec --- /dev/null +++ b/lib/vcs_git_miou/test/test__no_run.ml @@ -0,0 +1,30 @@ +(*******************************************************************************) +(* Vcs - a Versatile OCaml Library for Git Operations *) +(* Copyright (C) 2024 Mathieu Barbin *) +(* *) +(* This file is part of Vcs. *) +(* *) +(* Vcs is free software; you can redistribute it and/or modify it under *) +(* the terms of the GNU Lesser General Public License as published by the *) +(* Free Software Foundation either version 3 of the License, or any later *) +(* version, with the LGPL-3.0 Linking Exception. *) +(* *) +(* Vcs is distributed in the hope that it will be useful, but WITHOUT ANY *) +(* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *) +(* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *) +(* the file `NOTICE.md` at the root of this repository for more details. *) +(* *) +(* You should have received a copy of the GNU Lesser General Public License *) +(* and the LGPL-3.0 Linking Exception along with this library. If not, see *) +(* and , respectively. *) +(*******************************************************************************) + +(* The library must be used from without a call to [Miou_unix.run]. *) + +let%expect_test "hello commit" = + let vcs = Vcs_git_miou.create () in + require_does_raise [%here] (fun () -> + Vcs_test_helpers.init vcs ~path:(Absolute_path.v (Unix.getcwd ()))); + [%expect {| ("Stdlib.Effect.Unhandled(Miou.Domains)") |}]; + () +;; diff --git a/lib/vcs_git_miou/test/test__no_run.mli b/lib/vcs_git_miou/test/test__no_run.mli new file mode 100644 index 00000000..45af050a --- /dev/null +++ b/lib/vcs_git_miou/test/test__no_run.mli @@ -0,0 +1,20 @@ +(*_******************************************************************************) +(*_ Vcs - a Versatile OCaml Library for Git Operations *) +(*_ Copyright (C) 2024 Mathieu Barbin *) +(*_ *) +(*_ This file is part of Vcs. *) +(*_ *) +(*_ Vcs is free software; you can redistribute it and/or modify it under *) +(*_ the terms of the GNU Lesser General Public License as published by the *) +(*_ Free Software Foundation either version 3 of the License, or any later *) +(*_ version, with the LGPL-3.0 Linking Exception. *) +(*_ *) +(*_ Vcs is distributed in the hope that it will be useful, but WITHOUT ANY *) +(*_ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *) +(*_ FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *) +(*_ the file `NOTICE.md` at the root of this repository for more details. *) +(*_ *) +(*_ You should have received a copy of the GNU Lesser General Public License *) +(*_ and the LGPL-3.0 Linking Exception along with this library. If not, see *) +(*_ and , respectively. *) +(*_******************************************************************************) From d86bd15e3e70a21fc423de1cc4ae6b2b506d589c Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Sun, 5 Jan 2025 10:44:54 +0100 Subject: [PATCH 03/15] Fix brittle test --- lib/vcs_git_miou/test/test__hello_commit.ml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/vcs_git_miou/test/test__hello_commit.ml b/lib/vcs_git_miou/test/test__hello_commit.ml index 25aa57f1..10461e4c 100644 --- a/lib/vcs_git_miou/test/test__hello_commit.ml +++ b/lib/vcs_git_miou/test/test__hello_commit.ml @@ -52,6 +52,8 @@ let%expect_test "hello commit" = let mock_rev = Vcs.Mock_revs.to_mock mock_revs ~rev in print_s [%sexp (mock_rev : Vcs.Rev.t)]; [%expect {| 1185512b92d612b25613f2e5b473e5231185512b |}]; + (* Making sure the default branch name is deterministic. *) + Vcs.rename_current_branch vcs ~repo_root ~to_:Vcs.Branch_name.main; print_s [%sexp (Vcs.Result.show_file_at_rev From 17f990da78816f830fd962914e1b8aa918ad8647 Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Mon, 26 May 2025 14:37:51 +0200 Subject: [PATCH 04/15] Update to more recent tip --- dune-project | 28 ++++++++----------- headache.sh | 20 ++++++------- lib/{vcs_git_miou => volgo_git_miou}/src/dune | 14 ++++++---- .../src/runtime.ml | 6 ++-- .../src/runtime.mli | 2 +- .../src/volgo_git_miou.ml} | 10 +++---- .../src/volgo_git_miou.mli} | 14 ++++------ .../test/dune | 18 ++++++------ .../test/test__hello_commit.ml | 2 +- .../test/test__hello_commit.mli | 0 .../test/test__no_domain_available.ml | 4 +-- .../test/test__no_domain_available.mli | 0 .../test/test__no_run.ml | 2 +- .../test/test__no_run.mli | 0 volgo-dev.opam | 1 + vcs-git-miou.opam => volgo-git-miou.opam | 15 +++++----- ...m.template => volgo-git-miou.opam.template | 0 volgo-tests.opam | 23 ++++++++------- 18 files changed, 77 insertions(+), 82 deletions(-) rename lib/{vcs_git_miou => volgo_git_miou}/src/dune (73%) rename lib/{vcs_git_miou => volgo_git_miou}/src/runtime.ml (91%) rename lib/{vcs_git_miou => volgo_git_miou}/src/runtime.mli (96%) rename lib/{vcs_git_miou/src/vcs_git_miou.ml => volgo_git_miou/src/volgo_git_miou.ml} (88%) rename lib/{vcs_git_miou/src/vcs_git_miou.mli => volgo_git_miou/src/volgo_git_miou.mli} (91%) rename lib/{vcs_git_miou => volgo_git_miou}/test/dune (76%) rename lib/{vcs_git_miou => volgo_git_miou}/test/test__hello_commit.ml (99%) rename lib/{vcs_git_miou => volgo_git_miou}/test/test__hello_commit.mli (100%) rename lib/{vcs_git_miou => volgo_git_miou}/test/test__no_domain_available.ml (97%) rename lib/{vcs_git_miou => volgo_git_miou}/test/test__no_domain_available.mli (100%) rename lib/{vcs_git_miou => volgo_git_miou}/test/test__no_run.ml (97%) rename lib/{vcs_git_miou => volgo_git_miou}/test/test__no_run.mli (100%) rename vcs-git-miou.opam => volgo-git-miou.opam (81%) rename vcs-git-miou.opam.template => volgo-git-miou.opam.template (100%) diff --git a/dune-project b/dune-project index 3c287b9c..31780d18 100644 --- a/dune-project +++ b/dune-project @@ -229,9 +229,9 @@ (= :version)))) (package - (name vcs-git-miou) + (name volgo-git-miou) (synopsis - "A Git provider for Vcs based on Vcs_git_provider for Miou programs") + "A Git provider for Vcs based on Volgo_git_backend for Miou programs") (depends (ocaml (>= 5.2)) @@ -242,26 +242,18 @@ (fpath-sexp0 (>= 0.2.2)) (ppx_sexp_conv - (and - (>= v0.17) - (< v0.18))) + (>= v0.17)) (ppx_sexp_value - (and - (>= v0.17) - (< v0.18))) + (>= v0.17)) (ppxlib (>= 0.33)) - (provider - (>= 0.0.11)) (sexplib0 - (and - (>= v0.17) - (< v0.18))) - (vcs + (>= v0.17)) + (volgo (= :version)) - (vcs-git-blocking + (volgo-git-backend (= :version)) - (vcs-git-provider + (volgo-git-unix (= :version)))) (package @@ -436,6 +428,8 @@ (= :version)) (volgo-git-eio (= :version)) + (volgo-git-miou + (= :version)) (volgo-git-unix (= :version)) (volgo-vcs @@ -564,6 +558,8 @@ (= :version)) (volgo-git-eio (= :version)) + (volgo-git-miou + (= :version)) (volgo-git-unix (= :version)) (volgo-tests diff --git a/headache.sh b/headache.sh index a0148269..d2178c0d 100755 --- a/headache.sh +++ b/headache.sh @@ -4,22 +4,22 @@ dirs=( # Add new directories below: "bin" "example" + "lib/vcs_test_helpers/src" + "lib/vcs_test_helpers/test" "lib/volgo/src" "lib/volgo/test" "lib/volgo_base/src" "lib/volgo_base/test" - "lib/volgo_vcs_cli/src" - "lib/volgo_vcs_cli/test" - "lib/volgo_git_unix/src" - "lib/volgo_git_unix/test" - "lib/volgo_git_eio/src" - "lib/volgo_git_eio/test" "lib/volgo_git_backend/src" "lib/volgo_git_backend/test" - "lib/vcs_git_miou/src" - "lib/vcs_git_miou/test" - "lib/vcs_test_helpers/src" - "lib/vcs_test_helpers/test" + "lib/volgo_git_eio/src" + "lib/volgo_git_eio/test" + "lib/volgo_git_miou/src" + "lib/volgo_git_miou/test" + "lib/volgo_git_unix/src" + "lib/volgo_git_unix/test" + "lib/volgo_vcs_cli/src" + "lib/volgo_vcs_cli/test" "test/expect" ) diff --git a/lib/vcs_git_miou/src/dune b/lib/volgo_git_miou/src/dune similarity index 73% rename from lib/vcs_git_miou/src/dune rename to lib/volgo_git_miou/src/dune index e40224fd..f156d04d 100644 --- a/lib/vcs_git_miou/src/dune +++ b/lib/volgo_git_miou/src/dune @@ -1,6 +1,6 @@ (library - (name vcs_git_miou) - (public_name vcs-git-miou) + (name volgo_git_miou) + (public_name volgo-git-miou) (flags :standard -w @@ -12,16 +12,18 @@ -open Sexplib0 -open - Sexplib0.Sexp_conv) + Sexplib0.Sexp_conv + -open + Volgo) (libraries fpath fpath-sexp0 miou provider sexplib0 - vcs - vcs-git-blocking - vcs-git-provider) + volgo + volgo-git-backend + volgo-git-unix) (instrumentation (backend bisect_ppx)) (lint diff --git a/lib/vcs_git_miou/src/runtime.ml b/lib/volgo_git_miou/src/runtime.ml similarity index 91% rename from lib/vcs_git_miou/src/runtime.ml rename to lib/volgo_git_miou/src/runtime.ml index 6edd49ec..d271ae0a 100644 --- a/lib/vcs_git_miou/src/runtime.ml +++ b/lib/volgo_git_miou/src/runtime.ml @@ -19,15 +19,15 @@ (* and , respectively. *) (*******************************************************************************) -module Impl = Vcs_git_blocking.Runtime +module Impl = Volgo_git_unix.Runtime type t = Impl.t let create () = Impl.create () let load_file t ~path = Miou.call (fun () -> Impl.load_file t ~path) |> Miou.await_exn -let save_file ?perms t ~path ~file_contents = - Miou.call (fun () -> Impl.save_file ?perms t ~path ~file_contents) |> Miou.await_exn +let save_file t ?perms () ~path ~file_contents = + Miou.call (fun () -> Impl.save_file t ?perms () ~path ~file_contents) |> Miou.await_exn ;; let read_dir t ~dir = Miou.call (fun () -> Impl.read_dir t ~dir) |> Miou.await_exn diff --git a/lib/vcs_git_miou/src/runtime.mli b/lib/volgo_git_miou/src/runtime.mli similarity index 96% rename from lib/vcs_git_miou/src/runtime.mli rename to lib/volgo_git_miou/src/runtime.mli index 3a0144fa..62394163 100644 --- a/lib/vcs_git_miou/src/runtime.mli +++ b/lib/volgo_git_miou/src/runtime.mli @@ -21,6 +21,6 @@ type t -include Vcs_git_provider.Runtime.S with type t := t +include Volgo_git_backend.Runtime.S with type t := t val create : unit -> t diff --git a/lib/vcs_git_miou/src/vcs_git_miou.ml b/lib/volgo_git_miou/src/volgo_git_miou.ml similarity index 88% rename from lib/vcs_git_miou/src/vcs_git_miou.ml rename to lib/volgo_git_miou/src/volgo_git_miou.ml index 22b97a59..992f34bb 100644 --- a/lib/vcs_git_miou/src/vcs_git_miou.ml +++ b/lib/volgo_git_miou/src/volgo_git_miou.ml @@ -19,16 +19,14 @@ (* and , respectively. *) (*******************************************************************************) -type 'a t = ([> Vcs_git_provider.Trait.t ] as 'a) Vcs.t -type t' = Vcs_git_provider.Trait.t t +type t = Volgo_git_backend.Trait.t Vcs.t module Impl = struct include Runtime - include Vcs_git_provider.Make (Runtime) + include Volgo_git_backend.Make (Runtime) end -let create () = - Vcs.create (Provider.T { t = Impl.create (); provider = Impl.provider () }) -;; +let create_class () = new Impl.c (Impl.create ()) +let create () = Vcs.create (create_class ()) module Runtime = Runtime diff --git a/lib/vcs_git_miou/src/vcs_git_miou.mli b/lib/volgo_git_miou/src/volgo_git_miou.mli similarity index 91% rename from lib/vcs_git_miou/src/vcs_git_miou.mli rename to lib/volgo_git_miou/src/volgo_git_miou.mli index 2314f627..49d3d8eb 100644 --- a/lib/vcs_git_miou/src/vcs_git_miou.mli +++ b/lib/volgo_git_miou/src/volgo_git_miou.mli @@ -19,13 +19,13 @@ (*_ and , respectively. *) (*_******************************************************************************) -(** Implementation of a git provider for the {!module:Vcs} library, based on - [Miou], and {!module:Vcs_git_provider}. +(** Implementation of a git backend for the {!module:Volgo.Vcs} library, based + on [Miou], and {!module:Vcs_git_backend}. This implementation is based on the [git] command line tool. We run it as an external program with utils from [Stdlib] and [Unix], producing the right command line invocation and parsing the output to produce a typed version of - the expected results with [Vcs_git_provider]. Note that [git] must be found + the expected results with [Vcs_git_backend]. Note that [git] must be found in the PATH of the running environment. The current implementation runs blocking calls with [Miou.call], and then @@ -33,13 +33,11 @@ [Miou.await_exn]. This only works if there are at least 1 extra domain available. *) -type 'a t = ([> Vcs_git_provider.Trait.t ] as 'a) Vcs.t - -(** This is a convenient type alias that may be used to designate a provider +(** This is a convenient type alias that may be used to designate a backend with the exact list of traits supported by this implementation. *) -type t' = Vcs_git_provider.Trait.t t +type t = Volgo_git_backend.Trait.t Vcs.t -val create : unit -> _ t +val create : unit -> t (** The implementation of the provider is exported for convenience and tests. Casual users should prefer using [Vcs] directly. *) diff --git a/lib/vcs_git_miou/test/dune b/lib/volgo_git_miou/test/dune similarity index 76% rename from lib/vcs_git_miou/test/dune rename to lib/volgo_git_miou/test/dune index 6aeca5df..c9065a11 100644 --- a/lib/vcs_git_miou/test/dune +++ b/lib/volgo_git_miou/test/dune @@ -1,6 +1,6 @@ (library - (name vcs_git_miou_test) - (public_name vcs-tests.vcs_git_miou_test) + (name volgo_git_miou_test) + (public_name volgo-tests.volgo_git_miou_test) (inline_tests) (flags :standard @@ -13,18 +13,20 @@ -open Fpath_sexp0 -open - Expect_test_helpers_base) + Expect_test_helpers_base + -open + Volgo) (libraries base - miou - miou.unix expect_test_helpers_core.expect_test_helpers_base fpath fpath-sexp0 + miou + miou.unix unix - vcs - vcs_git_miou - vcs_test_helpers) + vcs_test_helpers + volgo + volgo_git_miou) (instrumentation (backend bisect_ppx)) (lint diff --git a/lib/vcs_git_miou/test/test__hello_commit.ml b/lib/volgo_git_miou/test/test__hello_commit.ml similarity index 99% rename from lib/vcs_git_miou/test/test__hello_commit.ml rename to lib/volgo_git_miou/test/test__hello_commit.ml index 10461e4c..87ab8fad 100644 --- a/lib/vcs_git_miou/test/test__hello_commit.ml +++ b/lib/volgo_git_miou/test/test__hello_commit.ml @@ -25,7 +25,7 @@ let%expect_test "hello commit" = Miou_unix.run @@ fun () -> - let vcs = Vcs_git_miou.create () in + let vcs = Volgo_git_miou.create () in let mock_revs = Vcs.Mock_revs.create () in let repo_root = let path = Stdlib.Filename.temp_dir ~temp_dir:(Unix.getcwd ()) "vcs" "test" in diff --git a/lib/vcs_git_miou/test/test__hello_commit.mli b/lib/volgo_git_miou/test/test__hello_commit.mli similarity index 100% rename from lib/vcs_git_miou/test/test__hello_commit.mli rename to lib/volgo_git_miou/test/test__hello_commit.mli diff --git a/lib/vcs_git_miou/test/test__no_domain_available.ml b/lib/volgo_git_miou/test/test__no_domain_available.ml similarity index 97% rename from lib/vcs_git_miou/test/test__no_domain_available.ml rename to lib/volgo_git_miou/test/test__no_domain_available.ml index 8a7444db..23d7d45e 100644 --- a/lib/vcs_git_miou/test/test__no_domain_available.ml +++ b/lib/volgo_git_miou/test/test__no_domain_available.ml @@ -26,7 +26,7 @@ let%expect_test "hello commit" = Miou_unix.run ~domains:0 @@ fun () -> - let vcs = Vcs_git_miou.create () in + let vcs = Volgo_git_miou.create () in require_does_raise [%here] (fun () -> Vcs_test_helpers.init vcs ~path:(Absolute_path.v (Unix.getcwd ()))); [%expect {| (Miou.No_domain_available) |}]; @@ -40,7 +40,7 @@ let%expect_test "hello commit" = let%expect_test "hello commit" = Miou_unix.run ~domains:1 @@ fun () -> - let vcs = Vcs_git_miou.create () in + let vcs = Volgo_git_miou.create () in let repo_root = let path = Stdlib.Filename.temp_dir ~temp_dir:(Unix.getcwd ()) "vcs" "test" in Vcs_test_helpers.init vcs ~path:(Absolute_path.v path) diff --git a/lib/vcs_git_miou/test/test__no_domain_available.mli b/lib/volgo_git_miou/test/test__no_domain_available.mli similarity index 100% rename from lib/vcs_git_miou/test/test__no_domain_available.mli rename to lib/volgo_git_miou/test/test__no_domain_available.mli diff --git a/lib/vcs_git_miou/test/test__no_run.ml b/lib/volgo_git_miou/test/test__no_run.ml similarity index 97% rename from lib/vcs_git_miou/test/test__no_run.ml rename to lib/volgo_git_miou/test/test__no_run.ml index 48fd28ec..5198dd19 100644 --- a/lib/vcs_git_miou/test/test__no_run.ml +++ b/lib/volgo_git_miou/test/test__no_run.ml @@ -22,7 +22,7 @@ (* The library must be used from without a call to [Miou_unix.run]. *) let%expect_test "hello commit" = - let vcs = Vcs_git_miou.create () in + let vcs = Volgo_git_miou.create () in require_does_raise [%here] (fun () -> Vcs_test_helpers.init vcs ~path:(Absolute_path.v (Unix.getcwd ()))); [%expect {| ("Stdlib.Effect.Unhandled(Miou.Domains)") |}]; diff --git a/lib/vcs_git_miou/test/test__no_run.mli b/lib/volgo_git_miou/test/test__no_run.mli similarity index 100% rename from lib/vcs_git_miou/test/test__no_run.mli rename to lib/volgo_git_miou/test/test__no_run.mli diff --git a/volgo-dev.opam b/volgo-dev.opam index 2f2a4351..efd065db 100644 --- a/volgo-dev.opam +++ b/volgo-dev.opam @@ -47,6 +47,7 @@ depends: [ "volgo-base" {= version} "volgo-git-backend" {= version} "volgo-git-eio" {= version} + "volgo-git-miou" {= version} "volgo-git-unix" {= version} "volgo-tests" {= version} "volgo-vcs" {= version} diff --git a/vcs-git-miou.opam b/volgo-git-miou.opam similarity index 81% rename from vcs-git-miou.opam rename to volgo-git-miou.opam index 7bf8a989..7c390a18 100644 --- a/vcs-git-miou.opam +++ b/volgo-git-miou.opam @@ -1,7 +1,7 @@ # This file is generated by dune, edit dune-project instead opam-version: "2.0" synopsis: - "A Git provider for Vcs based on Vcs_git_provider for Miou programs" + "A Git provider for Vcs based on Volgo_git_backend for Miou programs" maintainer: ["Mathieu Barbin "] authors: ["Mathieu Barbin"] license: "LGPL-3.0-or-later WITH LGPL-3.0-linking-exception" @@ -14,14 +14,13 @@ depends: [ "miou" {>= "0.3.0"} "fpath" {>= "0.7.3"} "fpath-sexp0" {>= "0.2.2"} - "ppx_sexp_conv" {>= "v0.17" & < "v0.18"} - "ppx_sexp_value" {>= "v0.17" & < "v0.18"} + "ppx_sexp_conv" {>= "v0.17"} + "ppx_sexp_value" {>= "v0.17"} "ppxlib" {>= "0.33"} - "provider" {>= "0.0.11"} - "sexplib0" {>= "v0.17" & < "v0.18"} - "vcs" {= version} - "vcs-git-blocking" {= version} - "vcs-git-provider" {= version} + "sexplib0" {>= "v0.17"} + "volgo" {= version} + "volgo-git-backend" {= version} + "volgo-git-unix" {= version} "odoc" {with-doc} ] build: [ diff --git a/vcs-git-miou.opam.template b/volgo-git-miou.opam.template similarity index 100% rename from vcs-git-miou.opam.template rename to volgo-git-miou.opam.template diff --git a/volgo-tests.opam b/volgo-tests.opam index 5d7e55a4..aef7510e 100644 --- a/volgo-tests.opam +++ b/volgo-tests.opam @@ -1,6 +1,6 @@ # This file is generated by dune, edit dune-project instead opam-version: "2.0" -synopsis: "Tests & Examples for [Vcs]" +synopsis: "Tests & Examples for volgo" maintainer: ["Mathieu Barbin "] authors: ["Mathieu Barbin"] license: "LGPL-3.0-or-later WITH LGPL-3.0-linking-exception" @@ -16,9 +16,6 @@ depends: [ "base_quickcheck" {>= "v0.17" & < "v0.18"} "bisect_ppx" {with-dev-setup & >= "2.8.3"} "cmdlang" {>= "0.0.9"} - "cmdlang-cmdliner-runner" {>= "0.0.8"} - "cmdlang-to-cmdliner" {>= "0.0.9"} - "cmdliner" {>= "1.3.0"} "core" {>= "v0.17" & < "v0.18"} "eio" {>= "1.0"} "eio_main" {>= "1.0"} @@ -27,7 +24,8 @@ depends: [ "fpath-base" {>= "0.2.2"} "fpath-sexp0" {>= "0.2.2"} "mdx" {with-doc & >= "2.4"} - "pp-log" {>= "0.0.8"} + "pp" {>= "2.0.0"} + "pplumbing" {>= "0.0.13"} "ppx_compare" {>= "v0.17" & < "v0.18"} "ppx_enumerate" {>= "v0.17" & < "v0.18"} "ppx_expect" {>= "v0.17" & < "v0.18"} @@ -39,17 +37,18 @@ depends: [ "ppx_sexp_message" {>= "v0.17" & < "v0.18"} "ppx_sexp_value" {>= "v0.17" & < "v0.18"} "ppxlib" {>= "0.33"} - "provider" {>= "0.0.11"} "re" {>= "1.8.0"} "sexp_pretty" {>= "v0.17" & < "v0.18"} + "shexp" {>= "v0.17" & < "v0.18"} "stdio" {>= "v0.17" & < "v0.18"} - "vcs" {= version} - "vcs-base" {= version} - "vcs-command" {= version} - "vcs-git-blocking" {= version} - "vcs-git-eio" {= version} - "vcs-git-provider" {= version} "vcs-test-helpers" {= version} + "volgo" {= version} + "volgo-base" {= version} + "volgo-git-backend" {= version} + "volgo-git-eio" {= version} + "volgo-git-miou" {= version} + "volgo-git-unix" {= version} + "volgo-vcs" {= version} "sherlodoc" {with-doc & >= "0.2"} "odoc" {with-doc} ] From 7ac6e87d8801f744b76a01cb0d94353ace0db520 Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Mon, 26 May 2025 14:39:19 +0200 Subject: [PATCH 05/15] Typo --- lib/volgo_git_miou/src/volgo_git_miou.mli | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/volgo_git_miou/src/volgo_git_miou.mli b/lib/volgo_git_miou/src/volgo_git_miou.mli index 49d3d8eb..0bafaf16 100644 --- a/lib/volgo_git_miou/src/volgo_git_miou.mli +++ b/lib/volgo_git_miou/src/volgo_git_miou.mli @@ -20,12 +20,12 @@ (*_******************************************************************************) (** Implementation of a git backend for the {!module:Volgo.Vcs} library, based - on [Miou], and {!module:Vcs_git_backend}. + on [Miou], and {!module:Volgo_git_backend}. This implementation is based on the [git] command line tool. We run it as an external program with utils from [Stdlib] and [Unix], producing the right command line invocation and parsing the output to produce a typed version of - the expected results with [Vcs_git_backend]. Note that [git] must be found + the expected results with [Volgo_git_backend]. Note that [git] must be found in the PATH of the running environment. The current implementation runs blocking calls with [Miou.call], and then From 9fee4f42d3d7200ebb3771fe189b615b98ba4670 Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Mon, 26 May 2025 14:42:13 +0200 Subject: [PATCH 06/15] Remove leftover --- lib/volgo_git_miou/src/dune | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/volgo_git_miou/src/dune b/lib/volgo_git_miou/src/dune index f156d04d..443f8753 100644 --- a/lib/volgo_git_miou/src/dune +++ b/lib/volgo_git_miou/src/dune @@ -19,7 +19,6 @@ fpath fpath-sexp0 miou - provider sexplib0 volgo volgo-git-backend From 26d5b7bf07f338002d731cef68708d9673f943ef Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Mon, 26 May 2025 14:46:50 +0200 Subject: [PATCH 07/15] Tweak names --- lib/volgo_git_miou/test/test__no_domain_available.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/volgo_git_miou/test/test__no_domain_available.ml b/lib/volgo_git_miou/test/test__no_domain_available.ml index 23d7d45e..a18cb1d4 100644 --- a/lib/volgo_git_miou/test/test__no_domain_available.ml +++ b/lib/volgo_git_miou/test/test__no_domain_available.ml @@ -23,7 +23,7 @@ to run the blocking calls to git. In this test we monitor what happens if there is no such domain available. *) -let%expect_test "hello commit" = +let%expect_test "domains:0" = Miou_unix.run ~domains:0 @@ fun () -> let vcs = Volgo_git_miou.create () in @@ -37,7 +37,7 @@ let%expect_test "hello commit" = within a call to [Miou.call] when there is no other domain available. This should be considered a programming error. *) -let%expect_test "hello commit" = +let%expect_test "domains:1" = Miou_unix.run ~domains:1 @@ fun () -> let vcs = Volgo_git_miou.create () in From e96b0dfe12c89f2db81955100235fd79c38b9f40 Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Mon, 26 May 2025 15:11:00 +0200 Subject: [PATCH 08/15] Revert to older implementation (unix) --- lib/volgo_git_miou/src/import.ml | 22 +++ lib/volgo_git_miou/src/import.mli | 22 +++ lib/volgo_git_miou/src/runtime.ml | 169 +++++++++++++++++- lib/volgo_git_miou/test/test__hello_commit.ml | 6 +- .../test/test__no_domain_available.ml | 21 ++- lib/volgo_git_miou/test/test__no_run.ml | 9 +- 6 files changed, 233 insertions(+), 16 deletions(-) create mode 100644 lib/volgo_git_miou/src/import.ml create mode 100644 lib/volgo_git_miou/src/import.mli diff --git a/lib/volgo_git_miou/src/import.ml b/lib/volgo_git_miou/src/import.ml new file mode 100644 index 00000000..10303866 --- /dev/null +++ b/lib/volgo_git_miou/src/import.ml @@ -0,0 +1,22 @@ +(*******************************************************************************) +(* Volgo - a Versatile OCaml Library for Git Operations *) +(* Copyright (C) 2024-2025 Mathieu Barbin *) +(* *) +(* This file is part of Volgo. *) +(* *) +(* Volgo is free software; you can redistribute it and/or modify it under *) +(* the terms of the GNU Lesser General Public License as published by the *) +(* Free Software Foundation either version 3 of the License, or any later *) +(* version, with the LGPL-3.0 Linking Exception. *) +(* *) +(* Volgo is distributed in the hope that it will be useful, but WITHOUT ANY *) +(* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *) +(* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *) +(* the file `NOTICE.md` at the root of this repository for more details. *) +(* *) +(* You should have received a copy of the GNU Lesser General Public License *) +(* and the LGPL-3.0 Linking Exception along with this library. If not, see *) +(* and , respectively. *) +(*******************************************************************************) + +include Vcs.Private.Import diff --git a/lib/volgo_git_miou/src/import.mli b/lib/volgo_git_miou/src/import.mli new file mode 100644 index 00000000..cd250adb --- /dev/null +++ b/lib/volgo_git_miou/src/import.mli @@ -0,0 +1,22 @@ +(*_******************************************************************************) +(*_ Volgo - a Versatile OCaml Library for Git Operations *) +(*_ Copyright (C) 2024-2025 Mathieu Barbin *) +(*_ *) +(*_ This file is part of Volgo. *) +(*_ *) +(*_ Volgo is free software; you can redistribute it and/or modify it under *) +(*_ the terms of the GNU Lesser General Public License as published by the *) +(*_ Free Software Foundation either version 3 of the License, or any later *) +(*_ version, with the LGPL-3.0 Linking Exception. *) +(*_ *) +(*_ Volgo is distributed in the hope that it will be useful, but WITHOUT ANY *) +(*_ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *) +(*_ FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *) +(*_ the file `NOTICE.md` at the root of this repository for more details. *) +(*_ *) +(*_ You should have received a copy of the GNU Lesser General Public License *) +(*_ and the LGPL-3.0 Linking Exception along with this library. If not, see *) +(*_ and , respectively. *) +(*_******************************************************************************) + +include module type of Vcs.Private.Import diff --git a/lib/volgo_git_miou/src/runtime.ml b/lib/volgo_git_miou/src/runtime.ml index d271ae0a..dda8734e 100644 --- a/lib/volgo_git_miou/src/runtime.ml +++ b/lib/volgo_git_miou/src/runtime.ml @@ -19,19 +19,170 @@ (* and , respectively. *) (*******************************************************************************) -module Impl = Volgo_git_unix.Runtime +(* + {[ + module Impl = Volgo_git_unix.Runtime -type t = Impl.t + type t = Impl.t -let create () = Impl.create () -let load_file t ~path = Miou.call (fun () -> Impl.load_file t ~path) |> Miou.await_exn + let create () = Impl.create () + let load_file t ~path = Miou.call (fun () -> Impl.load_file t ~path) |> Miou.await_exn -let save_file t ?perms () ~path ~file_contents = - Miou.call (fun () -> Impl.save_file t ?perms () ~path ~file_contents) |> Miou.await_exn + let save_file t ?perms () ~path ~file_contents = + Miou.call (fun () -> Impl.save_file t ?perms () ~path ~file_contents) + |> Miou.await_exn + ;; + + let read_dir t ~dir = Miou.call (fun () -> Impl.read_dir t ~dir) |> Miou.await_exn + + let git ?env t ~cwd ~args ~f = + Miou.call (fun () -> Impl.git ?env t ~cwd ~args ~f) |> Miou.await_exn + ;; + ]} +*) + +open! Import + +type t = unit + +let create () = () + +let load_file () ~path = + Vcs.Private.try_with (fun () -> + In_channel.with_open_bin (Absolute_path.to_string path) In_channel.input_all + |> Vcs.File_contents.create) +;; + +let save_file (_ : t) ?(perms = 0o666) () ~path ~(file_contents : Vcs.File_contents.t) = + Vcs.Private.try_with (fun () -> + let oc = + open_out_gen + [ Open_wronly; Open_creat; Open_trunc; Open_binary ] + perms + (Absolute_path.to_string path) + in + Fun.protect + ~finally:(fun () -> close_out_noerr oc) + (fun () -> Out_channel.output_string oc (file_contents :> string))) +;; + +let read_dir () ~dir = + Vcs.Private.try_with (fun () -> + let entries = Sys.readdir (Absolute_path.to_string dir) in + Array.sort entries ~compare:String.compare; + entries |> Array.map ~f:Fsegment.v |> Array.to_list) +;; + +let with_cwd ~cwd ~f = + let old_cwd = Unix.getcwd () in + Fun.protect + ~finally:(fun () -> Unix.chdir old_cwd) + (fun () -> + Unix.chdir (Absolute_path.to_string cwd); + f ()) ;; -let read_dir t ~dir = Miou.call (fun () -> Impl.read_dir t ~dir) |> Miou.await_exn +module Exit_status = struct + [@@@coverage off] + + type t = + [ `Exited of int + | `Signaled of int + | `Stopped of int + | `Unknown + ] + [@@deriving sexp_of] +end + +module Lines = struct + type t = string list + + let sexp_of_t (t : t) = + match t with + | [] -> [%sexp ""] + | [ hd ] -> [%sexp (hd : string)] + | _ :: _ :: _ as lines -> [%sexp (lines : string list)] + ;; + + let create string : t = String.split_lines string +end + +exception Uncaught_user_exn of exn * Printexc.raw_backtrace + +let git ?env () ~cwd ~args ~f = + let prog = "git" in + let env = + match env with + | None -> Unix.environment () + | Some env -> env [@coverage off] + in + let exit_status_r : Exit_status.t ref = ref `Unknown in + let stdout_r = ref "" in + let stderr_r = ref "" in + try + let process_status, stdout, stderr = + with_cwd ~cwd ~f:(fun () -> + let ((stdout, _, stderr) as process_full) = + Unix.open_process_args_full prog (Array.of_list (prog :: args)) env + in + let stdout = In_channel.input_all stdout in + stdout_r := stdout; + let stderr = In_channel.input_all stderr in + stderr_r := stderr; + let process_status = Unix.close_process_full process_full in + process_status, stdout, stderr) + in + let exit_status = + match process_status with + | Unix.WEXITED n -> `Exited n + | Unix.WSIGNALED n -> `Signaled n [@coverage off] + | Unix.WSTOPPED n -> `Stopped n [@coverage off] + in + exit_status_r := exit_status; + let exit_code = + match exit_status with + | `Exited n -> n + | (`Signaled _ | `Stopped _) as exit_status -> + raise_notrace + (Err.E + (Err.create + [ Err.sexp + [%sexp + "git process terminated abnormally" + , { exit_status : [ `Signaled of int | `Stopped of int ] }] + ])) [@coverage off] + in + (* A note regarding the [raise_notrace] below. These cases are indeed + exercised in the test suite, however bisect_ppx inserts a coverage point + on the outer edge of the calls, defeating the coverage reports. Thus we + have to manually disable coverage. -let git ?env t ~cwd ~args ~f = - Miou.call (fun () -> Impl.git ?env t ~cwd ~args ~f) |> Miou.await_exn + Illustrating what the inserted unvisitable coverage point looks like: + {[ + ___bisect_post_visit___ 36 (raise_notrace (Vcs.E err)) + ]} + *) + match f { Vcs.Git.Output.exit_code; stdout; stderr } with + | Ok _ as ok -> ok + | Error err -> raise_notrace (Err.E err) [@coverage off] + | exception exn -> + let bt = Printexc.get_raw_backtrace () in + (raise_notrace (Uncaught_user_exn (exn, bt)) [@coverage off]) + with + | Uncaught_user_exn (exn, bt) -> Printexc.raise_with_backtrace exn bt + | exn -> + let err = Err.of_exn exn in + Error + (Err.add_context + err + [ Err.sexp + [%sexp + { prog : string + ; args : string list + ; exit_status = (!exit_status_r : Exit_status.t) + ; cwd : Absolute_path.t + ; stdout = (Lines.create !stdout_r : Lines.t) + ; stderr = (Lines.create !stderr_r : Lines.t) + }] + ]) ;; diff --git a/lib/volgo_git_miou/test/test__hello_commit.ml b/lib/volgo_git_miou/test/test__hello_commit.ml index 87ab8fad..0dc6ab5a 100644 --- a/lib/volgo_git_miou/test/test__hello_commit.ml +++ b/lib/volgo_git_miou/test/test__hello_commit.ml @@ -84,8 +84,8 @@ let%expect_test "hello commit" = | Error exn -> raise exn [@coverage off]); [%expect {| - main - (hello.txt) - |}]; + main + (hello.txt) + |}]; () ;; diff --git a/lib/volgo_git_miou/test/test__no_domain_available.ml b/lib/volgo_git_miou/test/test__no_domain_available.ml index a18cb1d4..5b12cdba 100644 --- a/lib/volgo_git_miou/test/test__no_domain_available.ml +++ b/lib/volgo_git_miou/test/test__no_domain_available.ml @@ -28,8 +28,16 @@ let%expect_test "domains:0" = @@ fun () -> let vcs = Volgo_git_miou.create () in require_does_raise [%here] (fun () -> - Vcs_test_helpers.init vcs ~path:(Absolute_path.v (Unix.getcwd ()))); - [%expect {| (Miou.No_domain_available) |}]; + let path = Stdlib.Filename.temp_dir ~temp_dir:(Unix.getcwd ()) "vcs" "test" in + Vcs_test_helpers.init vcs ~path:(Absolute_path.v path)); + [%expect + {| + (* CR require-failed: lib/volgo_git_miou/test/test__no_domain_available.ml:30:21. + Do not 'X' this CR; instead make the required property true, + which will make the CR disappear. For more information, see + [Expect_test_helpers_base.require]. *) + "did not raise" + |}]; () ;; @@ -62,6 +70,13 @@ let%expect_test "domains:1" = ~path:(Vcs.Repo_root.append repo_root hello_file) ~file_contents:(Vcs.File_contents.create "Hello World Again!")) |> Miou.await_exn); - [%expect {| (Miou.No_domain_available) |}]; + [%expect + {| + (* CR require-failed: lib/volgo_git_miou/test/test__no_domain_available.ml:65:21. + Do not 'X' this CR; instead make the required property true, + which will make the CR disappear. For more information, see + [Expect_test_helpers_base.require]. *) + "did not raise" + |}]; () ;; diff --git a/lib/volgo_git_miou/test/test__no_run.ml b/lib/volgo_git_miou/test/test__no_run.ml index 5198dd19..11ca8df5 100644 --- a/lib/volgo_git_miou/test/test__no_run.ml +++ b/lib/volgo_git_miou/test/test__no_run.ml @@ -25,6 +25,13 @@ let%expect_test "hello commit" = let vcs = Volgo_git_miou.create () in require_does_raise [%here] (fun () -> Vcs_test_helpers.init vcs ~path:(Absolute_path.v (Unix.getcwd ()))); - [%expect {| ("Stdlib.Effect.Unhandled(Miou.Domains)") |}]; + [%expect + {| + (* CR require-failed: lib/volgo_git_miou/test/test__no_run.ml:26:21. + Do not 'X' this CR; instead make the required property true, + which will make the CR disappear. For more information, see + [Expect_test_helpers_base.require]. *) + "did not raise" + |}]; () ;; From 6c401ffb0bc091b1f50645c44de6acc7a0cfc409 Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Mon, 26 May 2025 15:12:34 +0200 Subject: [PATCH 09/15] Call and await --- lib/volgo_git_miou/src/runtime.ml | 6 +++++- lib/volgo_git_miou/test/test__no_domain_available.ml | 10 ++-------- lib/volgo_git_miou/test/test__no_run.ml | 8 +------- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/lib/volgo_git_miou/src/runtime.ml b/lib/volgo_git_miou/src/runtime.ml index dda8734e..4748f62b 100644 --- a/lib/volgo_git_miou/src/runtime.ml +++ b/lib/volgo_git_miou/src/runtime.ml @@ -109,7 +109,7 @@ end exception Uncaught_user_exn of exn * Printexc.raw_backtrace -let git ?env () ~cwd ~args ~f = +let git_unix ?env (_ : t) ~cwd ~args ~f = let prog = "git" in let env = match env with @@ -186,3 +186,7 @@ let git ?env () ~cwd ~args ~f = }] ]) ;; + +let git ?env t ~cwd ~args ~f = + Miou.call (fun () -> git_unix ?env t ~cwd ~args ~f) |> Miou.await_exn +;; diff --git a/lib/volgo_git_miou/test/test__no_domain_available.ml b/lib/volgo_git_miou/test/test__no_domain_available.ml index 5b12cdba..41c101dc 100644 --- a/lib/volgo_git_miou/test/test__no_domain_available.ml +++ b/lib/volgo_git_miou/test/test__no_domain_available.ml @@ -31,13 +31,7 @@ let%expect_test "domains:0" = let path = Stdlib.Filename.temp_dir ~temp_dir:(Unix.getcwd ()) "vcs" "test" in Vcs_test_helpers.init vcs ~path:(Absolute_path.v path)); [%expect - {| - (* CR require-failed: lib/volgo_git_miou/test/test__no_domain_available.ml:30:21. - Do not 'X' this CR; instead make the required property true, - which will make the CR disappear. For more information, see - [Expect_test_helpers_base.require]. *) - "did not raise" - |}]; + {| (Miou.No_domain_available) |}]; () ;; @@ -72,7 +66,7 @@ let%expect_test "domains:1" = |> Miou.await_exn); [%expect {| - (* CR require-failed: lib/volgo_git_miou/test/test__no_domain_available.ml:65:21. + (* CR require-failed: lib/volgo_git_miou/test/test__no_domain_available.ml:60:21. Do not 'X' this CR; instead make the required property true, which will make the CR disappear. For more information, see [Expect_test_helpers_base.require]. *) diff --git a/lib/volgo_git_miou/test/test__no_run.ml b/lib/volgo_git_miou/test/test__no_run.ml index 11ca8df5..26cc5fe2 100644 --- a/lib/volgo_git_miou/test/test__no_run.ml +++ b/lib/volgo_git_miou/test/test__no_run.ml @@ -26,12 +26,6 @@ let%expect_test "hello commit" = require_does_raise [%here] (fun () -> Vcs_test_helpers.init vcs ~path:(Absolute_path.v (Unix.getcwd ()))); [%expect - {| - (* CR require-failed: lib/volgo_git_miou/test/test__no_run.ml:26:21. - Do not 'X' this CR; instead make the required property true, - which will make the CR disappear. For more information, see - [Expect_test_helpers_base.require]. *) - "did not raise" - |}]; + {| ("Stdlib.Effect.Unhandled(Miou.Domains)") |}]; () ;; From 979adef75f5b1cd3a38a9d71f32242cbbf0bdd78 Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Mon, 26 May 2025 15:14:49 +0200 Subject: [PATCH 10/15] Back to tests passing - Issue remains with cwd that will not work properly with multiple domains in parallel. --- lib/volgo_git_miou/src/runtime.ml | 21 ++++++++++++++++--- .../test/test__no_domain_available.ml | 12 ++--------- lib/volgo_git_miou/test/test__no_run.ml | 3 +-- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/lib/volgo_git_miou/src/runtime.ml b/lib/volgo_git_miou/src/runtime.ml index 4748f62b..ffa55f09 100644 --- a/lib/volgo_git_miou/src/runtime.ml +++ b/lib/volgo_git_miou/src/runtime.ml @@ -47,13 +47,19 @@ type t = unit let create () = () -let load_file () ~path = +let load_file_internal () ~path = Vcs.Private.try_with (fun () -> In_channel.with_open_bin (Absolute_path.to_string path) In_channel.input_all |> Vcs.File_contents.create) ;; -let save_file (_ : t) ?(perms = 0o666) () ~path ~(file_contents : Vcs.File_contents.t) = +let save_file_internal + (_ : t) + ?(perms = 0o666) + () + ~path + ~(file_contents : Vcs.File_contents.t) + = Vcs.Private.try_with (fun () -> let oc = open_out_gen @@ -66,7 +72,7 @@ let save_file (_ : t) ?(perms = 0o666) () ~path ~(file_contents : Vcs.File_conte (fun () -> Out_channel.output_string oc (file_contents :> string))) ;; -let read_dir () ~dir = +let read_dir_internal () ~dir = Vcs.Private.try_with (fun () -> let entries = Sys.readdir (Absolute_path.to_string dir) in Array.sort entries ~compare:String.compare; @@ -187,6 +193,15 @@ let git_unix ?env (_ : t) ~cwd ~args ~f = ]) ;; +let load_file t ~path = Miou.call (fun () -> load_file_internal t ~path) |> Miou.await_exn + +let save_file t ?perms () ~path ~file_contents = + Miou.call (fun () -> save_file_internal t ?perms () ~path ~file_contents) + |> Miou.await_exn +;; + +let read_dir t ~dir = Miou.call (fun () -> read_dir_internal t ~dir) |> Miou.await_exn + let git ?env t ~cwd ~args ~f = Miou.call (fun () -> git_unix ?env t ~cwd ~args ~f) |> Miou.await_exn ;; diff --git a/lib/volgo_git_miou/test/test__no_domain_available.ml b/lib/volgo_git_miou/test/test__no_domain_available.ml index 41c101dc..8b783b09 100644 --- a/lib/volgo_git_miou/test/test__no_domain_available.ml +++ b/lib/volgo_git_miou/test/test__no_domain_available.ml @@ -30,8 +30,7 @@ let%expect_test "domains:0" = require_does_raise [%here] (fun () -> let path = Stdlib.Filename.temp_dir ~temp_dir:(Unix.getcwd ()) "vcs" "test" in Vcs_test_helpers.init vcs ~path:(Absolute_path.v path)); - [%expect - {| (Miou.No_domain_available) |}]; + [%expect {| (Miou.No_domain_available) |}]; () ;; @@ -64,13 +63,6 @@ let%expect_test "domains:1" = ~path:(Vcs.Repo_root.append repo_root hello_file) ~file_contents:(Vcs.File_contents.create "Hello World Again!")) |> Miou.await_exn); - [%expect - {| - (* CR require-failed: lib/volgo_git_miou/test/test__no_domain_available.ml:60:21. - Do not 'X' this CR; instead make the required property true, - which will make the CR disappear. For more information, see - [Expect_test_helpers_base.require]. *) - "did not raise" - |}]; + [%expect {| (Miou.No_domain_available) |}]; () ;; diff --git a/lib/volgo_git_miou/test/test__no_run.ml b/lib/volgo_git_miou/test/test__no_run.ml index 26cc5fe2..5198dd19 100644 --- a/lib/volgo_git_miou/test/test__no_run.ml +++ b/lib/volgo_git_miou/test/test__no_run.ml @@ -25,7 +25,6 @@ let%expect_test "hello commit" = let vcs = Volgo_git_miou.create () in require_does_raise [%here] (fun () -> Vcs_test_helpers.init vcs ~path:(Absolute_path.v (Unix.getcwd ()))); - [%expect - {| ("Stdlib.Effect.Unhandled(Miou.Domains)") |}]; + [%expect {| ("Stdlib.Effect.Unhandled(Miou.Domains)") |}]; () ;; From e1af733cd4d043ad2540827afb84fcb19909f081 Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Mon, 26 May 2025 15:16:42 +0200 Subject: [PATCH 11/15] Update headers --- lib/volgo_git_miou/src/runtime.ml | 10 +++++----- lib/volgo_git_miou/src/runtime.mli | 10 +++++----- lib/volgo_git_miou/src/volgo_git_miou.ml | 10 +++++----- lib/volgo_git_miou/src/volgo_git_miou.mli | 10 +++++----- lib/volgo_git_miou/test/test__hello_commit.ml | 10 +++++----- lib/volgo_git_miou/test/test__hello_commit.mli | 10 +++++----- lib/volgo_git_miou/test/test__no_domain_available.ml | 10 +++++----- lib/volgo_git_miou/test/test__no_domain_available.mli | 10 +++++----- lib/volgo_git_miou/test/test__no_run.ml | 10 +++++----- lib/volgo_git_miou/test/test__no_run.mli | 10 +++++----- 10 files changed, 50 insertions(+), 50 deletions(-) diff --git a/lib/volgo_git_miou/src/runtime.ml b/lib/volgo_git_miou/src/runtime.ml index ffa55f09..8450699f 100644 --- a/lib/volgo_git_miou/src/runtime.ml +++ b/lib/volgo_git_miou/src/runtime.ml @@ -1,15 +1,15 @@ (*******************************************************************************) -(* Vcs - a Versatile OCaml Library for Git Operations *) -(* Copyright (C) 2024 Mathieu Barbin *) +(* Volgo - a Versatile OCaml Library for Git Operations *) +(* Copyright (C) 2024-2025 Mathieu Barbin *) (* *) -(* This file is part of Vcs. *) +(* This file is part of Volgo. *) (* *) -(* Vcs is free software; you can redistribute it and/or modify it under *) +(* Volgo is free software; you can redistribute it and/or modify it under *) (* the terms of the GNU Lesser General Public License as published by the *) (* Free Software Foundation either version 3 of the License, or any later *) (* version, with the LGPL-3.0 Linking Exception. *) (* *) -(* Vcs is distributed in the hope that it will be useful, but WITHOUT ANY *) +(* Volgo is distributed in the hope that it will be useful, but WITHOUT ANY *) (* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *) (* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *) (* the file `NOTICE.md` at the root of this repository for more details. *) diff --git a/lib/volgo_git_miou/src/runtime.mli b/lib/volgo_git_miou/src/runtime.mli index 62394163..bbf0e10e 100644 --- a/lib/volgo_git_miou/src/runtime.mli +++ b/lib/volgo_git_miou/src/runtime.mli @@ -1,15 +1,15 @@ (*_******************************************************************************) -(*_ Vcs - a Versatile OCaml Library for Git Operations *) -(*_ Copyright (C) 2024 Mathieu Barbin *) +(*_ Volgo - a Versatile OCaml Library for Git Operations *) +(*_ Copyright (C) 2024-2025 Mathieu Barbin *) (*_ *) -(*_ This file is part of Vcs. *) +(*_ This file is part of Volgo. *) (*_ *) -(*_ Vcs is free software; you can redistribute it and/or modify it under *) +(*_ Volgo is free software; you can redistribute it and/or modify it under *) (*_ the terms of the GNU Lesser General Public License as published by the *) (*_ Free Software Foundation either version 3 of the License, or any later *) (*_ version, with the LGPL-3.0 Linking Exception. *) (*_ *) -(*_ Vcs is distributed in the hope that it will be useful, but WITHOUT ANY *) +(*_ Volgo is distributed in the hope that it will be useful, but WITHOUT ANY *) (*_ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *) (*_ FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *) (*_ the file `NOTICE.md` at the root of this repository for more details. *) diff --git a/lib/volgo_git_miou/src/volgo_git_miou.ml b/lib/volgo_git_miou/src/volgo_git_miou.ml index 992f34bb..e92ef451 100644 --- a/lib/volgo_git_miou/src/volgo_git_miou.ml +++ b/lib/volgo_git_miou/src/volgo_git_miou.ml @@ -1,15 +1,15 @@ (*******************************************************************************) -(* Vcs - a Versatile OCaml Library for Git Operations *) -(* Copyright (C) 2024 Mathieu Barbin *) +(* Volgo - a Versatile OCaml Library for Git Operations *) +(* Copyright (C) 2024-2025 Mathieu Barbin *) (* *) -(* This file is part of Vcs. *) +(* This file is part of Volgo. *) (* *) -(* Vcs is free software; you can redistribute it and/or modify it under *) +(* Volgo is free software; you can redistribute it and/or modify it under *) (* the terms of the GNU Lesser General Public License as published by the *) (* Free Software Foundation either version 3 of the License, or any later *) (* version, with the LGPL-3.0 Linking Exception. *) (* *) -(* Vcs is distributed in the hope that it will be useful, but WITHOUT ANY *) +(* Volgo is distributed in the hope that it will be useful, but WITHOUT ANY *) (* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *) (* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *) (* the file `NOTICE.md` at the root of this repository for more details. *) diff --git a/lib/volgo_git_miou/src/volgo_git_miou.mli b/lib/volgo_git_miou/src/volgo_git_miou.mli index 0bafaf16..e8ead728 100644 --- a/lib/volgo_git_miou/src/volgo_git_miou.mli +++ b/lib/volgo_git_miou/src/volgo_git_miou.mli @@ -1,15 +1,15 @@ (*_******************************************************************************) -(*_ Vcs - a Versatile OCaml Library for Git Operations *) -(*_ Copyright (C) 2024 Mathieu Barbin *) +(*_ Volgo - a Versatile OCaml Library for Git Operations *) +(*_ Copyright (C) 2024-2025 Mathieu Barbin *) (*_ *) -(*_ This file is part of Vcs. *) +(*_ This file is part of Volgo. *) (*_ *) -(*_ Vcs is free software; you can redistribute it and/or modify it under *) +(*_ Volgo is free software; you can redistribute it and/or modify it under *) (*_ the terms of the GNU Lesser General Public License as published by the *) (*_ Free Software Foundation either version 3 of the License, or any later *) (*_ version, with the LGPL-3.0 Linking Exception. *) (*_ *) -(*_ Vcs is distributed in the hope that it will be useful, but WITHOUT ANY *) +(*_ Volgo is distributed in the hope that it will be useful, but WITHOUT ANY *) (*_ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *) (*_ FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *) (*_ the file `NOTICE.md` at the root of this repository for more details. *) diff --git a/lib/volgo_git_miou/test/test__hello_commit.ml b/lib/volgo_git_miou/test/test__hello_commit.ml index 0dc6ab5a..5de33275 100644 --- a/lib/volgo_git_miou/test/test__hello_commit.ml +++ b/lib/volgo_git_miou/test/test__hello_commit.ml @@ -1,15 +1,15 @@ (*******************************************************************************) -(* Vcs - a Versatile OCaml Library for Git Operations *) -(* Copyright (C) 2024 Mathieu Barbin *) +(* Volgo - a Versatile OCaml Library for Git Operations *) +(* Copyright (C) 2024-2025 Mathieu Barbin *) (* *) -(* This file is part of Vcs. *) +(* This file is part of Volgo. *) (* *) -(* Vcs is free software; you can redistribute it and/or modify it under *) +(* Volgo is free software; you can redistribute it and/or modify it under *) (* the terms of the GNU Lesser General Public License as published by the *) (* Free Software Foundation either version 3 of the License, or any later *) (* version, with the LGPL-3.0 Linking Exception. *) (* *) -(* Vcs is distributed in the hope that it will be useful, but WITHOUT ANY *) +(* Volgo is distributed in the hope that it will be useful, but WITHOUT ANY *) (* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *) (* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *) (* the file `NOTICE.md` at the root of this repository for more details. *) diff --git a/lib/volgo_git_miou/test/test__hello_commit.mli b/lib/volgo_git_miou/test/test__hello_commit.mli index 45af050a..db7d84c3 100644 --- a/lib/volgo_git_miou/test/test__hello_commit.mli +++ b/lib/volgo_git_miou/test/test__hello_commit.mli @@ -1,15 +1,15 @@ (*_******************************************************************************) -(*_ Vcs - a Versatile OCaml Library for Git Operations *) -(*_ Copyright (C) 2024 Mathieu Barbin *) +(*_ Volgo - a Versatile OCaml Library for Git Operations *) +(*_ Copyright (C) 2024-2025 Mathieu Barbin *) (*_ *) -(*_ This file is part of Vcs. *) +(*_ This file is part of Volgo. *) (*_ *) -(*_ Vcs is free software; you can redistribute it and/or modify it under *) +(*_ Volgo is free software; you can redistribute it and/or modify it under *) (*_ the terms of the GNU Lesser General Public License as published by the *) (*_ Free Software Foundation either version 3 of the License, or any later *) (*_ version, with the LGPL-3.0 Linking Exception. *) (*_ *) -(*_ Vcs is distributed in the hope that it will be useful, but WITHOUT ANY *) +(*_ Volgo is distributed in the hope that it will be useful, but WITHOUT ANY *) (*_ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *) (*_ FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *) (*_ the file `NOTICE.md` at the root of this repository for more details. *) diff --git a/lib/volgo_git_miou/test/test__no_domain_available.ml b/lib/volgo_git_miou/test/test__no_domain_available.ml index 8b783b09..3aaf90fd 100644 --- a/lib/volgo_git_miou/test/test__no_domain_available.ml +++ b/lib/volgo_git_miou/test/test__no_domain_available.ml @@ -1,15 +1,15 @@ (*******************************************************************************) -(* Vcs - a Versatile OCaml Library for Git Operations *) -(* Copyright (C) 2024 Mathieu Barbin *) +(* Volgo - a Versatile OCaml Library for Git Operations *) +(* Copyright (C) 2024-2025 Mathieu Barbin *) (* *) -(* This file is part of Vcs. *) +(* This file is part of Volgo. *) (* *) -(* Vcs is free software; you can redistribute it and/or modify it under *) +(* Volgo is free software; you can redistribute it and/or modify it under *) (* the terms of the GNU Lesser General Public License as published by the *) (* Free Software Foundation either version 3 of the License, or any later *) (* version, with the LGPL-3.0 Linking Exception. *) (* *) -(* Vcs is distributed in the hope that it will be useful, but WITHOUT ANY *) +(* Volgo is distributed in the hope that it will be useful, but WITHOUT ANY *) (* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *) (* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *) (* the file `NOTICE.md` at the root of this repository for more details. *) diff --git a/lib/volgo_git_miou/test/test__no_domain_available.mli b/lib/volgo_git_miou/test/test__no_domain_available.mli index 45af050a..db7d84c3 100644 --- a/lib/volgo_git_miou/test/test__no_domain_available.mli +++ b/lib/volgo_git_miou/test/test__no_domain_available.mli @@ -1,15 +1,15 @@ (*_******************************************************************************) -(*_ Vcs - a Versatile OCaml Library for Git Operations *) -(*_ Copyright (C) 2024 Mathieu Barbin *) +(*_ Volgo - a Versatile OCaml Library for Git Operations *) +(*_ Copyright (C) 2024-2025 Mathieu Barbin *) (*_ *) -(*_ This file is part of Vcs. *) +(*_ This file is part of Volgo. *) (*_ *) -(*_ Vcs is free software; you can redistribute it and/or modify it under *) +(*_ Volgo is free software; you can redistribute it and/or modify it under *) (*_ the terms of the GNU Lesser General Public License as published by the *) (*_ Free Software Foundation either version 3 of the License, or any later *) (*_ version, with the LGPL-3.0 Linking Exception. *) (*_ *) -(*_ Vcs is distributed in the hope that it will be useful, but WITHOUT ANY *) +(*_ Volgo is distributed in the hope that it will be useful, but WITHOUT ANY *) (*_ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *) (*_ FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *) (*_ the file `NOTICE.md` at the root of this repository for more details. *) diff --git a/lib/volgo_git_miou/test/test__no_run.ml b/lib/volgo_git_miou/test/test__no_run.ml index 5198dd19..19fef0fd 100644 --- a/lib/volgo_git_miou/test/test__no_run.ml +++ b/lib/volgo_git_miou/test/test__no_run.ml @@ -1,15 +1,15 @@ (*******************************************************************************) -(* Vcs - a Versatile OCaml Library for Git Operations *) -(* Copyright (C) 2024 Mathieu Barbin *) +(* Volgo - a Versatile OCaml Library for Git Operations *) +(* Copyright (C) 2024-2025 Mathieu Barbin *) (* *) -(* This file is part of Vcs. *) +(* This file is part of Volgo. *) (* *) -(* Vcs is free software; you can redistribute it and/or modify it under *) +(* Volgo is free software; you can redistribute it and/or modify it under *) (* the terms of the GNU Lesser General Public License as published by the *) (* Free Software Foundation either version 3 of the License, or any later *) (* version, with the LGPL-3.0 Linking Exception. *) (* *) -(* Vcs is distributed in the hope that it will be useful, but WITHOUT ANY *) +(* Volgo is distributed in the hope that it will be useful, but WITHOUT ANY *) (* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *) (* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *) (* the file `NOTICE.md` at the root of this repository for more details. *) diff --git a/lib/volgo_git_miou/test/test__no_run.mli b/lib/volgo_git_miou/test/test__no_run.mli index 45af050a..db7d84c3 100644 --- a/lib/volgo_git_miou/test/test__no_run.mli +++ b/lib/volgo_git_miou/test/test__no_run.mli @@ -1,15 +1,15 @@ (*_******************************************************************************) -(*_ Vcs - a Versatile OCaml Library for Git Operations *) -(*_ Copyright (C) 2024 Mathieu Barbin *) +(*_ Volgo - a Versatile OCaml Library for Git Operations *) +(*_ Copyright (C) 2024-2025 Mathieu Barbin *) (*_ *) -(*_ This file is part of Vcs. *) +(*_ This file is part of Volgo. *) (*_ *) -(*_ Vcs is free software; you can redistribute it and/or modify it under *) +(*_ Volgo is free software; you can redistribute it and/or modify it under *) (*_ the terms of the GNU Lesser General Public License as published by the *) (*_ Free Software Foundation either version 3 of the License, or any later *) (*_ version, with the LGPL-3.0 Linking Exception. *) (*_ *) -(*_ Vcs is distributed in the hope that it will be useful, but WITHOUT ANY *) +(*_ Volgo is distributed in the hope that it will be useful, but WITHOUT ANY *) (*_ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *) (*_ FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *) (*_ the file `NOTICE.md` at the root of this repository for more details. *) From ec51c3afe08cc5f6a5ec44a28bce606d103d10bc Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Tue, 27 May 2025 13:21:50 +0200 Subject: [PATCH 12/15] Add miou package to test CI --- .github/workflows/more-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/more-ci.yml b/.github/workflows/more-ci.yml index 07cb8e91..752c1604 100644 --- a/.github/workflows/more-ci.yml +++ b/.github/workflows/more-ci.yml @@ -58,7 +58,7 @@ jobs: # the development workflow and as part of the main CI job. These are the # tests that are checked for every combination of os and ocaml-compiler. - name: Install dependencies - run: opam install ./volgo.opam ./volgo-base.opam ./volgo-vcs.opam ./volgo-git-unix.opam ./volgo-git-eio.opam ./volgo-git-backend.opam ./vcs-test-helpers.opam ./volgo-tests.opam --deps-only --with-test + run: opam install ./volgo.opam ./volgo-base.opam ./volgo-vcs.opam ./volgo-git-unix.opam ./volgo-git-eio.opam ./volgo-git-miou.opam ./volgo-git-backend.opam ./vcs-test-helpers.opam ./volgo-tests.opam --deps-only --with-test - name: Build & Run tests - run: opam exec -- dune build @all @runtest -p volgo,volgo-base,volgo-vcs,volgo-git-unix,volgo-git-eio,volgo-git-backend,vcs-test-helpers,volgo-tests + run: opam exec -- dune build @all @runtest -p volgo,volgo-base,volgo-vcs,volgo-git-unix,volgo-git-eio,volgo-git-miou,volgo-git-backend,vcs-test-helpers,volgo-tests From 9a06331b506a5ddbe20d461aa4e4ccab802411f7 Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Tue, 27 May 2025 13:22:41 +0200 Subject: [PATCH 13/15] Fix missing dep --- lib/volgo_git_miou/src/dune | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/volgo_git_miou/src/dune b/lib/volgo_git_miou/src/dune index 443f8753..b0f75f33 100644 --- a/lib/volgo_git_miou/src/dune +++ b/lib/volgo_git_miou/src/dune @@ -20,6 +20,7 @@ fpath-sexp0 miou sexplib0 + unix volgo volgo-git-backend volgo-git-unix) From 4928fdd2a02bcf6d3f33e65b50653e65bece1379 Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Tue, 27 May 2025 13:36:20 +0200 Subject: [PATCH 14/15] Add more deps --- dune-project | 4 ++++ lib/volgo_git_miou/src/dune | 3 +++ lib/volgo_git_miou/test/dune | 3 +++ volgo-git-miou.opam | 2 ++ 4 files changed, 12 insertions(+) diff --git a/dune-project b/dune-project index 31780d18..83ddcf89 100644 --- a/dune-project +++ b/dune-project @@ -241,6 +241,10 @@ (>= 0.7.3)) (fpath-sexp0 (>= 0.2.2)) + (pp + (>= 2.0.0)) + (pplumbing + (>= 0.0.13)) (ppx_sexp_conv (>= v0.17)) (ppx_sexp_value diff --git a/lib/volgo_git_miou/src/dune b/lib/volgo_git_miou/src/dune index b0f75f33..ecd58c24 100644 --- a/lib/volgo_git_miou/src/dune +++ b/lib/volgo_git_miou/src/dune @@ -19,6 +19,9 @@ fpath fpath-sexp0 miou + pp + pplumbing.err + pplumbing.pp-tty sexplib0 unix volgo diff --git a/lib/volgo_git_miou/test/dune b/lib/volgo_git_miou/test/dune index c9065a11..dd7e527d 100644 --- a/lib/volgo_git_miou/test/dune +++ b/lib/volgo_git_miou/test/dune @@ -23,6 +23,9 @@ fpath-sexp0 miou miou.unix + pp + pplumbing.err + pplumbing.pp-tty unix vcs_test_helpers volgo diff --git a/volgo-git-miou.opam b/volgo-git-miou.opam index 7c390a18..6ef5bb09 100644 --- a/volgo-git-miou.opam +++ b/volgo-git-miou.opam @@ -14,6 +14,8 @@ depends: [ "miou" {>= "0.3.0"} "fpath" {>= "0.7.3"} "fpath-sexp0" {>= "0.2.2"} + "pp" {>= "2.0.0"} + "pplumbing" {>= "0.0.13"} "ppx_sexp_conv" {>= "v0.17"} "ppx_sexp_value" {>= "v0.17"} "ppxlib" {>= "0.33"} From 899c21922540b149a15d533a43dcf084f9c65450 Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Tue, 27 May 2025 13:49:01 +0200 Subject: [PATCH 15/15] Fix add missing dep --- dune-project | 4 ++++ volgo-dev.opam | 1 + volgo-tests.opam | 1 + 3 files changed, 6 insertions(+) diff --git a/dune-project b/dune-project index 83ddcf89..1fc41a9a 100644 --- a/dune-project +++ b/dune-project @@ -361,6 +361,8 @@ (and :with-doc (>= 2.4))) + (miou + (>= 0.3.0)) (pp (>= 2.0.0)) (pplumbing @@ -491,6 +493,8 @@ (>= 0.2.2)) (mdx (>= 2.4)) + (miou + (>= 0.3.0)) (pp (>= 2.0.0)) (pplumbing diff --git a/volgo-dev.opam b/volgo-dev.opam index efd065db..17570e93 100644 --- a/volgo-dev.opam +++ b/volgo-dev.opam @@ -25,6 +25,7 @@ depends: [ "fpath-base" {>= "0.2.2"} "fpath-sexp0" {>= "0.2.2"} "mdx" {>= "2.4"} + "miou" {>= "0.3.0"} "pp" {>= "2.0.0"} "pplumbing" {>= "0.0.13"} "ppx_compare" {>= "v0.17" & < "v0.18"} diff --git a/volgo-tests.opam b/volgo-tests.opam index aef7510e..7f2d13d6 100644 --- a/volgo-tests.opam +++ b/volgo-tests.opam @@ -24,6 +24,7 @@ depends: [ "fpath-base" {>= "0.2.2"} "fpath-sexp0" {>= "0.2.2"} "mdx" {with-doc & >= "2.4"} + "miou" {>= "0.3.0"} "pp" {>= "2.0.0"} "pplumbing" {>= "0.0.13"} "ppx_compare" {>= "v0.17" & < "v0.18"}