Releases: ocsigen/lwt
Lwt 5.7.0
Breaking API changes
Lwt_result.catch
now takes a function(unit -> 'a t)
rather than a promise('a t)
. (#965)- Remove the deprecated
Lwt.result
type (useStdlib.result
instead). (#968) - Remove the deprecated
Lwt.make_value
andLwt.make_result
functions (useOk
andError
instead). (#968) - Remove the deprecated and unsafe
waiter_of_wakener
(keep the waiter around when you create the wakener instead). (#968) - Remove the deprecated
Lwt_stream.on_termination
andLwt_stream.on_terminate
(bind toLwt_stream.closed
instead). (#968) - Remove the deprecated
Lwt_stream.result
type (useStdlib.result
instead). (#968) - Remove the deprecated
Lwt_stream.map_exn
function (usewrap_exn
instead). (#968)
Additions
Lwt.Exception_filter
for enabling/disabling system-exception catching. (#964)Lwt.reraise
an exception raising function which preserves backtraces, recommended for use inLwt.catch
. (#963)- Expose
Lwt_io.delete_recursively
for deleting a directory and its content recursively. (#984, Antonin Décimo) Lwt_preemptive.run_in_main_dont_wait
to run a function in the main preemptive thread but without waiting for the result. (Kate Deplaix, #960)Lwt_unix.handle_signal
andLwt_engine.forwards_signal
to allow other IO libraries (such as Eio) to share signal handlers. (Thomas Leonard, #993, #991)
Build
- Remove unused dependency in dune file. (#969, Kate Deplaix)
- Fix some compilation warnings for C stubs with OCaml 5. (#976, Antonin Décimo)
Fixes
- Use
SA_ONSTACK
on OCaml5 to avoidSIGSEGV
. (Thomas Leonard, #993, #981) - Fix race in worker loop. (Thomas Leonard, #993, #994)
- Fix marshall header size in
Lwt_io.read_value
. (Simmo Saan, #995)
Misc
- Resolve paused promises only once in main loop. This lets
Lwt.pause
behave identical toLwt_unix.yield
. (#917, Christopher Zimmermann, Favonia)
Lwt 5.6.1
Lwt 5.6.0, Lwt_domain 0.2.0, Lwt_ppx 2.1.0, Lwt_ppx_let 5.6.0, Lwt_react 1.2.0
Installability
- Lwt is now compatible with OCaml 5.00. Lwt is now incompatible with OCaml 4.02. (#925, #923, Kate Deplaix, Patrick Ferris)
- Lwt is now incompatible with OCaml.4.07 and earlier. (#947, Hannes Mehnert, Tim McGilchrist)
- Lwt-unix is now compatible with OCaml 5.0.0. (#953, David Allsopp)
Additions
- In the Lwt_io module, add
?cloexec:bool
optional arguments to functions that create file descriptors (pipe
). The?cloexec
argument is simply forwarded to the wrapped Lwt_unix function. (#872, #911, Antonin Décimo) - Add Lwt_result.error, Lwt_result.iter, and Lwt_result.iter_error for consistency with Stdlib. (#927, Antonin Décimo)
- Lwt_result.bind_error. (#943, Boning Dong)
- Add ?cloexec parameter to Lwt_io.pipe. (#911, Antonin Décimo)
Misc
- On Windows, make Lwt_process.create_process duplicate standard handles given to the child process if they're not inheritable, to mimic the behaviour of Unix.create_process. (#909, Antonin Décimo)
- Add missing dependency to
cppo
in lwt-react's opam file. (#946, Rizo I) - Improve documentation (especially internal links). (#928, Antonin Décimo)
- Fix documentation of infix choose. (#952, Reynir Björnsson)
- Only define OCAML_NAME_SPACE for OCaml<5.0.0. (#929, Antonin Décimo)
- Replace mentions of Pervasives with Stdlib in the doc. (#954, Antonin Décimo)
- Improve deprecation message for auto_yield. (#908, Seb Mondet)
- Fix mirage tutorial link. (#936, Tuomas Lukka)
- Fix issues in opam file. (#937, Andreas Hauptmann)
Fixes
- Fix win32_spawn leaking dev_null fd in the parent process. (#906, Antonin Décimo)
- Prefer SetHandleInformation to DuplicateHandle in set_close_on_exec for sockets. DuplicateHandle mustn't be used on sockets. (#907, Antonin Décimo)
- Lwt.pick and Lwt.choose select preferentially failed promises as per documentation (#856, #874, Raman Varabets)
- Use the WSA_FLAG_NO_HANDLE_INHERIT on Windows when creating sockets with WSASocket if the cloexec (non-inheritable) parameter is true. Fixes a Windows problem where a child process would inherit a supposedly non-inheritable socket. (#910, Antonin Décimo)
- Fix macOS/arm64 tests which have a 16k page. (#932, Kate Deplaix)
- Fix Lwt_unix.closedir incorrectly checking the return value of closedir(3). (#942, Antonin Décimo)
- Fix custom_operations struct not fully initialized after OCaml 4.08. (Antonin Décimo, #918)
- Fix missing include directive. (#940, Antonin Décimo)
- Fix missing initialisation in Unix stub. (#941, Antonin Décimo)
Deprecations
- Alias Lwt_result.map_err and Lwt_result.bind_lwt_err to Lwt_result.map_error and Lwt_result.bind_lwt_error for consistency with Stdlib. (#927, Antonin Décimo)
Lwt 5.5.0, Lwt_domain 0.1.0, Lwt_ppx 2.0.3, Lwt_ppx_let 5.5.0, Lwt_react 1.1.5
Deprecations
- Lwt_main.yield and Lwt_unix.yield are deprecated in favor of the generic Lwt.pause, and Lwt_unix.auto_yield is deprecated in favor of the new Lwt_unix.auto_pause. Currently, Lwt_main.run resolves paused promises more frequently than yielded promises; the difference is unintended but existing applications could unintentionally depend on it. (#855, #858, Favonia)
Fixes
-
Use is_blocking in dup and dup2 to fix ENOTSOCK on Windows. (#869, Antonin Décimo)
-
Lwt_unix.lstat was incorrectly calling Unix.stat on Win32. Fixes the behavior of Lwt_io.with_temp_dir following symlinks to directories on Win32. (#883, Antonin Décimo)
-
Support deleting symlinks on Windows during cleanup of Lwt_io.with_temp_dir. (#886, Antonin Décimo)
-
Lwt_react.S.l[2-6]_s used polymorphic equality which could cause errors when handling functional values. (#893, Jérôme Vouillon)
-
On Windows, treat ERROR_BROKEN_PIPE on read as zero-read instead of error. See OCaml PR #4790. (#898, Antonin Décimo)
-
Fix compilation under MSVC by replacing Noreturn with CAMLnoreturn. (#880, #887, Nicolás Ojeda Bär)
Additions
-
Lwt_bytes.blit_from_string: string complement of Lwt_bytes.blit. (#882, Hugo Heuzard)
-
Lwt_seq: a Seq-like data-structure with Lwt delayed nodes. (#836, #842, Zach Shipko)
-
Lwt_unix.auto_pause: the replacement of Lwt_unix.auto_yield that uses Lwt.pause instead of Lwt_unix.yield. (#855, #858, Favonia)
-
Lwt_stream.return, Lwt_stream.return_lwt: singleton stream constructors. (#864, Boning Dong)
-
Add ?to_dir param from Unix.symlink to Lwt_unix.symlink wrapper. (#884, Antonin Décimo)
-
Lwt_stream.of_lwt_seq to convert an Lwt-sequence into an Lwt-stream. (#873)
-
Support IPv6 (always) and PF_UNIX (with OCaml >= 4.14) socketpair on Windows. (#870, #876, Antonin Décimo, David Allsopp)
-
In the Lwt_unix module, add
?cloexec:bool
optional arguments to functions that create file descriptors (dup
,dup2
,pipe
,pipe_in
,pipe_out
,socket
,socketpair
,accept
,accept_n
). The?cloexec
argument is simply forwarded to the wrapped Unix function (with OCaml >= 4.05, see PR ocaml/ocaml#650), or emulated as best-effort withUnix.set_close_on_exec
on older OCaml versions. (#327, #847, #872, #901, Antonin Décimo) -
Lwt_domain: helpers for using domainslib from Lwt. (#860, Sudha Parimala)
Misc
-
Code quality improvement: remove an unneeded Obj.magic. (#844, Benoit Montagu)
-
On Windows, use the Unicode API in C stubs and functions introduced in OCaml 4.06 to handle Unicode strings. Raise the minimum requirement to OCaml 4.06 (on Windows only). (#843, #903, Antonin Décimo)
-
More complete coverage in the CI. (#890, #894, #896, Sora Morimoto)
-
Code quality improvement: use exception pattern instead of try-with. (#895, Antonin Décimo)
-
Code quality improvement: fix warnings on 4.13. (#899)
Lwt 5.4.2
Lwt 5.4.1
Bugs fixed
-
Fix
Lwt_fmt.stderr
to actually point to stderr (#852, #850, Volker Diels-Grabsch). -
Make temporary files created by
Lwt_io.with_temp_dir
deletable on Windows by removing the RO bit (#849, #861, Antonin Décimo). -
Handle
ECONNABORTED
inLwt_io.establish_server*
(#829, #830, Reynir Björnsson, Hannes Mehnert).
Lwt 5.4.0, Lwt_ppx 2.0.2, Lwt_react 1.1.4
Installability
-
lwt_ppx
now usesppxlib
. This introduce a transitive dependency to OCaml.4.04 (#807, Philippe Veber).
Bugfixes
-
Catch exceptions in
Lwt_react.of_stream
(#809, Petter A. Urkedal). -
Avoid segfaults in
Lwt_unix.tcsetattr
(#798, Frédéric Fortier).
Additions
-
fork
method inLwt_engine
. This method is a noop in the released engines but it paves the way to a libuv-based engine (#811, Ulrik Strid, Anton Bachin). -
Lwt_main.abandon_yielded_and_paused
for use in conjunction withLwt.fork
(#789, Julien Tesson). -
Lwt.wrap_in_cancelable
to completeprotect
andno_cancel
(#785). -
Support for
IOV_MAX
inLwt_unix.IO_vectors.system_limit
(#801, Pino Toscano). -
Lwt_unix.send_msgto
(#805, Antonio Nuno Monteiro). -
Lwt.dont_wait
, a more explicit alternative toLwt.async
(#820, François Thiré).
Miscellaneous
-
Avoid double-reversing when traversing lists. This may change the order in which some promises are collected, which may change which of several rejection is arbitrarily selected during concurrent traversal (#784).
-
Numerous documentation improvements (including external contributions from Bikal Lem, Sudha Parimala, and Hannes Mehnert).
Lwt 5.3.0
Lwt 5.2.0, Lwt_ppx 2.0.1
- Add
Lwt_unix.pread
,Lwt_unix.pwrite
, andLwt_unix.pwrite_string
(#768, Pierre Chambart). - Internally use
accept4(2)
when available (#769, Pierre Chambart). - PPX: internally use 4.10 ASTs (#765).