Skip to content

Commit

Permalink
Merge pull request #36 from mbarbin/remove-base
Browse files Browse the repository at this point in the history
Remove base dependency (Vcs_base refactor)
  • Loading branch information
mbarbin authored Oct 22, 2024
2 parents d6acf33 + a724297 commit ff5e5a3
Show file tree
Hide file tree
Showing 59 changed files with 1,145 additions and 458 deletions.
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"cSpell.words": [
"alphanum",
"astring",
"chdir",
"ENOENT",
"fpath",
Expand All @@ -12,6 +14,8 @@
"raise_notrace",
"rmtree",
"rresult",
"rsplit",
"Sexp_conv",
"Stdenv",
"subdir",
"worktree",
Expand Down
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

### Changed

- Remove `base` dependency from `vcs` and provider libraries (#36, @mbarbin).
- Moved `Or_error` related modules to `Vcs_base` (#35, @mbarbin).
- Provider interfaces now uses `Vcs.Result` type instead of `Or_error` (#34, @mbarbin).
- Rename what was `Vcs.Result` to `Vcs.Rresult` and introduce `Vcs.Result` whose type is simpler (#33, @mbarbin).
Expand Down
34 changes: 33 additions & 1 deletion NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ To spawn processes in `Eio` and collect their output we've copied some code from

### 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:
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 includes `Eio_process`'s original LICENSE:

```text
MIT License
Expand All @@ -48,6 +48,38 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```

## A note about Base.String.split_lines

We copied the implementation of the function `Base.String.split_lines` from the [Base](https://github.com/janestreet/base) project. `Base` is released under `MIT`.

### Notice

The file where we imported the function is `lib/vcs/src/import.ml`. We've added a notice in the file and a comment next to the code that was copied and modified, which includes `Base`'s original LICENSE:

```text
The MIT License
Copyright (c) 2016--2024 Jane Street Group, LLC <[email protected]>
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
12 changes: 6 additions & 6 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ Only keep sexp related ppx that have no runtime dependency on `base`, such as `s

### Stage 6 - Remove base dependency from `Vcs`

- [ ] Pending
- [x] Completed: Oct. 2024

Use `vcs/src/import` to make a local mini-stdlib with utils required to remove `base` dependency.

Do this for the other libraries:

- [ ] vcs
- [ ] vcs_command
- [ ] vcs_git_blocking
- [ ] vcs_git_eio
- [ ] vcs_git_provider
- [x] vcs
- [x] vcs_command
- [x] vcs_git_blocking
- [x] vcs_git_eio
- [x] vcs_git_provider
136 changes: 19 additions & 117 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,14 @@
(depends
(ocaml
(>= 5.2))
(base
(and
(>= v0.17)
(< v0.18)))
(fpath
(>= 0.7.3))
(fpath-base
(fpath-sexp0
(>= 0.2.2))
(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)
Expand Down Expand Up @@ -119,10 +99,6 @@
(depends
(ocaml
(>= 5.2))
(base
(and
(>= v0.17)
(< v0.18)))
(cmdlang
(>= 0.0.5))
(cmdlang-cmdliner-runner
Expand All @@ -139,26 +115,6 @@
(>= 0.7.3))
(fpath-sexp0
(>= 0.2.2))
(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)
Expand All @@ -169,6 +125,10 @@
(< v0.18)))
(ppxlib
(>= 0.33))
(sexplib0
(and
(>= v0.17)
(< v0.18)))
(vcs
(= :version))
(vcs-git-eio
Expand All @@ -180,34 +140,12 @@
(depends
(ocaml
(>= 5.2))
(base
(and
(>= v0.17)
(< v0.18)))
(astring
(>= 0.8.5))
(fpath
(>= 0.7.3))
(fpath-sexp0
(>= 0.2.2))
(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)
Expand All @@ -218,6 +156,10 @@
(< v0.18)))
(ppxlib
(>= 0.33))
(sexplib0
(and
(>= v0.17)
(< v0.18)))
(vcs
(= :version))))

Expand All @@ -228,36 +170,12 @@
(depends
(ocaml
(>= 5.2))
(base
(and
(>= v0.17)
(< v0.18)))
(eio
(>= 1.0))
(fpath
(>= 0.7.3))
(fpath-sexp0
(>= 0.2.2))
(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)
Expand All @@ -270,6 +188,10 @@
(>= 0.33))
(provider
(>= 0.0.8))
(sexplib0
(and
(>= v0.17)
(< v0.18)))
(vcs
(= :version))
(vcs-git-provider
Expand All @@ -282,34 +204,10 @@
(depends
(ocaml
(>= 5.2))
(base
(and
(>= v0.17)
(< v0.18)))
(fpath
(>= 0.7.3))
(fpath-sexp0
(>= 0.2.2))
(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)
Expand All @@ -322,6 +220,10 @@
(>= 0.33))
(provider
(>= 0.0.8))
(sexplib0
(and
(>= v0.17)
(< v0.18)))
(vcs
(= :version))
(vcs-git-provider
Expand Down
2 changes: 1 addition & 1 deletion lib/vcs/src/container_key.ml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ module String_impl = struct
let compare = compare_string
let equal = equal_string
let hash = hash_string
let seeded_hash = Stdlib.String.seeded_hash
let seeded_hash = String.seeded_hash
let sexp_of_t = sexp_of_string
end
8 changes: 5 additions & 3 deletions lib/vcs/src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
-warn-error
+a
-open
Base
Fpath_sexp0
-open
Fpath_base)
(libraries base fpath fpath-base provider)
Sexplib0
-open
Sexplib0.Sexp_conv)
(libraries fpath fpath-sexp0 provider)
(instrumentation
(backend bisect_ppx))
(lint
Expand Down
Loading

0 comments on commit ff5e5a3

Please sign in to comment.