Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Reduce dependency (rm eio-process) #27

Merged
merged 8 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
## 0.0.8 (unreleased)

### Added
## 0.0.8 (2024-09-30)

### Changed

- Remove `eio-writer` dependency in `vcs-command`.

### Deprecated
- Reduced dependencies from `fpath-base` to `fpath-sexp0` where able (#27, @mbarbin).
- Inline `eio-process` dependency into `vcs_git_eio` (#27, @mbarbin).
- Replace calls to `eio-writer` by print functions from stdlib in `vcs-command` (#26, @mbarbin).
- Refactor subgraph computation to not need union-find (#25, @mbarbin).
- Improve `Vcs.Graph` documentation (#24, @mbarbin).
- Upgrade documentation dependencies (#23, @mbarbin).
- Update documentation to use diataxis (#22, @mbarbin).

### Fixed

- Fixed stale names in headache script.

### Removed

- No more `vendor/` libraries.
- Removed dependency to vendored `eio-process`.
- Removed dependency to vendored `eio-writer`.
- Removed dependency to vendored `union-find`.

## 0.0.7 (2024-09-20)

### Changed
Expand Down
32 changes: 32 additions & 0 deletions NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,38 @@ This notice file contains more details, as well as document the organization of

- **NOTICE.md** (this file) documents the project licensing.

## A note about Eio-process

To spawn processes in `Eio` and collect their output we've copied some code from the [Eio_process](https://github.com/mbarbin/eio-process) project. The `Eio_process` project is released under `MIT`.

### Notice

The file where we make use of this code is `lib/vcs_git_eio/src/runtime.ml`. We've added a notice in the file and a comment next to the code that was copied and modified, which include `Eio_process`'s original LICENSE:

```text
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.
```

## A note about Iron

In 2016-2017, Jane Street released on GitHub an internal code review system named [Iron](https://github.com/janestreet/iron).
Expand Down
64 changes: 7 additions & 57 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
(>= 1.0))
(fpath
(>= 0.7.3))
(fpath-base
(fpath-sexp0
(>= 0.2.0))
(ppx_compare
(and
Expand Down Expand Up @@ -192,7 +192,7 @@
(< v0.18)))
(fpath
(>= 0.7.3))
(fpath-base
(fpath-sexp0
(>= 0.2.0))
(ppx_compare
(and
Expand Down Expand Up @@ -242,7 +242,7 @@
(>= 1.0))
(fpath
(>= 0.7.3))
(fpath-base
(fpath-sexp0
(>= 0.2.0))
(ppx_compare
(and
Expand Down Expand Up @@ -279,8 +279,6 @@
(vcs
(= :version))
(vcs-git-provider
(= :version))
(vcs-private-libs-eio
(= :version))))

(package
Expand All @@ -296,7 +294,7 @@
(< v0.18)))
(fpath
(>= 0.7.3))
(fpath-base
(fpath-sexp0
(>= 0.2.0))
(ppx_compare
(and
Expand Down Expand Up @@ -383,6 +381,8 @@
(>= 0.7.3))
(fpath-base
(>= 0.2.0))
(fpath-sexp0
(>= 0.2.0))
(mdx
(and
:with-doc
Expand Down Expand Up @@ -454,63 +454,13 @@
(= :version))
(vcs-git-provider
(= :version))
(vcs-private-libs-eio
(= :version))
(vcs-test-helpers
(= :version))
(sherlodoc
(and
:with-doc
(>= 0.2)))))

(package
(name vcs-private-libs-eio)
(synopsis "Private eio libraries used by vcs -- do not use!")
(allow_empty)
(depends
(ocaml
(>= 5.2))
(base
(and
(>= v0.17)
(< v0.18)))
(eio
(>= 1.0))
(parsexp
(and
(>= v0.17)
(< v0.18)))
(ppx_compare
(and
(>= v0.17)
(< v0.18)))
(ppx_enumerate
(and
(>= v0.17)
(< v0.18)))
(ppx_hash
(and
(>= v0.17)
(< v0.18)))
(ppx_here
(and
(>= v0.17)
(< v0.18)))
(ppx_let
(and
(>= v0.17)
(< v0.18)))
(ppx_sexp_conv
(and
(>= v0.17)
(< v0.18)))
(ppx_sexp_value
(and
(>= v0.17)
(< v0.18)))
(ppxlib
(>= 0.33))))

(package
(name vcs-test-helpers)
(synopsis "Helper library to write tests using vcs")
Expand All @@ -525,7 +475,7 @@
(>= 1.0))
(fpath
(>= 0.7.3))
(fpath-base
(fpath-sexp0
(>= 0.2.0))
(ppx_compare
(and
Expand Down
8 changes: 3 additions & 5 deletions example/dune
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,16 @@
-open
Base
-open
Fpath_base
Fpath_sexp0
-open
Expect_test_helpers_base
-open
Or_error.Let_syntax)
Expect_test_helpers_base)
(libraries
base
eio
eio_main
expect_test_helpers_core.expect_test_helpers_base
fpath
fpath-base
fpath-sexp0
vcs
vcs_git_blocking
vcs_git_eio
Expand Down
6 changes: 3 additions & 3 deletions example/hello_git_cli.ml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ let%expect_test "hello cli" =
its output, and how to do this with the non-raising API of Vcs. *)
let head_rev =
Vcs.Or_error.git vcs ~repo_root ~args:[ "rev-parse"; "HEAD" ] ~f:(fun output ->
let%bind stdout = Vcs.Git.Or_error.exit0_and_stdout output in
let%bind.Or_error stdout = Vcs.Git.Or_error.exit0_and_stdout output in
match Vcs.Rev.of_string (String.strip stdout) with
| Ok _ as ok -> ok
| Error (`Msg _) -> assert false)
Expand Down Expand Up @@ -180,7 +180,7 @@ let%expect_test "hello cli" =
~repo_root
~args:[ "rev-parse"; "--abbrev-ref"; ref_ ]
~f:Vcs.Git.Or_error.exit0_and_stdout
>>| String.strip
|> Or_error.map ~f:String.strip
in
(* You may be tempted to think the setup is ok, based on the happy path
behavior. *)
Expand Down Expand Up @@ -218,7 +218,7 @@ let%expect_test "hello cli" =
~repo_root
~args:[ "rev-parse"; "--abbrev-ref"; ref_ ]
~f:Vcs.Git.Or_error.exit0_and_stdout
>>| String.strip
|> Or_error.map ~f:String.strip
in
(* The behavior is the same in the happy path. *)
print_s [%sexp (abbrev_ref "HEAD" : string Or_error.t)];
Expand Down
8 changes: 4 additions & 4 deletions headache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ dirs=(
"lib/vcs_arg/test"
"lib/vcs_command/src"
"lib/vcs_command/test"
"lib/vcs_git/src"
"lib/vcs_git/test"
"lib/vcs_git_blocking/src"
"lib/vcs_git_blocking/test"
"lib/vcs_git_cli/src"
"lib/vcs_git_cli/test"
"lib/vcs_git_eio/src"
"lib/vcs_git_eio/test"
"lib/vcs_git_provider/src"
"lib/vcs_git_provider/test"
"lib/vcs_test_helpers/src"
"lib/vcs_test_helpers/test"
"test/expect"
Expand Down
4 changes: 2 additions & 2 deletions lib/vcs/test/dune
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
-open
Base
-open
Fpath_base
Fpath_sexp0
-open
Expect_test_helpers_base)
(libraries
Expand All @@ -26,7 +26,7 @@
err
expect_test_helpers_core.expect_test_helpers_base
fpath
fpath-base
fpath-sexp0
vcs
vcs_git_provider)
(instrumentation
Expand Down
4 changes: 2 additions & 2 deletions lib/vcs_arg/src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
-open
Base
-open
Fpath_base
Fpath_sexp0
-open
Cmdlang)
(libraries base cmdlang eio fpath fpath-base unix vcs vcs-git-eio)
(libraries base cmdlang eio fpath fpath-sexp0 unix vcs vcs-git-eio)
(instrumentation
(backend bisect_ppx))
(lint
Expand Down
4 changes: 2 additions & 2 deletions lib/vcs_arg/test/dune
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
-open
Base
-open
Fpath_base
Fpath_sexp0
-open
Expect_test_helpers_base)
(libraries
Expand All @@ -20,7 +20,7 @@
eio_main
expect_test_helpers_core.expect_test_helpers_base
fpath
fpath-base
fpath-sexp0
vcs_arg)
(instrumentation
(backend bisect_ppx))
Expand Down
4 changes: 2 additions & 2 deletions lib/vcs_git_blocking/src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
-open
Base
-open
Fpath_base)
(libraries base fpath fpath-base provider unix vcs vcs-git-provider)
Fpath_sexp0)
(libraries base fpath fpath-sexp0 provider unix vcs vcs-git-provider)
(instrumentation
(backend bisect_ppx))
(lint
Expand Down
4 changes: 2 additions & 2 deletions lib/vcs_git_blocking/test/dune
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
-open
Base
-open
Fpath_base
Fpath_sexp0
-open
Expect_test_helpers_base)
(libraries
base
expect_test_helpers_core.expect_test_helpers_base
fpath
fpath-base
fpath-sexp0
vcs
vcs_git_blocking)
(instrumentation
Expand Down
13 changes: 2 additions & 11 deletions lib/vcs_git_eio/src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,8 @@
-open
Base
-open
Fpath_base
-open
Vcs_eio_process)
(libraries
base
eio
fpath
fpath-base
vcs
vcs-git-provider
vcs-private-libs-eio.eio-process)
Fpath_sexp0)
(libraries base eio fpath fpath-sexp0 vcs vcs-git-provider)
(instrumentation
(backend bisect_ppx))
(lint
Expand Down
Loading