Skip to content

Commit

Permalink
LWT 5 support (links-lang#804)
Browse files Browse the repository at this point in the history
* Lwt 5.* wont compile

Resolved by installing conf-libev as suggested by ocsigen/lwt#760

* Nested calls to `Lwt_main.run`

Lwt 5.* prohibits nested calls of `Lwt_main.run`. Previously every call to `Proc.run` would invoke `Lwt_main.run` which could result in nested calls. To resolve this `Proc.run` no longer calls `Lwt_main.run` rather we now have a function `start : (unit -> 'a Lwt.t) -> 'a` which is called once when the evaluator starts. This requires a change of types for `Proc.run` such that it returns a `Lwt` computation, meaning its signature is now `(unit -> 'a Lwt.t) -> 'a Lwt.t`. As a consequence it is necessary to move `value` from `evalir.ml` into the Lwt monad, because `Proc.atomically` (used in `ApplyPure`) was re-calling the main LWT entry point.

Co-authored-by: Simon Fowler <[email protected]>
  • Loading branch information
2 people authored and frank-emrich committed Sep 16, 2020
1 parent 63500bb commit 6e48ddd
Show file tree
Hide file tree
Showing 7 changed files with 202 additions and 180 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ services:
before_install:
- sudo add-apt-repository -y ppa:avsm/ppa
- sudo apt-get -qq update
- sudo apt-get install -y ocaml-nox ocaml-native-compilers python3-setuptools python3-pip
- sudo apt-get install -y ocaml-nox ocaml-native-compilers python3-setuptools python3-pip libev-dev
- pip3 install -U Sphinx
- ./install_local_opam2.sh
- ./opam2_local switch create ocaml-base-compiler.4.06.0
- eval `./opam2_local config env`
- ./opam2_local install conf-libev
- ./opam2_local install -y postgresql ounit2 ocamlformat
- make rule-check
- psql -c 'create database links;' -U postgres
Expand Down
11 changes: 10 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,22 @@ steps:
- script: |
eval `./opam2_local env`
./opam2_local install ocamlformat -y
displayName: 'Ocamlformat'
displayName: 'OCamlformat'
- script: |
eval `./opam2_local env`
make rule-check
displayName: 'Rule check'
- bash: |
case $AGENT_OS in
"Linux") sudo apt-get install libev-dev &&
eval `./opam2_local env` &&
./opam2_local install conf-libev -y ;;
*) exit 1 ;;
esac
displayName: 'Install libev (necessary step to make Lwt 5 compile in this container)'
- bash: |
case $AGENT_OS in
"Linux") sudo apt-get install postgresql libpq-dev sqlite3 libsqlite3-dev &&
Expand Down
Loading

0 comments on commit 6e48ddd

Please sign in to comment.