Skip to content

Commit e746d4d

Browse files
restore lwt_ppx compatible with ocaml4
1 parent f13f05f commit e746d4d

File tree

8 files changed

+64
-22
lines changed

8 files changed

+64
-22
lines changed

.github/workflows/workflow.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ jobs:
4949
run: |
5050
case ${{ matrix.ocaml-compiler }} in
5151
"4.08"|"4.09"|"4.10"|"4.11"|"4.12"|"4.13"|"4.14"|"5.0")
52-
echo "ppx=false"
53-
echo "ppx=false" >> "$GITHUB_OUTPUT"
52+
echo "letppx=false"
53+
echo "letppx=false" >> "$GITHUB_OUTPUT"
5454
;;
5555
"5.1"|"5.2"|"5.3")
56-
echo "ppx=true"
57-
echo "ppx=true" >> "$GITHUB_OUTPUT"
56+
echo "letppx=true"
57+
echo "letppx=true" >> "$GITHUB_OUTPUT"
5858
;;
5959
*)
6060
printf "unrecognised version %s\n" "${{ matrix.ocaml-compiler }}";
@@ -73,20 +73,20 @@ jobs:
7373
- run: opam install conf-libev
7474
if: ${{ matrix.libev == true }}
7575

76-
- run: opam install ./lwt.opam ./lwt_react.opam ./lwt_retry.opam --deps-only --with-test
76+
- run: opam install ./lwt.opam ./lwt_react.opam ./lwt_retry.opam ./lwt_ppx.opam --deps-only --with-test
7777

78-
- run: opam install ./lwt_ppx.opam --deps-only --with-test
79-
if: ${{ fromJSON(steps.configppx.outputs.ppx) }}
78+
- run: opam install ./lwt_ppx__ppx_let_tests.opam --deps-only --with-test
79+
if: ${{ fromJSON(steps.configppx.outputs.letppx) }}
8080

8181
- run: opam exec -- dune build --only-packages lwt,lwt_react,lwt_retry
8282

83-
- run: opam exec -- dune build --only-packages lwt_ppx
84-
if: ${{ fromJSON(steps.configppx.outputs.ppx) }}
83+
- run: opam exec -- dune build --only-packages lwt_ppx__let_ppx_tests
84+
if: ${{ fromJSON(steps.configppx.outputs.letppx) }}
8585

86-
- run: opam exec -- dune runtest --only-packages lwt,lwt_react,lwt_retry
86+
- run: opam exec -- dune runtest --only-packages lwt,lwt_react,lwt_retry,lwt_ppx
8787

88-
- run: opam exec -- dune runtest --only-packages lwt_ppx
89-
if: ${{ fromJSON(steps.configppx.outputs.ppx) }}
88+
- run: opam exec -- dune runtest --only-packages lwt_ppx__let_ppx_tests
89+
if: ${{ fromJSON(steps.configppx.outputs.letppx) }}
9090

9191
lint-opam:
9292
runs-on: ubuntu-latest

dune-project

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(lang dune 2.7)
1+
(lang dune 3.15)
22

33
(name lwt)
44

@@ -27,11 +27,20 @@
2727
(name lwt_ppx)
2828
(synopsis "PPX syntax for Lwt, providing something similar to async/await from JavaScript")
2929
(depends
30-
(ocaml (>= 5.1))
30+
(ocaml (>= 4.08))
3131
(ppxlib (>= 0.36))
32-
(ppx_let (and :with-test (>= v0.17.1)))
3332
(lwt (>= 5.7))))
3433

34+
(package
35+
(name lwt_ppx__ppx_let_tests)
36+
(synopsis "DO NOT RELEASE! only for testing let_ppx")
37+
(license NOTFORRELEASE) ;; trap for opam-repo ci
38+
(allow_empty)
39+
(depends
40+
(ocaml (>= 5.1))
41+
(ppx_let (and :with-test (>= v0.17.1)))
42+
lwt_ppx))
43+
3544
(package
3645
(name lwt_react)
3746
(synopsis "Helpers for using React with Lwt")

lwt.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ homepage: "https://github.com/ocsigen/lwt"
2020
doc: "https://ocsigen.org/lwt"
2121
bug-reports: "https://github.com/ocsigen/lwt/issues"
2222
depends: [
23-
"dune" {>= "2.7"}
23+
"dune" {>= "3.15"}
2424
"ocaml" {>= "4.08"}
2525
"cppo" {build & >= "1.1"}
2626
"ocamlfind" {dev & >= "1.7.3-1"}

lwt_ppx.opam

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ homepage: "https://github.com/ocsigen/lwt"
1111
doc: "https://ocsigen.org/lwt"
1212
bug-reports: "https://github.com/ocsigen/lwt/issues"
1313
depends: [
14-
"dune" {>= "2.7"}
15-
"ocaml" {>= "5.1"}
14+
"dune" {>= "3.15"}
15+
"ocaml" {>= "4.08"}
1616
"ppxlib" {>= "0.36"}
17-
"ppx_let" {with-test & >= "v0.17.1"}
1817
"lwt" {>= "5.7"}
1918
"odoc" {with-doc}
2019
]

lwt_ppx__ppx_let_tests.opam

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This file is generated by dune, edit dune-project instead
2+
opam-version: "2.0"
3+
synopsis: "DO NOT RELEASE! only for testing let_ppx"
4+
maintainer: [
5+
"Raphaël Proust <code@bnwr.net>" "Anton Bachin <antonbachin@yahoo.com>"
6+
]
7+
authors: ["Jérôme Vouillon" "Jérémie Dimino"]
8+
license: "NOTFORRELEASE"
9+
homepage: "https://github.com/ocsigen/lwt"
10+
doc: "https://ocsigen.org/lwt"
11+
bug-reports: "https://github.com/ocsigen/lwt/issues"
12+
depends: [
13+
"dune" {>= "3.15"}
14+
"ocaml" {>= "5.1"}
15+
"ppx_let" {with-test & >= "v0.17.1"}
16+
"lwt_ppx"
17+
"odoc" {with-doc}
18+
]
19+
build: [
20+
["dune" "subst"] {dev}
21+
[
22+
"dune"
23+
"build"
24+
"-p"
25+
name
26+
"-j"
27+
jobs
28+
"@install"
29+
"@runtest" {with-test}
30+
"@doc" {with-doc}
31+
]
32+
]
33+
dev-repo: "git+https://github.com/ocsigen/lwt.git"

lwt_react.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ homepage: "https://github.com/ocsigen/lwt"
1010
doc: "https://ocsigen.org/lwt"
1111
bug-reports: "https://github.com/ocsigen/lwt/issues"
1212
depends: [
13-
"dune" {>= "2.7"}
13+
"dune" {>= "3.15"}
1414
"ocaml" {>= "4.08"}
1515
"cppo" {build & >= "1.1"}
1616
"lwt" {>= "3.0"}

lwt_retry.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ homepage: "https://github.com/ocsigen/lwt"
1010
doc: "https://ocsigen.org/lwt"
1111
bug-reports: "https://github.com/ocsigen/lwt/issues"
1212
depends: [
13-
"dune" {>= "2.7"}
13+
"dune" {>= "3.15"}
1414
"ocaml" {>= "4.08"}
1515
"lwt" {>= "5.3"}
1616
"odoc" {with-doc}

test/ppx_let/dune

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(test
22
(name test)
3-
(package lwt_ppx) ;; technically not part of lwt_ppx, but we want it tested and the dependency to ppxlib is already there
3+
(package lwt_ppx__ppx_let_tests)
4+
(build_if %{lib-available:ppx_let})
45
(preprocess
56
(pps ppx_let))
67
(libraries lwt lwt.unix))

0 commit comments

Comments
 (0)