diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 1d0d8a6db..423bd0f5b 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -1,4 +1,4 @@ -name: Main workflow +name: Builds, tests & co on: pull_request: @@ -8,21 +8,22 @@ on: - cron: 0 1 * * MON jobs: - build: + build-and-test: strategy: fail-fast: false matrix: os: - ubuntu-latest ocaml-compiler: - - 4.08.x - - 4.09.x - - 4.10.x - - 4.11.x - - 4.12.x - - 4.13.x - - 4.14.x - - 5.0.x + - "4.08" + - "4.09" + - "4.10" + - "4.11" + - "4.12" + - "4.13" + - "4.14" + - "5.0" + - "5.1" libev: - true - false @@ -33,7 +34,7 @@ jobs: *.opam include: - os: ubuntu-latest - ocaml-compiler: ocaml-variants.4.14.0+options,ocaml-option-flambda,ocaml-option-musl,ocaml-option-static + ocaml-compiler: ocaml-variants.4.14.2+options,ocaml-option-flambda,ocaml-option-musl,ocaml-option-static libev: false ppx: true local-packages: | @@ -75,20 +76,19 @@ jobs: runs-on: ${{ matrix.os }} steps: + - name: Hack Git CRLF for ocaml/setup-ocaml#529 issue + run: git config --global core.autocrlf input + - name: Checkout code uses: actions/checkout@v4 - - name: Hack Git CRLF for ocaml/setup-ocaml issue #529 - if: ${{ startsWith(matrix.os, 'windows-') }} - run: | - & "C:\Program Files\Git\bin\git.exe" config --system core.autocrlf input - - - name: Use OCaml ${{ matrix.ocaml-compiler }} + - name: Set-up OCaml uses: ocaml/setup-ocaml@v2 with: ocaml-compiler: ${{ matrix.ocaml-compiler }} opam-depext-flags: --with-test opam-local-packages: ${{ matrix.local-packages }} + allow-prerelease-opam: true - run: opam depext conf-libev --install if: ${{ matrix.libev == true }} @@ -110,3 +110,19 @@ jobs: - run: opam exec -- make ppx_let-test-deps ppx_let-test if: ${{ matrix.ppx == true }} + + # lint-opam: + # runs-on: ubuntu-latest + + # steps: + # - name: Checkout tree + # uses: actions/checkout@v4 + + # - name: Set-up OCaml + # uses: ocaml/setup-ocaml@v2 + # with: + # ocaml-compiler: "5.1" + # allow-prerelease-opam: true + # dune-cache: true + + # - uses: ocaml/setup-ocaml/lint-opam@v2 diff --git a/dune-project b/dune-project index bfe19a202..fcbe532a7 100644 --- a/dune-project +++ b/dune-project @@ -1 +1,59 @@ -(lang dune 1.8) +(lang dune 1.12) + +(name lwt) + +(generate_opam_files true) + +(maintainers + "Raphaël Proust " + "Anton Bachin ") +(authors "Jérôme Vouillon" "Jérémie Dimino") +(license MIT) +(source (github ocsigen/lwt)) +(documentation "https://ocsigen.org/lwt") + +(package + (name lwt_ppx_let) + (synopsis "Dummy package context for ppx_let tests") + (description "Internal package used to partition ppx_let tests.") + (depends + (ocaml (>= 4.08)) + (ppx_let :with-test) + lwt)) + +(package + (name lwt_ppx) + (synopsis "PPX syntax for Lwt, providing something similar to async/await from JavaScript") + (depends + (ocaml (>= 4.08)) + (ppxlib (>= 0.16.0)) + lwt)) + +(package + (name lwt_react) + (synopsis "Helpers for using React with Lwt") + (depends + (ocaml (>= 4.08)) + (cppo (and :build (>= 1.1.0))) + (lwt (>= 3.0.0)) + (react (>= 1.0.0)))) + +(package + (name lwt) + (synopsis "Promises and event-driven I/O") + (description "A promise is a value that may become determined in the future. + +Lwt provides typed, composable promises. Promises that are resolved by I/O are +resolved by Lwt in parallel. + +Meanwhile, OCaml code, including code creating and waiting on promises, runs in +a single thread by default. This reduces the need for locks or other +synchronization primitives. Code can be run in parallel on an opt-in basis. +") + (depends + (ocaml (>= 4.08)) + (cppo (and :build (>= 1.1.0))) + (ocamlfind (and :dev (>= 1.7.3-1))) + dune-configurator + ocplib-endian) + (depopts base-threads base-unix conf-libev)) diff --git a/lwt.opam b/lwt.opam index 2cecf8b66..75bcc6274 100644 --- a/lwt.opam +++ b/lwt.opam @@ -1,52 +1,55 @@ +# This file is generated by dune, edit dune-project instead opam-version: "2.0" - synopsis: "Promises and event-driven I/O" +description: """ +A promise is a value that may become determined in the future. + +Lwt provides typed, composable promises. Promises that are resolved by I/O are +resolved by Lwt in parallel. -version: "5.7.0" +Meanwhile, OCaml code, including code creating and waiting on promises, runs in +a single thread by default. This reduces the need for locks or other +synchronization primitives. Code can be run in parallel on an opt-in basis. +""" +maintainer: [ + "Raphaël Proust " "Anton Bachin " +] +authors: ["Jérôme Vouillon" "Jérémie Dimino"] license: "MIT" homepage: "https://github.com/ocsigen/lwt" doc: "https://ocsigen.org/lwt" bug-reports: "https://github.com/ocsigen/lwt/issues" - -authors: [ - "Jérôme Vouillon" - "Jérémie Dimino" -] -maintainer: [ - "Raphaël Proust " - "Anton Bachin " -] -dev-repo: "git+https://github.com/ocsigen/lwt.git" - depends: [ + "dune" {>= "1.12"} + "ocaml" {>= "4.08"} "cppo" {build & >= "1.1.0"} - "dune" {>= "1.8.0"} + "ocamlfind" {dev & >= "1.7.3-1"} "dune-configurator" - "ocaml" {>= "4.08"} "ocplib-endian" - - # Until https://github.com/aantron/bisect_ppx/pull/327. - # "bisect_ppx" {dev & >= "2.0.0"} - "ocamlfind" {dev & >= "1.7.3-1"} ] - -depopts: [ - "base-threads" - "base-unix" - "conf-libev" -] - +depopts: ["base-threads" "base-unix" "conf-libev"] +dev-repo: "git+https://github.com/ocsigen/lwt.git" build: [ - ["dune" "exec" "-p" name "src/unix/config/discover.exe" "--" "--save" - "--use-libev" "%{conf-libev:installed}%"] - ["dune" "build" "-p" name "-j" jobs] + ["dune" "subst"] {pinned} + [ + "dune" + "exec" + "-p" + name + "src/unix/config/discover.exe" + "--" + "--save" + "--use-libev" "%{conf-libev:installed}%" + ] + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] ] - -description: "A promise is a value that may become determined in the future. - -Lwt provides typed, composable promises. Promises that are resolved by I/O are -resolved by Lwt in parallel. - -Meanwhile, OCaml code, including code creating and waiting on promises, runs in -a single thread by default. This reduces the need for locks or other -synchronization primitives. Code can be run in parallel on an opt-in basis." diff --git a/lwt.opam.template b/lwt.opam.template new file mode 100644 index 000000000..8fc8771fc --- /dev/null +++ b/lwt.opam.template @@ -0,0 +1,24 @@ +build: [ + ["dune" "subst"] {pinned} + [ + "dune" + "exec" + "-p" + name + "src/unix/config/discover.exe" + "--" + "--save" + "--use-libev" "%{conf-libev:installed}%" + ] + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] diff --git a/lwt_ppx.opam b/lwt_ppx.opam index 63c37abe8..958244c1f 100644 --- a/lwt_ppx.opam +++ b/lwt_ppx.opam @@ -1,28 +1,33 @@ +# This file is generated by dune, edit dune-project instead opam-version: "2.0" - -synopsis: "PPX syntax for Lwt, providing something similar to async/await from JavaScript" - -version: "2.1.0" +synopsis: + "PPX syntax for Lwt, providing something similar to async/await from JavaScript" +maintainer: [ + "Raphaël Proust " "Anton Bachin " +] +authors: ["Jérôme Vouillon" "Jérémie Dimino"] license: "MIT" homepage: "https://github.com/ocsigen/lwt" -doc: "https://ocsigen.org/lwt/dev/api/Ppx_lwt" +doc: "https://ocsigen.org/lwt" bug-reports: "https://github.com/ocsigen/lwt/issues" - -authors: [ - "Gabriel Radanne" -] -maintainer: [ - "Anton Bachin " -] -dev-repo: "git+https://github.com/ocsigen/lwt.git" - depends: [ - "dune" {>= "1.8.0"} - "lwt" + "dune" {>= "1.12"} "ocaml" {>= "4.08"} "ppxlib" {>= "0.16.0"} + "lwt" ] - build: [ - ["dune" "build" "-p" name "-j" jobs] + ["dune" "subst"] {pinned} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] ] +dev-repo: "git+https://github.com/ocsigen/lwt.git" diff --git a/lwt_ppx_let.opam b/lwt_ppx_let.opam index 255acc4d4..8fbb382a3 100644 --- a/lwt_ppx_let.opam +++ b/lwt_ppx_let.opam @@ -1,28 +1,33 @@ +# This file is generated by dune, edit dune-project instead opam-version: "2.0" - synopsis: "Dummy package context for ppx_let tests" - -version: "5.7.0" +description: "Internal package used to partition ppx_let tests." +maintainer: [ + "Raphaël Proust " "Anton Bachin " +] +authors: ["Jérôme Vouillon" "Jérémie Dimino"] license: "MIT" homepage: "https://github.com/ocsigen/lwt" doc: "https://ocsigen.org/lwt" bug-reports: "https://github.com/ocsigen/lwt/issues" - -authors: [ - "Jérôme Vouillon" - "Jérémie Dimino" -] -maintainer: [ - "Raphaël Proust " - "Anton Bachin " -] -dev-repo: "git+https://github.com/ocsigen/lwt.git" - depends: [ - "dune" {>= "1.8.0"} - "lwt" - "ppx_let" {with-test} + "dune" {>= "1.12"} "ocaml" {>= "4.08"} + "ppx_let" {with-test} + "lwt" ] - -description: "Internal package used to partition ppx_let tests." +build: [ + ["dune" "subst"] {pinned} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] +dev-repo: "git+https://github.com/ocsigen/lwt.git" diff --git a/lwt_react.opam b/lwt_react.opam index c1623389d..7f5d7e195 100644 --- a/lwt_react.opam +++ b/lwt_react.opam @@ -1,29 +1,33 @@ +# This file is generated by dune, edit dune-project instead opam-version: "2.0" - synopsis: "Helpers for using React with Lwt" - -version: "1.2.0" +maintainer: [ + "Raphaël Proust " "Anton Bachin " +] +authors: ["Jérôme Vouillon" "Jérémie Dimino"] license: "MIT" homepage: "https://github.com/ocsigen/lwt" -doc: "https://ocsigen.org/lwt/dev/api/Lwt_react" +doc: "https://ocsigen.org/lwt" bug-reports: "https://github.com/ocsigen/lwt/issues" - -authors: [ - "Jérémie Dimino" -] -maintainer: [ - "Anton Bachin " -] -dev-repo: "git+https://github.com/ocsigen/lwt.git" - depends: [ - "dune" {>= "1.8.0"} - "lwt" {>= "3.0.0"} + "dune" {>= "1.12"} "ocaml" {>= "4.08"} - "react" {>= "1.0.0"} "cppo" {build & >= "1.1.0"} + "lwt" {>= "3.0.0"} + "react" {>= "1.0.0"} ] - build: [ - ["dune" "build" "-p" name "-j" jobs] + ["dune" "subst"] {pinned} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] ] +dev-repo: "git+https://github.com/ocsigen/lwt.git"