Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Sora Morimoto <[email protected]>
  • Loading branch information
smorimoto committed Nov 19, 2024
1 parent a7d7720 commit 8e1a82d
Show file tree
Hide file tree
Showing 35 changed files with 221 additions and 335 deletions.
54 changes: 4 additions & 50 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,51 +28,16 @@ jobs:
libev:
- true
- false
ppx:
- true
local-packages:
- |
*.opam
include:
- os: ubuntu-latest
ocaml-compiler: ocaml-variants.5.2.0+options,ocaml-option-flambda,ocaml-option-musl,ocaml-option-static,ocaml-option-no-compression
libev: false
ppx: true
local-packages: |
*.opam
- os: macos-latest
ocaml-compiler: "5.2"
libev: true
ppx: true
local-packages: |
*.opam
- os: windows-latest
ocaml-compiler: "5.2"
libev: false
ppx: true
local-packages: |
*.opam
- os: ubuntu-latest
ocaml-compiler: "5.2"
libev: true
ppx: false
local-packages: |
*.opam
!lwt_ppx.opam
- os: macos-latest
ocaml-compiler: "5.2"
libev: true
ppx: false
local-packages: |
*.opam
!lwt_ppx.opam
- os: windows-latest
ocaml-compiler: "5.2"
libev: false
ppx: false
local-packages: |
*.opam
!lwt_ppx.opam

runs-on: ${{ matrix.os }}

Expand All @@ -84,37 +49,26 @@ jobs:
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
opam-local-packages: ${{ matrix.local-packages }}

- run: opam install conf-libev
if: ${{ matrix.libev == true }}

- run: opam install lwt_react lwt --deps-only --with-test

- run: opam install lwt_ppx --deps-only --with-test
if: ${{ matrix.ppx == true }}

- run: opam exec -- dune build --only-packages lwt_react,lwt
- run: opam install . --deps-only --with-test

- run: opam exec -- dune build --only-packages lwt_ppx
if: ${{ matrix.ppx == true }}
- run: opam exec -- dune build

- run: opam exec -- dune runtest --only-packages lwt_react,lwt
- run: opam exec -- dune runtest --instrument-with bisect_ppx --force

- run: opam exec -- dune runtest --only-packages lwt_ppx
if: ${{ matrix.ppx == true }}
- run: opam exec -- bisect-ppx-report summary --per-file

lint-opam:
runs-on: ubuntu-latest

steps:
- name: Checkout tree
uses: actions/checkout@v4

- name: Set-up OCaml
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: "5.2"
dune-cache: true

- uses: ocaml/setup-ocaml/lint-opam@v3
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ EXPECTED_FILES := \

.PHONY: coverage
coverage :
rm -rf _build/default/test/ppx_expect
find _build -name '*.coverage' | xargs rm -f
BISECT_ENABLE=yes dune runtest --force
dune runtest --instrument-with bisect_ppx --force
bisect-ppx-report html $(EXPECTED_FILES)
bisect-ppx-report summary
@echo See _coverage/index.html
2 changes: 1 addition & 1 deletion docs/dune
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(documentation
(package lwt)
(mld_files :standard))
(mld_files :standard))
8 changes: 6 additions & 2 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"Shon Feder <[email protected]>")
(depends
(ocaml (>= 4.08))
(lwt (>= 5.3.0))))
(lwt (>= 5.3.0))
(bisect_ppx :with-test)))

(package
(name lwt_ppx)
Expand All @@ -30,6 +31,7 @@
(ocaml (>= 4.08))
(ppxlib (>= 0.16.0))
(ppx_let :with-test)
(bisect_ppx :with-test)
lwt))

(package
Expand All @@ -39,7 +41,8 @@
(ocaml (>= 4.08))
(cppo (and :build (>= 1.1.0)))
(lwt (>= 3.0.0))
(react (>= 1.0.0))))
(react (>= 1.0.0))
(bisect_ppx :with-test)))

(package
(name lwt)
Expand All @@ -58,6 +61,7 @@ synchronization primitives. Code can be run in parallel on an opt-in basis.
(cppo (and :build (>= 1.1.0)))
(ocamlfind (and :dev (>= 1.7.3-1)))
(odoc (and :with-doc (>= 2.3.0)))
(bisect_ppx :with-test)
dune-configurator
ocplib-endian)
(depopts base-threads base-unix conf-libev))
1 change: 1 addition & 0 deletions lwt.opam
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ depends: [
"cppo" {build & >= "1.1.0"}
"ocamlfind" {dev & >= "1.7.3-1"}
"odoc" {with-doc & >= "2.3.0"}
"bisect_ppx" {with-test}
"dune-configurator"
"ocplib-endian"
]
Expand Down
1 change: 1 addition & 0 deletions lwt_ppx.opam
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ depends: [
"ocaml" {>= "4.08"}
"ppxlib" {>= "0.16.0"}
"ppx_let" {with-test}
"bisect_ppx" {with-test}
"lwt"
"odoc" {with-doc}
]
Expand Down
1 change: 1 addition & 0 deletions lwt_react.opam
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ depends: [
"cppo" {build & >= "1.1.0"}
"lwt" {>= "3.0.0"}
"react" {>= "1.0.0"}
"bisect_ppx" {with-test}
"odoc" {with-doc}
]
build: [
Expand Down
1 change: 1 addition & 0 deletions lwt_retry.opam
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ depends: [
"dune" {>= "2.7"}
"ocaml" {>= "4.08"}
"lwt" {>= "5.3.0"}
"bisect_ppx" {with-test}
"odoc" {with-doc}
]
dev-repo: "git+https://github.com/ocsigen/lwt.git"
Expand Down
16 changes: 2 additions & 14 deletions src/core/dune
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
(* -*- tuareg -*- *)

let preprocess =
match Sys.getenv "BISECT_ENABLE" with
| "yes" -> "(preprocess (pps bisect_ppx))"
| _ -> ""
| exception _ -> ""

let () = Jbuild_plugin.V1.send @@ {|

(library
(public_name lwt)
(synopsis "Monadic promises and concurrent I/O")
(wrapped false)
|} ^ preprocess ^ {|
(flags (:standard -w +A-29)))
(instrumentation
(backend bisect_ppx)))

(documentation
(package lwt))

|}
6 changes: 2 additions & 4 deletions src/core/lwt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,7 @@
("deprecated"), and create a local, non-deprecated alias for
[Lwt_sequence] that can be referred to by the rest of the code in this
module without triggering any more warnings. *)
[@@@ocaml.warning "-3"]
module Lwt_sequence = Lwt_sequence
[@@@ocaml.warning "+3"]

(* Some sequence-associated storage types
Expand Down Expand Up @@ -830,14 +828,14 @@ struct
| Regular_callback_list_empty, _ -> l2
| _, Regular_callback_list_empty -> l1
| _, _ -> Regular_callback_list_concat (l1, l2)
end [@ocaml.warning "-4"]
end

let concat_cancel_callbacks l1 l2 =
begin match l1, l2 with
| Cancel_callback_list_empty, _ -> l2
| _, Cancel_callback_list_empty -> l1
| _, _ -> Cancel_callback_list_concat (l1, l2)
end [@ocaml.warning "-4"]
end

(* In a callback list, filters out cells of explicitly removable callbacks
that have been removed. *)
Expand Down
2 changes: 0 additions & 2 deletions src/core/lwt_condition.ml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@
("deprecated"), and create a local, non-deprecated alias for
[Lwt_sequence] that can be referred to by the rest of the code in this
module without triggering any more warnings. *)
[@@@ocaml.warning "-3"]
module Lwt_sequence = Lwt_sequence
[@@@ocaml.warning "+3"]

type 'a t = 'a Lwt.u Lwt_sequence.t

Expand Down
2 changes: 0 additions & 2 deletions src/core/lwt_mutex.ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
("deprecated"), and create a local, non-deprecated alias for
[Lwt_sequence] that can be referred to by the rest of the code in this
module without triggering any more warnings. *)
[@@@ocaml.warning "-3"]
module Lwt_sequence = Lwt_sequence
[@@@ocaml.warning "+3"]

open Lwt.Infix

Expand Down
2 changes: 0 additions & 2 deletions src/core/lwt_mvar.ml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@
("deprecated"), and create a local, non-deprecated alias for
[Lwt_sequence] that can be referred to by the rest of the code in this
module without triggering any more warnings. *)
[@@@ocaml.warning "-3"]
module Lwt_sequence = Lwt_sequence
[@@@ocaml.warning "+3"]

type 'a t = {
mutable mvar_contents : 'a option;
Expand Down
2 changes: 0 additions & 2 deletions src/core/lwt_pool.ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
("deprecated"), and create a local, non-deprecated alias for
[Lwt_sequence] that can be referred to by the rest of the code in this
module without triggering any more warnings. *)
[@@@ocaml.warning "-3"]
module Lwt_sequence = Lwt_sequence
[@@@ocaml.warning "+3"]

open Lwt.Infix

Expand Down
20 changes: 4 additions & 16 deletions src/ppx/dune
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
(* -*- tuareg -*- *)

let bisect_ppx =
match Sys.getenv "BISECT_ENABLE" with
| "yes" -> "bisect_ppx"
| _ -> ""
| exception _ -> ""

let () = Jbuild_plugin.V1.send @@ {|

(library
(name ppx_lwt)
(public_name lwt_ppx)
(synopsis "Lwt PPX syntax extension")
(modules ppx_lwt)
(libraries ppxlib)
(ppx_runtime_libraries lwt)
(kind ppx_rewriter)
(preprocess (pps ppxlib.metaquot|} ^ bisect_ppx ^ {|))
(flags (:standard -w +A-4)))

|}
(preprocess
(pps ppxlib.metaquot))
(instrumentation
(backend bisect_ppx)))
16 changes: 2 additions & 14 deletions src/react/dune
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
(* -*- tuareg -*- *)

let preprocess =
match Sys.getenv "BISECT_ENABLE" with
| "yes" -> "(preprocess (pps bisect_ppx))"
| _ -> ""
| exception _ -> ""

let () = Jbuild_plugin.V1.send @@ {|

(library
(public_name lwt_react)
(synopsis "Reactive programming helpers for Lwt")
(wrapped false)
(libraries lwt react)
|} ^ preprocess ^ {|
(flags (:standard -w +A)))

|}
(instrumentation
(backend bisect_ppx)))
16 changes: 2 additions & 14 deletions src/retry/dune
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
(* -*- tuareg -*- *)

let preprocess =
match Sys.getenv "BISECT_ENABLE" with
| "yes" -> "(preprocess (pps bisect_ppx))"
| _ -> ""
| exception _ -> ""

let () = Jbuild_plugin.V1.send @@ {|

(library
(public_name lwt_retry)
(synopsis "A utility for retrying Lwt computations")
(wrapped false)
(libraries lwt lwt.unix)
|} ^ preprocess ^ {|
(flags (:standard -w +A)))

|}
(instrumentation
(backend bisect_ppx)))
Loading

0 comments on commit 8e1a82d

Please sign in to comment.