Lwt Versions Save

OCaml promises and concurrent I/O

5.7.0

8 months ago

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 (use Stdlib.result instead). (#968)
  • Remove the deprecated Lwt.make_value and Lwt.make_result functions (use Ok and Error 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 and Lwt_stream.on_terminate (bind to Lwt_stream.closed instead). (#968)
  • Remove the deprecated Lwt_stream.result type (use Stdlib.result instead). (#968)
  • Remove the deprecated Lwt_stream.map_exn function (use wrap_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 in Lwt.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 and Lwt_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 avoid SIGSEGV. (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 to Lwt_unix.yield. (#917, Christopher Zimmermann, Favonia)

5.6.1

1 year ago

Bugs fixed

  • Fix null file descriptor being closed when used as redirection for standard fd of child processes. (#957, Antonin Décimo)

5.6.0

1 year ago

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)

5.5.0

2 years ago

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 with Unix.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)

5.4.2

2 years ago

Bugs fixed

  • Fix compilation on Windows by providing missing dummy stubs (#868, Andreas Hauptmann, Antonin Décimo).

5.4.1

2 years ago

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 in Lwt_io.establish_server* (#829, #830, Reynir Björnsson, Hannes Mehnert).

5.4.0

3 years ago

Installability

  • Support for OCaml 4.12 (#804, #826, Kate Deplaix).

  • lwt_ppx now uses ppxlib. This introduce a transitive dependency to OCaml.4.04 (#807, Philippe Veber).

Bugfixes

Additions

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).

5.3.0

4 years ago
  • Add let* and and* in Lwt.Syntax and Lwt_result.Syntax (#775, Rahul Kumar).
  • Also add let+ and and+ (#776, Craig Ferguson).
  • Add Lwt_result.both (#775, Rahul Kumar).
  • Always use libev if detected (#601).

5.2.0

4 years ago

5.1.2

4 years ago

Bugs fixed

  • Do not run C exit hooks after failed exec (#764, diagnosed Lucian Wischik).
  • discover.ml: don't add flags for missing system libraries (#760, #761, Olaf Hering).
  • discover.ml: don't run the opam binary (#761).
  • Warning on 4.10 in lwt_unix_stubs.c (#766).