[new release] eio_main, eio_luv, eio_linux and eio (0.7) #22619
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Effect-based direct-style IO mainloop for OCaml
CHANGES:
API changes:
Unify IO errors as
Eio.Io
(@talex5 Unify IO errors as Eio.Io ocaml-multicore/eio#378).This makes it easy to catch and log all IO errors if desired.
The exception payload gives the type and can be used for matching specific errors.
It also allows attaching extra information to exceptions, and various functions were updated to do this.
Add
Time.Mono
for monotonic clocks (@bikallem @talex5 Add Time.Mono for monotonic clocks ocaml-multicore/eio#338).Using the system clock for timeouts, etc can fail if the system time is changed during the wait.
Allow datagram sockets to be created without a source address (@bikallem @haesbaert Allow datagram_socket to be created without address ocaml-multicore/eio#360).
The kernel will allocate an address in this case.
You can also now control the
reuse_addr
andreuse_port
options.Add
File.stat
and improvePath.load
(@haesbaert @talex5 Expose File.stat and improve Path.load ocaml-multicore/eio#339).Path.load
now uses the file size as the initial buffer size.Add
Eio_unix.pipe
(@patricoferris Add pipe to eio_unix ocaml-multicore/eio#350).This replaces
Eio_linux.pipe
.Avoid short reads from
getrandom(2)
(@haesbaert Fix getrandom(2) ocaml-multicore/eio#344).Guards against buggy user code that might not handle this correctly.
Rename
Flow.read
toFlow.single_read
(@talex5 RenameFlow.read
toFlow.single_read
ocaml-multicore/eio#353).This is a low-level function and it is easy to use it incorrectly by ignoring the possibility of short reads.
Bug fixes:
Eio_luv: Fix non-tail-recursive continue (@talex5 Unify IO errors as Eio.Io ocaml-multicore/eio#378).
Affects the
Socket_of_fd
andSocketpair
effects.Eio_linux: UDP sockets were not created close-on-exec (@talex5 Allow datagram_socket to be created without address ocaml-multicore/eio#360).
Eio_linux: work around io_uring non-blocking bug (@haesbaert Fix pipe hang (issue #319) ocaml-multicore/eio#327 Add Eio_unix.pipe workaround, zap Eio_linux.pipe ocaml-multicore/eio#355).
The proper fix should be in Linux 6.1.
Eio_mock.Backend
: preserve backtraces frommain
(@talex5 Eio_mock.Backend: preserve backtraces from main ocaml-multicore/eio#349).Don't lose backtrace in
Switch.run_internal
(@talex5 Don't lose backtrace in Switch.run_internal ocaml-multicore/eio#369).Documentation:
Use a proper HTTP response in the README example (@talex5 Use a proper HTTP response in the README example ocaml-multicore/eio#377).
Document that read_dir excludes "." and ".." (@talex5 Document that read_dir excludes '.' and '..' ocaml-multicore/eio#379).
Warn about both operations succeeding in
Fiber.first
(@talex5 Warn about both operations succeeding in Fiber.first ocaml-multicore/eio#358, reported by @iitalics).Update README for OCaml 5.0.0~beta2 (@talex5 Update README for OCaml 5.0.0~beta2 ocaml-multicore/eio#375).
Backend-specific changes:
Eio_luv: add low-level process support (@patricoferris eio_luv: add low-level process support ocaml-multicore/eio#359).
A future release will add Eio_linux support and a cross-platform API for this.
Expose
Eio_luv.Low_level.Stream.write
(@patricoferris eio_luv: add low-level process support ocaml-multicore/eio#359).Expose
Eio_luv.Low_level.get_loop
(@talex5 Expose Eio_luv.Low_level.get_loop ocaml-multicore/eio#371).This is needed if you want to create resources directly and then use them with Eio_luv.
Eio_linux.Low_level.openfile
is gone (@talex5 Unify IO errors as Eio.Io ocaml-multicore/eio#378).It was just left-over test code.