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 18, 2024
1 parent 94ce0b4 commit e165bb4
Show file tree
Hide file tree
Showing 17 changed files with 104 additions and 287 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
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
6 changes: 4 additions & 2 deletions lwt_retry.opam
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ homepage: "https://github.com/ocsigen/lwt"
doc: "https://ocsigen.org/lwt"
bug-reports: "https://github.com/ocsigen/lwt/issues"
depends: [
"dune" {>= "2.0"}
"dune" {>= "2.7"}
"ocaml" {>= "4.08"}
"lwt" {>= "5.3.0"}
"bisect_ppx" {with-test}
"odoc" {with-doc}
]
build: [
["dune" "subst"] {pinned}
["dune" "subst"] {dev}
[
"dune"
"build"
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))

|}
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 e165bb4

Please sign in to comment.