Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for OCaml 4.12 #804

Merged
merged 10 commits into from
Nov 23, 2020
12 changes: 9 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,21 @@ scripts:

matrix:
include:
- <<: *opam
os: linux
env: COMPILER=4.12.0+trunk REPOSITORIES=--repo=default,beta=git://github.com/ocaml/ocaml-beta-repository.git
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest using the 4.12 alpha release at this point.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would argue against. In my experience running +trunk is more stable than running any ~alpha/~beta. The changes are slow and rather incremental. If something is done in the 4.12 branch and break something here then it should be reported / fixed. But again, in my experience, once branched out, the alpha/beta branches are quite stable and contain bug fixes that are not in the ~alpha/~beta releases.

If that can help you I could add it to the allow_failures list though.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with your argument, thanks. I think it does belong in allow_failures for how the Lwt CI is set up.

- <<: *opam
os: linux
env: COMPILER=4.11.1
- <<: *opam
os: osx
env: COMPILER=4.10.0 LIBEV=no
env: COMPILER=4.10.1 LIBEV=no
- <<: *opam
os: linux
env: COMPILER=4.10.0 LIBEV=no PPX_LET=yes
env: COMPILER=4.10.1 LIBEV=no PPX_LET=yes
- <<: *opam
os: linux
env: COMPILER=4.09.0 DOCS=yes
env: COMPILER=4.09.1 DOCS=yes
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you tweak the rows in allow_failures, so that it recognizes the 4.09 row again? We should also add 4.10 and 4.12 to allow_failures. Travis is set up to require on Linux the least and greatest OCaml release that we test (4.02.3 and 4.11.1, respectively, in this PR), and the rest are in allow_failures so that we can get build feedback faster if Travis has a build backlog.

- <<: *opam
os: linux
env: COMPILER=4.08.1+musl+flambda MUSL=yes
Expand Down
7 changes: 2 additions & 5 deletions src/core/lwt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -627,11 +627,8 @@ struct
If multiple [Proxy _] links are traversed, [underlying] updates all the
proxies to point immediately to their final underlying promise. *)
let rec underlying
: 'u 'c. ('a, 'u, 'c) promise -> ('a, underlying, 'c) promise =
fun
(type u)
(type c)
(p : ('a, u, c) promise) ->
: type u c. ('a, u, c) promise -> ('a, underlying, c) promise =
fun p ->

match p.state with
| Fulfilled _ -> (p : (_, underlying, _) promise)
Expand Down
5 changes: 5 additions & 0 deletions src/unix/lwt_unix.cppo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,11 @@ let choose_async_method = function
| Some am -> am
| None -> !default_async_method_var

[@@@ocaml.warning "-16"]
let execute_job ?async_method ~job ~result ~free =
let async_method = choose_async_method async_method in
run_job_aux async_method job (fun job -> let x = wrap_result result job in free job; x)
[@@@ocaml.warning "+16"]

external self_result : 'a job -> 'a = "lwt_unix_self_result"
(* returns the result of a job using the [result] field of the C
Expand Down Expand Up @@ -1819,6 +1821,9 @@ type socket_bool_option =
| SO_DEBUG
| SO_BROADCAST
| SO_REUSEADDR
#if OCAML_VERSION >= (4, 12, 0)
| SO_REUSEPORT
#endif
| SO_KEEPALIVE
| SO_DONTROUTE
| SO_OOBINLINE
Expand Down
3 changes: 3 additions & 0 deletions src/unix/lwt_unix.cppo.mli
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,9 @@ type socket_bool_option =
| SO_DEBUG
| SO_BROADCAST
| SO_REUSEADDR
#if OCAML_VERSION >= (4, 12, 0)
| SO_REUSEPORT
#endif
| SO_KEEPALIVE
| SO_DONTROUTE
| SO_OOBINLINE
Expand Down