Skip to content

Commit

Permalink
Merge branch 'ocsigen:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
seprov authored Nov 21, 2024
2 parents 16173d1 + 7eab825 commit f22dc1c
Show file tree
Hide file tree
Showing 37 changed files with 257 additions and 338 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
16 changes: 16 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
===== 5.9.0 =====

====== Additions ======

* Lwt_stream.junk_available is a Lwt-free alternative to Lwt_stream.junk_old. (Alain Mebsout, #1036)

* Lwt_engine.libev#backend indicates which backend was picked by libev. (mefyl, bnguyenvanyen, #985)

====== Documentation ======

* Many fixes. (Arvid Jakobsson, #1038)

====== Other ======

* Misc repository maintenance. (Sora Morimoto, Shon Feder, #1037, #1035)

===== 5.8.0 =====

====== Improvements ======
Expand Down
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
9 changes: 6 additions & 3 deletions lwt_retry.opam
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ 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}
]
dev-repo: "git+https://github.com/ocsigen/lwt.git"
build: [
["dune" "subst"] {pinned}
["dune" "subst"] {dev}
[
"dune"
"build"
Expand All @@ -28,4 +31,4 @@ build: [
"@doc" {with-doc}
]
]
dev-repo: "git+https://github.com/ocsigen/lwt.git"

15 changes: 15 additions & 0 deletions lwt_retry.opam.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
build: [
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]

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 f22dc1c

Please sign in to comment.