From 868fe4adbda6aec7313cb019f9093e470905ddd2 Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Sun, 29 Sep 2024 17:19:07 +0200 Subject: [PATCH 1/3] Reduce or_error default usage --- lib/vcs/src/dune | 4 +--- lib/vcs/src/for_test.ml | 1 + lib/vcs/src/vcs0.ml | 5 +++-- lib/vcs/test/dune | 4 +--- lib/vcs_arg/src/dune | 2 -- lib/vcs_git_eio/src/dune | 2 -- lib/vcs_git_eio/test/dune | 4 +--- lib/vcs_test_helpers/test/dune | 4 +--- test/expect/dune | 4 +--- test/expect/nonraising_unit_tests.ml | 5 +++-- 10 files changed, 12 insertions(+), 23 deletions(-) diff --git a/lib/vcs/src/dune b/lib/vcs/src/dune index c74c7da..da028f6 100644 --- a/lib/vcs/src/dune +++ b/lib/vcs/src/dune @@ -10,9 +10,7 @@ -open Base -open - Fpath_base - -open - Or_error.Let_syntax) + Fpath_base) (libraries base fpath fpath-base provider) (instrumentation (backend bisect_ppx)) diff --git a/lib/vcs/src/for_test.ml b/lib/vcs/src/for_test.ml index 2ce59e3..e6d2262 100644 --- a/lib/vcs/src/for_test.ml +++ b/lib/vcs/src/for_test.ml @@ -20,6 +20,7 @@ (*******************************************************************************) let init vcs ~path = + let open Or_error.Let_syntax in let%bind repo_root = Vcs_or_error.init vcs ~path in let%bind () = Vcs_or_error.set_user_name vcs ~repo_root ~user_name:(User_name.v "Test User") diff --git a/lib/vcs/src/vcs0.ml b/lib/vcs/src/vcs0.ml index 11c8b06..2438660 100644 --- a/lib/vcs/src/vcs0.ml +++ b/lib/vcs/src/vcs0.ml @@ -69,7 +69,7 @@ let current_revision (Provider.T { t; handler }) ~repo_root = let commit (Provider.T { t; handler }) ~repo_root ~commit_message = let module R = (val Provider.Handler.lookup handler ~trait:Trait.Rev_parse) in let module C = (val Provider.Handler.lookup handler ~trait:Trait.Commit) in - (let%bind () = C.commit t ~repo_root ~commit_message in + (let%bind.Or_error () = C.commit t ~repo_root ~commit_message in R.current_revision t ~repo_root) |> of_result ~step:(lazy [%sexp "Vcs.commit", { repo_root : Repo_root.t }]) ;; @@ -130,7 +130,8 @@ let graph (Provider.T { t; handler }) ~repo_root = let module L = (val Provider.Handler.lookup handler ~trait:Trait.Log) in let module R = (val Provider.Handler.lookup handler ~trait:Trait.Refs) in let graph = Graph.create () in - (let%bind log = L.all t ~repo_root in + (let open Or_error.Let_syntax in + let%bind log = L.all t ~repo_root in let%bind refs = R.show_ref t ~repo_root in Graph.add_nodes graph ~log; Graph.set_refs graph ~refs; diff --git a/lib/vcs/test/dune b/lib/vcs/test/dune index 446bce2..90d68a6 100644 --- a/lib/vcs/test/dune +++ b/lib/vcs/test/dune @@ -18,9 +18,7 @@ -open Fpath_base -open - Expect_test_helpers_base - -open - Or_error.Let_syntax) + Expect_test_helpers_base) (libraries base eio diff --git a/lib/vcs_arg/src/dune b/lib/vcs_arg/src/dune index 9297a90..c9ac44b 100644 --- a/lib/vcs_arg/src/dune +++ b/lib/vcs_arg/src/dune @@ -12,8 +12,6 @@ -open Fpath_base -open - Or_error.Let_syntax - -open Cmdlang) (libraries base cmdlang eio fpath fpath-base unix vcs vcs-git-eio) (instrumentation diff --git a/lib/vcs_git_eio/src/dune b/lib/vcs_git_eio/src/dune index e6ffc46..ed03a3d 100644 --- a/lib/vcs_git_eio/src/dune +++ b/lib/vcs_git_eio/src/dune @@ -12,8 +12,6 @@ -open Fpath_base -open - Or_error.Let_syntax - -open Vcs_eio_process) (libraries base diff --git a/lib/vcs_git_eio/test/dune b/lib/vcs_git_eio/test/dune index 1211110..6e490d3 100644 --- a/lib/vcs_git_eio/test/dune +++ b/lib/vcs_git_eio/test/dune @@ -13,9 +13,7 @@ -open Fpath_base -open - Expect_test_helpers_base - -open - Or_error.Let_syntax) + Expect_test_helpers_base) (libraries base eio diff --git a/lib/vcs_test_helpers/test/dune b/lib/vcs_test_helpers/test/dune index b356602..248e153 100644 --- a/lib/vcs_test_helpers/test/dune +++ b/lib/vcs_test_helpers/test/dune @@ -13,9 +13,7 @@ -open Fpath_base -open - Expect_test_helpers_base - -open - Or_error.Let_syntax) + Expect_test_helpers_base) (libraries base eio diff --git a/test/expect/dune b/test/expect/dune index fdf5a9c..895f531 100644 --- a/test/expect/dune +++ b/test/expect/dune @@ -13,9 +13,7 @@ -open Fpath_base -open - Expect_test_helpers_base - -open - Or_error.Let_syntax) + Expect_test_helpers_base) (libraries base eio diff --git a/test/expect/nonraising_unit_tests.ml b/test/expect/nonraising_unit_tests.ml index c0b3687..bd2c209 100644 --- a/test/expect/nonraising_unit_tests.ml +++ b/test/expect/nonraising_unit_tests.ml @@ -110,6 +110,7 @@ let%expect_test "num stat without lines" = |}]; let commit_file ~path ~file_contents = let result = + let open Or_error.Let_syntax in let%bind () = Vcs.Or_error.save_file vcs @@ -127,7 +128,7 @@ let%expect_test "num stat without lines" = print_s [%sexp (mock_rev : Vcs.Rev.t)]; [%expect {| 1185512b92d612b25613f2e5b473e5231185512b |}]; let result = - let%bind () = + let%bind.Or_error () = Vcs.Or_error.rename_current_branch vcs ~repo_root ~to_:(Vcs.Branch_name.v "branch") in Vcs.Or_error.current_branch vcs ~repo_root @@ -136,7 +137,7 @@ let%expect_test "num stat without lines" = [%expect {| (Ok branch) |}]; Vcs.rename_current_branch vcs ~repo_root ~to_:Vcs.Branch_name.main; let result = - let%map rev = Vcs.Or_error.current_revision vcs ~repo_root in + let%map.Or_error rev = Vcs.Or_error.current_revision vcs ~repo_root in Vcs.Mock_revs.to_mock mock_revs ~rev in print_s [%sexp (result : Vcs.Rev.t Or_error.t)]; From 69b7f743e24d359924b8bceaeada454024b4dcd6 Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Sun, 29 Sep 2024 17:29:12 +0200 Subject: [PATCH 2/3] Remove eio-writer dependency --- CHANGES.md | 14 ++++++++++ dune-project | 6 +---- lib/vcs_command/src/dune | 16 ++---------- lib/vcs_command/src/vcs_command.ml | 41 +++++++++++++++--------------- vcs-command.opam | 4 +-- 5 files changed, 38 insertions(+), 43 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index e53b6e9..8fb484d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,17 @@ +## 0.0.8 (unreleased) + +### Added + +### Changed + +- Remove `eio-writer` dependency in `vcs-command`. + +### Deprecated + +### Fixed + +### Removed + ## 0.0.7 (2024-09-20) ### Changed diff --git a/dune-project b/dune-project index 1dce01a..c46c4a9 100644 --- a/dune-project +++ b/dune-project @@ -131,8 +131,6 @@ (>= 0.0.5)) (cmdlang-cmdliner-runner (>= 0.0.5)) - (cmdlang-to-cmdliner - (>= 0.0.5)) (cmdliner (= 1.3.0)) (eio @@ -143,7 +141,7 @@ (>= 0.0.5)) (fpath (>= 0.7.3)) - (fpath-base + (fpath-sexp0 (>= 0.2.0)) (ppx_compare (and @@ -180,8 +178,6 @@ (vcs-arg (= :version)) (vcs-git-eio - (= :version)) - (vcs-private-libs-eio (= :version)))) (package diff --git a/lib/vcs_command/src/dune b/lib/vcs_command/src/dune index 60e8fa2..8119836 100644 --- a/lib/vcs_command/src/dune +++ b/lib/vcs_command/src/dune @@ -10,22 +10,10 @@ -open Base -open - Fpath_base - -open - Vcs_eio_writer + Fpath_sexp0 -open Cmdlang) - (libraries - base - cmdlang - eio - eio_main - fpath - fpath-base - vcs - vcs-arg - vcs-git-eio - vcs-private-libs-eio.eio-writer) + (libraries base cmdlang eio eio_main fpath-sexp0 vcs vcs-arg vcs-git-eio) (instrumentation (backend bisect_ppx)) (lint diff --git a/lib/vcs_command/src/vcs_command.ml b/lib/vcs_command/src/vcs_command.ml index a8f76e0..3d6bb83 100644 --- a/lib/vcs_command/src/vcs_command.ml +++ b/lib/vcs_command/src/vcs_command.ml @@ -23,6 +23,8 @@ the name the associated function has in the [V.S] interface, prepending the suffix "_cmd". *) +let print_sexp sexp = Stdlib.print_endline (Sexp.to_string_hum sexp) + let add_cmd = Command.make ~summary:"add a file to the index" @@ -50,7 +52,7 @@ let commit_cmd = Vcs_arg.initialize ~env ~config in let rev = Vcs.commit vcs ~repo_root ~commit_message in - if not quiet then Eio_writer.print_sexp ~env [%sexp (rev : Vcs.Rev.t)]; + if not quiet then print_sexp [%sexp (rev : Vcs.Rev.t)]; ()) ;; @@ -64,7 +66,7 @@ let current_branch_cmd = Vcs_arg.initialize ~env ~config in let branch = Vcs.current_branch vcs ~repo_root in - Eio_writer.print_sexp ~env [%sexp (branch : Vcs.Branch_name.t)]; + print_sexp [%sexp (branch : Vcs.Branch_name.t)]; ()) ;; @@ -78,7 +80,7 @@ let current_revision_cmd = Vcs_arg.initialize ~env ~config in let rev = Vcs.current_revision vcs ~repo_root in - Eio_writer.print_sexp ~env [%sexp (rev : Vcs.Rev.t)]; + print_sexp [%sexp (rev : Vcs.Rev.t)]; ()) ;; @@ -97,8 +99,8 @@ let git_cmd = let { Vcs.Git.Output.exit_code; stdout; stderr } = Vcs.git vcs ~repo_root ~args ~f:Fn.id in - Eio_writer.print_string ~env stdout; - Eio_writer.prerr_string ~env stderr; + Stdlib.print_string stdout; + Stdlib.prerr_string stderr; if exit_code <> 0 then Stdlib.exit exit_code) ;; @@ -115,8 +117,7 @@ let init_cmd = in let path = Vcs_arg.resolve path ~context in let repo_root = Vcs.init vcs ~path in - if not quiet - then Eio_writer.print_sexp ~env [%sexp (repo_root : Vcs.Repo_root.t)] [@coverage off]; + if not quiet then print_sexp [%sexp (repo_root : Vcs.Repo_root.t)] [@coverage off]; ()) ;; @@ -132,7 +133,7 @@ let load_file_cmd = in let path = Vcs_arg.resolve path ~context in let contents = Vcs.load_file vcs ~path in - Eio_writer.print_string ~env (contents :> string); + Stdlib.print_string (contents :> string); ()) ;; @@ -149,9 +150,8 @@ let ls_files_cmd = let below = Vcs_arg.resolve below ~context in let below = Option.value below ~default:Vcs.Path_in_repo.root in let files = Vcs.ls_files vcs ~repo_root ~below in - Eio_writer.with_flow (Eio.Stdenv.stdout env) (fun w -> - List.iter files ~f:(fun file -> - Eio_writer.write_line w (Vcs.Path_in_repo.to_string file))); + List.iter files ~f:(fun file -> + Stdlib.print_endline (Vcs.Path_in_repo.to_string file)); ()) ;; @@ -165,7 +165,7 @@ let log_cmd = Vcs_arg.initialize ~env ~config in let log = Vcs.log vcs ~repo_root in - Eio_writer.print_sexp ~env [%sexp (log : Vcs.Log.t)]; + print_sexp [%sexp (log : Vcs.Log.t)]; ()) ;; @@ -181,7 +181,7 @@ let name_status_cmd = Vcs_arg.initialize ~env ~config in let name_status = Vcs.name_status vcs ~repo_root ~changed:(Between { src; dst }) in - Eio_writer.print_sexp ~env [%sexp (name_status : Vcs.Name_status.t)]; + print_sexp [%sexp (name_status : Vcs.Name_status.t)]; ()) ;; @@ -197,7 +197,7 @@ let num_status_cmd = Vcs_arg.initialize ~env ~config in let num_status = Vcs.num_status vcs ~repo_root ~changed:(Between { src; dst }) in - Eio_writer.print_sexp ~env [%sexp (num_status : Vcs.Num_status.t)]; + print_sexp [%sexp (num_status : Vcs.Num_status.t)]; ()) ;; @@ -225,7 +225,7 @@ let refs_cmd = Vcs_arg.initialize ~env ~config in let refs = Vcs.refs vcs ~repo_root in - Eio_writer.print_sexp ~env [%sexp (refs : Vcs.Refs.t)]; + print_sexp [%sexp (refs : Vcs.Refs.t)]; ()) ;; @@ -281,10 +281,9 @@ let show_file_at_rev_cmd = let path = Vcs_arg.resolve path ~context in let result = Vcs.show_file_at_rev vcs ~repo_root ~rev ~path in (match result with - | `Present contents -> Eio_writer.print_string ~env (contents :> string) + | `Present contents -> Stdlib.print_string (contents :> string) | `Absent -> - Eio_writer.eprintf - ~env + Stdlib.Printf.eprintf "Path '%s' does not exist in '%s'" (Vcs.Path_in_repo.to_string path) (Vcs.Rev.to_string rev)); @@ -301,7 +300,7 @@ let graph_cmd = Vcs_arg.initialize ~env ~config in let graph = Vcs.graph vcs ~repo_root in - Eio_writer.print_sexp ~env [%sexp (Vcs.Graph.summary graph : Vcs.Graph.Summary.t)]; + print_sexp [%sexp (Vcs.Graph.summary graph : Vcs.Graph.Summary.t)]; ()) ;; @@ -335,7 +334,7 @@ let branch_revision_cmd = "Branch not found" [%sexp { branch_name : Vcs.Branch_name.t }] [@coverage off] in - Eio_writer.print_sexp ~env [%sexp (rev : Vcs.Rev.t)]; + print_sexp [%sexp (rev : Vcs.Rev.t)]; ()) ;; @@ -360,7 +359,7 @@ let greatest_common_ancestors_cmd = Vcs.Graph.greatest_common_ancestors graph nodes |> List.map ~f:(fun node -> Vcs.Graph.rev graph node) in - Eio_writer.print_sexp ~env [%sexp (gca : Vcs.Rev.t list)]; + print_sexp [%sexp (gca : Vcs.Rev.t list)]; ()) ;; diff --git a/vcs-command.opam b/vcs-command.opam index f273aa1..587cf4a 100644 --- a/vcs-command.opam +++ b/vcs-command.opam @@ -13,13 +13,12 @@ depends: [ "base" {>= "v0.17" & < "v0.18"} "cmdlang" {>= "0.0.5"} "cmdlang-cmdliner-runner" {>= "0.0.5"} - "cmdlang-to-cmdliner" {>= "0.0.5"} "cmdliner" {= "1.3.0"} "eio" {>= "1.0"} "eio_main" {>= "1.0"} "err" {>= "0.0.5"} "fpath" {>= "0.7.3"} - "fpath-base" {>= "0.2.0"} + "fpath-sexp0" {>= "0.2.0"} "ppx_compare" {>= "v0.17" & < "v0.18"} "ppx_enumerate" {>= "v0.17" & < "v0.18"} "ppx_hash" {>= "v0.17" & < "v0.18"} @@ -31,7 +30,6 @@ depends: [ "vcs" {= version} "vcs-arg" {= version} "vcs-git-eio" {= version} - "vcs-private-libs-eio" {= version} "odoc" {with-doc} ] build: [ From cfe3dbbafe4fd01c80984df6fa48839cbc049e80 Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Sun, 29 Sep 2024 17:29:53 +0200 Subject: [PATCH 3/3] Remove now unused vendor eio-writer --- vendor/eio-writer/LICENSE | 21 ------ vendor/eio-writer/LICENSE.janestreet | 29 -------- vendor/eio-writer/src/dune | 14 ---- vendor/eio-writer/src/eio_writer.ml | 44 ------------ vendor/eio-writer/src/eio_writer.mli | 91 ------------------------- vendor/eio-writer/src/vcs_eio_writer.ml | 3 - vendor/update-eio-writer.sh | 27 -------- 7 files changed, 229 deletions(-) delete mode 100644 vendor/eio-writer/LICENSE delete mode 100644 vendor/eio-writer/LICENSE.janestreet delete mode 100644 vendor/eio-writer/src/dune delete mode 100644 vendor/eio-writer/src/eio_writer.ml delete mode 100644 vendor/eio-writer/src/eio_writer.mli delete mode 100644 vendor/eio-writer/src/vcs_eio_writer.ml delete mode 100755 vendor/update-eio-writer.sh diff --git a/vendor/eio-writer/LICENSE b/vendor/eio-writer/LICENSE deleted file mode 100644 index 21e7be4..0000000 --- a/vendor/eio-writer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 Mathieu Barbin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/eio-writer/LICENSE.janestreet b/vendor/eio-writer/LICENSE.janestreet deleted file mode 100644 index 072550e..0000000 --- a/vendor/eio-writer/LICENSE.janestreet +++ /dev/null @@ -1,29 +0,0 @@ -This project took inspiration from the module signatures exposed by the `Stdio` -and `Async_unix.Writer` modules from the following projects - -- [stdio](https://github.com/janestreet/stdio) -- [async_unix](https://github.com/janestreet/Async_unix) - -Both projects have the following license: - -The MIT License - -Copyright (c) 2008--2023 Jane Street Group, LLC - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/eio-writer/src/dune b/vendor/eio-writer/src/dune deleted file mode 100644 index 3db3de0..0000000 --- a/vendor/eio-writer/src/dune +++ /dev/null @@ -1,14 +0,0 @@ -(library - (name vcs_eio_writer) - (public_name vcs-private-libs-eio.eio-writer) - (flags :standard -w +a-4-40-41-42-44-45-48-66 -warn-error +a -open Base) - (libraries base eio) - (preprocess - (pps - ppx_compare - ppx_enumerate - ppx_hash - ppx_here - ppx_let - ppx_sexp_conv - ppx_sexp_value))) diff --git a/vendor/eio-writer/src/eio_writer.ml b/vendor/eio-writer/src/eio_writer.ml deleted file mode 100644 index f5e7b63..0000000 --- a/vendor/eio-writer/src/eio_writer.ml +++ /dev/null @@ -1,44 +0,0 @@ -type t = Eio.Buf_write.t - -let with_flow = Eio.Buf_write.with_flow -let flush t = Eio.Buf_write.flush t -let write_string t ?pos ?len str = Eio.Buf_write.string t ?off:pos ?len str -let write_newline t = write_string t "\n" - -let write_line t str = - write_string t str; - write_newline t -;; - -let writef t fmt = Eio.Buf_write.printf t fmt -let write_lines t lines = List.iter lines ~f:(fun line -> write_line t line) - -let write_sexp ?(mach = false) t sexp = - write_line t (if mach then Sexp.to_string_mach sexp else Sexp.to_string_hum sexp) -;; - -let print_string ~env str = - with_flow (Eio.Stdenv.stdout env) (fun t -> write_string t str) -;; - -let print_newline ~env = print_string ~env "\n" -let print_endline ~env str = with_flow (Eio.Stdenv.stdout env) (fun t -> write_line t str) - -let print_lines ~env lines = - with_flow (Eio.Stdenv.stdout env) (fun t -> - List.iter lines ~f:(fun line -> write_line t line)) -;; - -let print_sexp ~env ?mach sexp = - with_flow (Eio.Stdenv.stdout env) (fun t -> write_sexp ?mach t sexp) -;; - -let prerr_string ~env str = - with_flow (Eio.Stdenv.stderr env) (fun t -> write_string t str) -;; - -let prerr_newline ~env = prerr_string ~env "\n" -let prerr_endline ~env str = with_flow (Eio.Stdenv.stderr env) (fun t -> write_line t str) -let printf ~env fmt = Printf.ksprintf (fun str -> print_string ~env str) fmt -let aprintf ~env fmt = Stdlib.Format.kasprintf (fun str -> print_string ~env str) fmt -let eprintf ~env fmt = Printf.ksprintf (fun str -> prerr_string ~env str) fmt diff --git a/vendor/eio-writer/src/eio_writer.mli b/vendor/eio-writer/src/eio_writer.mli deleted file mode 100644 index 0dd6db3..0000000 --- a/vendor/eio-writer/src/eio_writer.mli +++ /dev/null @@ -1,91 +0,0 @@ -(** Writing to a [Eio.Buf_write.t] with an api that resembles [Stdio] or - [Async.Writer]. *) - -type t = Eio.Buf_write.t - -(** Same as [Eio.Buf_write.with_flow]. *) -val with_flow : ?initial_size:int -> _ Eio.Flow.sink -> (t -> 'a) -> 'a - -(** {1 Async writer style API} - - In this API, the emphasis is put on the prefix "write", rather than "print". - "Print" sounds a bit like this is printing to the screen or the terminal, so - it is reserved to the part of the API that prints to the standard channels - (see below). *) - -val write_string : t -> ?pos:int -> ?len:int -> string -> unit -val write_newline : t -> unit -val write_line : t -> string -> unit -val write_lines : t -> string list -> unit - -(** Write a sexp followed by a newline character. Default to [mach:false], which - means uses [Sexp.to_string_hum] by default.*) -val write_sexp : ?mach:bool -> t -> Sexp.t -> unit - -val writef : t -> ('a, Stdlib.Format.formatter, unit) format -> 'a -val flush : t -> unit - -(** {1 Stdio style API} - - There are cases where just need to print a quick statement to stdout or - stderr, and going through building a complete call to {!with_flow} feels too - heavy. We assume that these functions are primarily useful in context where - you have access to the eio env. The name exposed below are derived from - OCaml's stdlib, and are good candidate for easily migrating some code. *) - -val print_string - : env:< stdout : [> Eio.Flow.sink_ty ] Eio.Resource.t ; .. > - -> string - -> unit - -val print_endline - : env:< stdout : [> Eio.Flow.sink_ty ] Eio.Resource.t ; .. > - -> string - -> unit - -val print_newline : env:< stdout : [> Eio.Flow.sink_ty ] Eio.Resource.t ; .. > -> unit - -(** Write all strings in the order supplied to stdout, each followed by a newline char. *) -val print_lines - : env:< stdout : [> Eio.Flow.sink_ty ] Eio.Resource.t ; .. > - -> string list - -> unit - -val prerr_string - : env:< stderr : [> Eio.Flow.sink_ty ] Eio.Resource.t ; .. > - -> string - -> unit - -val prerr_endline - : env:< stderr : [> Eio.Flow.sink_ty ] Eio.Resource.t ; .. > - -> string - -> unit - -val prerr_newline : env:< stderr : [> Eio.Flow.sink_ty ] Eio.Resource.t ; .. > -> unit - -(** {2 Format} *) - -val printf - : env:< stdout : [> Eio.Flow.sink_ty ] Eio.Resource.t ; .. > - -> ('a, unit, string, unit) format4 - -> 'a - -val aprintf - : env:< stdout : [> Eio.Flow.sink_ty ] Eio.Resource.t ; .. > - -> ('a, Stdlib.Format.formatter, unit) format - -> 'a - -val eprintf - : env:< stderr : [> Eio.Flow.sink_ty ] Eio.Resource.t ; .. > - -> ('a, unit, string, unit) format4 - -> 'a - -(** {2 Sexp} *) - -(** Print a sexp followed by a newline character. See [Stdio.print_s]. Default - to [mach:false], which means uses [Sexp.to_string_hum] by default. *) -val print_sexp - : env:< stdout : [> Eio.Flow.sink_ty ] Eio.Resource.t ; .. > - -> ?mach:bool - -> Sexp.t - -> unit diff --git a/vendor/eio-writer/src/vcs_eio_writer.ml b/vendor/eio-writer/src/vcs_eio_writer.ml deleted file mode 100644 index 855d00e..0000000 --- a/vendor/eio-writer/src/vcs_eio_writer.ml +++ /dev/null @@ -1,3 +0,0 @@ -(* We use ["vcs_eio_writer.cmxa"] as library name to limit the potential module - name conflicts for projects linking with both [vcs] and [eio_writer]. *) -module Eio_writer = Eio_writer diff --git a/vendor/update-eio-writer.sh b/vendor/update-eio-writer.sh deleted file mode 100755 index 49e9813..0000000 --- a/vendor/update-eio-writer.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -version=7935ebe1a97cf9618835d0b682fcf14fa784fdd5 - -set -e -o pipefail - -TMP="$(mktemp -d)" -trap "rm -rf $TMP" EXIT - -rm -rf eio-writer -mkdir -p eio-writer/src - -( - cd $TMP - git clone https://github.com/mbarbin/eio-writer.git - cd eio-writer - git checkout $version -) - -SRC=$TMP/eio-writer - -cp -v $SRC/LICENSE{,.janestreet} eio-writer/ -cp -v -R $SRC/src eio-writer/ - -git checkout eio-writer/src/dune -git checkout eio-writer/src/vcs_eio_writer.ml -git add -A .