From 934819c28dd9e1f5596a69342f36f1c19e9c9cc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Proust?= Date: Fri, 4 Oct 2024 09:48:03 +0200 Subject: [PATCH 1/5] Add contributions to CHANGES for 5.8.0 --- CHANGES | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/CHANGES b/CHANGES index 02f2e4737..b154aeea3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,27 @@ +===== 5.8.0 ===== + +====== Improvements ====== + + * Make Lwt_seq.of_list lazier, make Lwt_set.to_list tail-rec. (Samer Abdallah, #1019) + + * Convert more Lwt.fail into raise to increase availibility of backtraces. (#1008) + +====== Documentation ====== + + * Small fixes. (Nils André, #1001, #1006) + + * Convert manual to mld. (#951, Antonin Décimo) + +====== Other ====== + + * Many improbements to the CI. (Sora Morimoto, Idir Lankri, #986, #1009, #1011, #1013, #1014, #1016, #1020, #1021, #1023, #1024, #1025) + + * Improbements to the packaging. (Sora Morimoto, #1010, #1015) + + * Make C code pass the stricter checks of GCC 14. (Jerry James, #1004) + + * Fix many many C warnings and other fixes. (Antonin Décimo, #1007, #1022) + ===== 5.7.0 ===== ====== Breaking API changes ====== From 530c0d1d25b21848cdc0f05a37708db4f0103676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Proust?= Date: Fri, 4 Oct 2024 09:53:00 +0200 Subject: [PATCH 2/5] fix opam invocation of `dune subst` --- lwt.opam | 2 +- lwt.opam.template | 2 +- lwt_ppx.opam | 2 +- lwt_ppx_let.opam | 2 +- lwt_react.opam | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lwt.opam b/lwt.opam index 2f0979c47..2c11eac3f 100644 --- a/lwt.opam +++ b/lwt.opam @@ -31,7 +31,7 @@ depends: [ depopts: ["base-threads" "base-unix" "conf-libev"] dev-repo: "git+https://github.com/ocsigen/lwt.git" build: [ - ["dune" "subst"] {pinned} + ["dune" "subst"] {dev} [ "dune" "exec" diff --git a/lwt.opam.template b/lwt.opam.template index 8fc8771fc..dc64b241a 100644 --- a/lwt.opam.template +++ b/lwt.opam.template @@ -1,5 +1,5 @@ build: [ - ["dune" "subst"] {pinned} + ["dune" "subst"] {dev} [ "dune" "exec" diff --git a/lwt_ppx.opam b/lwt_ppx.opam index 958244c1f..b4a6b08fd 100644 --- a/lwt_ppx.opam +++ b/lwt_ppx.opam @@ -17,7 +17,7 @@ depends: [ "lwt" ] build: [ - ["dune" "subst"] {pinned} + ["dune" "subst"] {dev} [ "dune" "build" diff --git a/lwt_ppx_let.opam b/lwt_ppx_let.opam index 8fbb382a3..7ce9fe37e 100644 --- a/lwt_ppx_let.opam +++ b/lwt_ppx_let.opam @@ -17,7 +17,7 @@ depends: [ "lwt" ] build: [ - ["dune" "subst"] {pinned} + ["dune" "subst"] {dev} [ "dune" "build" diff --git a/lwt_react.opam b/lwt_react.opam index 7f5d7e195..236db54bb 100644 --- a/lwt_react.opam +++ b/lwt_react.opam @@ -17,7 +17,7 @@ depends: [ "react" {>= "1.0.0"} ] build: [ - ["dune" "subst"] {pinned} + ["dune" "subst"] {dev} [ "dune" "build" From fcb2272403709568ed24317fb564ba1e0c60444d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Proust?= Date: Fri, 4 Oct 2024 09:59:26 +0200 Subject: [PATCH 3/5] mark version as not available for ocaml.5.2 on windows See https://github.com/ocsigen/lwt/pull/967 Version 5.8.1 will be a point fix release for availability --- lwt.opam | 1 + 1 file changed, 1 insertion(+) diff --git a/lwt.opam b/lwt.opam index 2c11eac3f..cb65673fe 100644 --- a/lwt.opam +++ b/lwt.opam @@ -54,3 +54,4 @@ build: [ "@doc" {with-doc} ] ] +available: os-family != "windows" | "ocaml-version" < "5.2" From 0ebb88e38ffc234fb7fa4c2cb6a665b0bbd30294 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Mon, 7 Oct 2024 18:26:15 +0200 Subject: [PATCH 4/5] Wrap caml_convert_flag_list in lwt_convert_flag_list for compat See https://github.com/ocaml/opam-repository/pull/26668 --- src/unix/lwt_unix.h | 4 +++- src/unix/unix_c/unix_bytes_recv.c | 2 +- src/unix/unix_c/unix_bytes_recvfrom.c | 2 +- src/unix/unix_c/unix_bytes_send.c | 2 +- src/unix/unix_c/unix_bytes_sendto.c | 2 +- src/unix/unix_c/unix_getnameinfo_job.c | 2 +- src/unix/unix_c/unix_open_job.c | 4 ++-- src/unix/unix_c/unix_recv.c | 2 +- src/unix/unix_c/unix_recvfrom.c | 2 +- src/unix/unix_c/unix_send.c | 2 +- src/unix/unix_c/unix_sendto.c | 2 +- src/unix/unix_c/unix_wait4.c | 2 +- 12 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/unix/lwt_unix.h b/src/unix/lwt_unix.h index 47f093016..125ca7a12 100644 --- a/src/unix/lwt_unix.h +++ b/src/unix/lwt_unix.h @@ -15,8 +15,10 @@ #include #if OCAML_VERSION < 50000 -#define caml_convert_flag_list(flags, table) \ +#define lwt_convert_flag_list(flags, table) \ caml_convert_flag_list((flags), (int *)(table)) +#else +#define lwt_convert_flag_list caml_convert_flag_list #endif /* The macro to get the file-descriptor from a value. */ diff --git a/src/unix/unix_c/unix_bytes_recv.c b/src/unix/unix_c/unix_bytes_recv.c index fac0ebda8..a535bc07c 100644 --- a/src/unix/unix_c/unix_bytes_recv.c +++ b/src/unix/unix_c/unix_bytes_recv.c @@ -23,7 +23,7 @@ value lwt_unix_bytes_recv(value fd, value buf, value ofs, value len, int ret; ret = recv(Int_val(fd), (char *)Caml_ba_array_val(buf)->data + Long_val(ofs), - Long_val(len), caml_convert_flag_list(flags, msg_flag_table)); + Long_val(len), lwt_convert_flag_list(flags, msg_flag_table)); if (ret == -1) uerror("recv", Nothing); return Val_int(ret); } diff --git a/src/unix/unix_c/unix_bytes_recvfrom.c b/src/unix/unix_c/unix_bytes_recvfrom.c index 1ae1c65a1..b05b221e6 100644 --- a/src/unix/unix_c/unix_bytes_recvfrom.c +++ b/src/unix/unix_c/unix_bytes_recvfrom.c @@ -29,7 +29,7 @@ value lwt_unix_bytes_recvfrom(value fd, value buf, value ofs, value len, socklen_t addr_len; addr_len = sizeof(addr); ret = recvfrom(Int_val(fd), (char *)Caml_ba_data_val(buf) + Long_val(ofs), - Long_val(len), caml_convert_flag_list(flags, msg_flag_table), + Long_val(len), lwt_convert_flag_list(flags, msg_flag_table), &addr.s_gen, &addr_len); if (ret == -1) uerror("recvfrom", Nothing); address = alloc_sockaddr(&addr, addr_len, -1); diff --git a/src/unix/unix_c/unix_bytes_send.c b/src/unix/unix_c/unix_bytes_send.c index 2bdd44a34..558afdd38 100644 --- a/src/unix/unix_c/unix_bytes_send.c +++ b/src/unix/unix_c/unix_bytes_send.c @@ -23,7 +23,7 @@ value lwt_unix_bytes_send(value fd, value buf, value ofs, value len, int ret; ret = send(Int_val(fd), (char *)Caml_ba_array_val(buf)->data + Long_val(ofs), - Long_val(len), caml_convert_flag_list(flags, msg_flag_table)); + Long_val(len), lwt_convert_flag_list(flags, msg_flag_table)); if (ret == -1) uerror("send", Nothing); return Val_int(ret); } diff --git a/src/unix/unix_c/unix_bytes_sendto.c b/src/unix/unix_c/unix_bytes_sendto.c index e9610b895..a555b534f 100644 --- a/src/unix/unix_c/unix_bytes_sendto.c +++ b/src/unix/unix_c/unix_bytes_sendto.c @@ -26,7 +26,7 @@ value lwt_unix_bytes_sendto(value fd, value buf, value ofs, value len, int ret; get_sockaddr(dest, &addr, &addr_len); ret = sendto(Int_val(fd), (char *)Caml_ba_data_val(buf) + Long_val(ofs), - Long_val(len), caml_convert_flag_list(flags, msg_flag_table), + Long_val(len), lwt_convert_flag_list(flags, msg_flag_table), &addr.s_gen, addr_len); if (ret == -1) uerror("send", Nothing); return Val_int(ret); diff --git a/src/unix/unix_c/unix_getnameinfo_job.c b/src/unix/unix_c/unix_getnameinfo_job.c index 8f5e3bbdb..608dcd3bb 100644 --- a/src/unix/unix_c/unix_getnameinfo_job.c +++ b/src/unix/unix_c/unix_getnameinfo_job.c @@ -60,7 +60,7 @@ CAMLprim value lwt_unix_getnameinfo_job(value sockaddr, value opts) { LWT_UNIX_INIT_JOB(job, getnameinfo, 0); get_sockaddr(sockaddr, &job->addr, &job->addr_len); - job->opts = caml_convert_flag_list(opts, getnameinfo_flag_table); + job->opts = lwt_convert_flag_list(opts, getnameinfo_flag_table); return lwt_unix_alloc_job(&job->job); } #endif diff --git a/src/unix/unix_c/unix_open_job.c b/src/unix/unix_c/unix_open_job.c index 0c1be8459..675fc3db6 100644 --- a/src/unix/unix_c/unix_open_job.c +++ b/src/unix/unix_c/unix_open_job.c @@ -113,8 +113,8 @@ static value result_open(struct job_open *job) CAMLprim value lwt_unix_open_job(value name, value flags, value perms) { LWT_UNIX_INIT_JOB_STRING(job, open, 0, name); - job->fd = caml_convert_flag_list(flags, open_cloexec_table); - job->flags = caml_convert_flag_list(flags, open_flag_table); + job->fd = lwt_convert_flag_list(flags, open_cloexec_table); + job->flags = lwt_convert_flag_list(flags, open_flag_table); job->perms = Int_val(perms); return lwt_unix_alloc_job(&(job->job)); } diff --git a/src/unix/unix_c/unix_recv.c b/src/unix/unix_c/unix_recv.c index 4456d7421..d3fec45fb 100644 --- a/src/unix/unix_c/unix_recv.c +++ b/src/unix/unix_c/unix_recv.c @@ -20,7 +20,7 @@ value lwt_unix_recv(value fd, value buf, value ofs, value len, value flags) { int ret; ret = recv(Int_val(fd), &Byte(String_val(buf), Long_val(ofs)), - Long_val(len), caml_convert_flag_list(flags, msg_flag_table)); + Long_val(len), lwt_convert_flag_list(flags, msg_flag_table)); if (ret == -1) uerror("recv", Nothing); return Val_int(ret); } diff --git a/src/unix/unix_c/unix_recvfrom.c b/src/unix/unix_c/unix_recvfrom.c index fd86c247a..2b50a7203 100644 --- a/src/unix/unix_c/unix_recvfrom.c +++ b/src/unix/unix_c/unix_recvfrom.c @@ -27,7 +27,7 @@ value lwt_unix_recvfrom(value fd, value buf, value ofs, value len, value flags) socklen_t addr_len; addr_len = sizeof(addr); ret = recvfrom(Int_val(fd), &Byte(String_val(buf), Long_val(ofs)), - Long_val(len), caml_convert_flag_list(flags, msg_flag_table), + Long_val(len), lwt_convert_flag_list(flags, msg_flag_table), &addr.s_gen, &addr_len); if (ret == -1) uerror("recvfrom", Nothing); address = alloc_sockaddr(&addr, addr_len, -1); diff --git a/src/unix/unix_c/unix_send.c b/src/unix/unix_c/unix_send.c index fc4ba34be..efecc8f41 100644 --- a/src/unix/unix_c/unix_send.c +++ b/src/unix/unix_c/unix_send.c @@ -20,7 +20,7 @@ value lwt_unix_send(value fd, value buf, value ofs, value len, value flags) { int ret; ret = send(Int_val(fd), &Byte(String_val(buf), Long_val(ofs)), - Long_val(len), caml_convert_flag_list(flags, msg_flag_table)); + Long_val(len), lwt_convert_flag_list(flags, msg_flag_table)); if (ret == -1) uerror("send", Nothing); return Val_int(ret); } diff --git a/src/unix/unix_c/unix_sendto.c b/src/unix/unix_c/unix_sendto.c index 8a993e669..845f7edd0 100644 --- a/src/unix/unix_c/unix_sendto.c +++ b/src/unix/unix_c/unix_sendto.c @@ -25,7 +25,7 @@ value lwt_unix_sendto(value fd, value buf, value ofs, value len, value flags, int ret; get_sockaddr(dest, &addr, &addr_len); ret = sendto(Int_val(fd), &Byte(String_val(buf), Long_val(ofs)), - Long_val(len), caml_convert_flag_list(flags, msg_flag_table), + Long_val(len), lwt_convert_flag_list(flags, msg_flag_table), &addr.s_gen, addr_len); if (ret == -1) uerror("send", Nothing); return Val_int(ret); diff --git a/src/unix/unix_c/unix_wait4.c b/src/unix/unix_c/unix_wait4.c index ee0acf5e8..86925c424 100644 --- a/src/unix/unix_c/unix_wait4.c +++ b/src/unix/unix_c/unix_wait4.c @@ -67,7 +67,7 @@ value lwt_unix_wait4(value flags, value pid_req) CAMLlocal2(times, res); int pid, status, cv_flags; - cv_flags = caml_convert_flag_list(flags, wait_flag_table); + cv_flags = lwt_convert_flag_list(flags, wait_flag_table); struct rusage ru; From b2e742bb09df9bdead90ddaae450886b74e8b11f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Proust?= Date: Thu, 10 Oct 2024 15:32:10 +0200 Subject: [PATCH 5/5] Update src/unix/lwt_unix.h --- src/unix/lwt_unix.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/unix/lwt_unix.h b/src/unix/lwt_unix.h index 125ca7a12..ab4ad64bf 100644 --- a/src/unix/lwt_unix.h +++ b/src/unix/lwt_unix.h @@ -14,6 +14,9 @@ #include #include +// The following macro is for backwards compatibility. +// It is given an `lwt_` prefix to avoid name collisions for code which +// include both this file and alloc.h. #if OCAML_VERSION < 50000 #define lwt_convert_flag_list(flags, table) \ caml_convert_flag_list((flags), (int *)(table))