commits
Fix docs for without_binding
Eio.Process: match Unix search behaviour
Don't search `$PATH` if the name contains a `/`.
https://pubs.opengroup.org/onlinepubs/9799919799/ says:
> If the file argument contains a <slash> character, the file argument
> shall be used as the pathname for this file. Otherwise, the path
> prefix for this file is obtained by a search of the directories passed
> as the environment variable PATH
Add setuid and setgid fork action
Add process groups to unix backends
Co-authored-by: Thomas Leonard <talex5@gmail.com>
Prioritize returning Fiber.any value over cancelling quickly
Originally, `Fiber.any` didn't have a `combine` argument, so it was
always expected that it was OK to throw away either result, and aborting
early made sense. But with `combine` that's no longer true.
Remove unused unix_cstruct.ml file
Skip test_alloc_fixed_or_wait if no fixed buffers are available
Prevents spurious CI failures.
Largely these problems were found by running `odoc_driver`.
The changes to the opam files are to let docs-ci know that other
packages need to be available to build the docs correctly. Dune
will soon be able to insert these itself, but not yet.
Use O_RESOLVE_BENEATH on FreeBSD
It needs `-D__BSD_VISIBLE` to be able to see this.
Fix the CI bug this revealed, which is now also affecting macos
(reported by Nathan Taylor in #808).
posix: spawn_unix: ensure spawn_unix wraps its call to `openat`
Addresses the first issue described in #808 .
On Windows, fix stdin broken-pipe and blocking domain. Issues #793 and #792.
* fix blocking issue on Windows : issue #793.
Adding await_readable before reading fd
* fix broken pipe exception : issue #792.
Use Unix.read_bigarray instead of Unix_cstruct.read
* replace eio_windows_cstruct_stubs.c by Unix functions.
Since OCaml 5.2, Unix.read_bigarray and Unix.write_bigarray can be used.
- Remove reference to Meio until it's actually working with stable
versions of Eio.
- Remove the "Please try porting your programs" request now that Eio is
stable.
- Use a simpler and more typical example for the switches section.
- In the `Executor_pool` make the second example create the pool the
same way as the first one (and shrink it a bit).
- Replace out-of-date retro-httpaf-bench example with cohttp-eio and
capnp-rpc examples.
- In `Net.run_server`, suggest using `Executor_pool`.
It was always unnecessary, but with dune 3.17.0 it's causing the
benchmarks to fail to install. The error is:
Error: There is no dune-project file in the current directory, please add one
with a (name <name>) field in it.
Hint: 'dune subst' must be executed from the root of the project
Ignore ECONNRESET on close
FreeBSD returns ECONNRESET in certain (unclear) circumstances, but it
does still close the FD successfully. If you care about this case, you
should probably use `shutdown` instead and check for it there.
Python and Ruby at least both explicitly check for and ignore this error
too.
eio_windows: group ECONNABORTED with other connection reset errors
Windows returns this if the other end disconnects (seen while testing
with both ends on the same machine).
- Add test dependency on bash.
- Allow www instead of http as the service name for port 80.
eio_windows: work around problems in Unix.getaddrinfo
OCaml's `Unix.getaddrinfo` on Windows doesn't set `ai_protocol` to
anything useful, so you can't tell which addresses are TCP and which are
UDP. So, do two separate queries.
Preserve backtraces in fork_daemon and fork_promise_exn
If the fiber fails, record the backtrace when failing the switch. `fork`
itself already did this, but `fork_daemon` and `fork_promise_exn`
didn't.
Symlinking is privileged operation on Windows, so we check if the running user can make symlinks before running tests that require them.
Make fork_action.h a public_header
Add advice about using AI for code generation
eio_windows: unregister FDs on cancel
This was fixed in cc19aa160626f5b for `eio_posix`, but not for
`eio_windows`.
The error looks like:
exception Unix.Unix_error(Unix.ENOTSOCK, "select", "")
It doesn't need to be in eio.core, as nothing else there depends on it.
eio_linux: avoid triggering a TSan warning
TSan warns that setting `statx_works` races with users of it. This isn't
really a problem, because we always set it to the same value, but it's
distracting when looking for other bugs.
Reported by Anil Madhavapeddy in #751.
eio_linux: allow alloc_fixed_or_wait to be cancelled
eio_linux: refactor fixed buffer code
Instead of having separate Alloc, Alloc_or_wait and Free effects,
the scheduler now provides a single Get effect to return itself,
and the actual work is now done in the calling fiber. This is cleaner,
and seems to be slightly faster too.
Note that `alloc_fixed_or_wait` is currently not cancellable (it wasn't
before either, but it's more obvious now).
It would be possible to use DLS to store the scheduler rather than using
an effect. However, the improvement in speed is minimal and there are
some complications with sys-threads, so probably better to wait for
OCaml to support thread-local-storage first.
Record trace event when spawning processes
examples/fs: show how to read files while scanning
Fix docs for without_binding
Don't search `$PATH` if the name contains a `/`.
https://pubs.opengroup.org/onlinepubs/9799919799/ says:
> If the file argument contains a <slash> character, the file argument
> shall be used as the pathname for this file. Otherwise, the path
> prefix for this file is obtained by a search of the directories passed
> as the environment variable PATH
* fix blocking issue on Windows : issue #793.
Adding await_readable before reading fd
* fix broken pipe exception : issue #792.
Use Unix.read_bigarray instead of Unix_cstruct.read
* replace eio_windows_cstruct_stubs.c by Unix functions.
Since OCaml 5.2, Unix.read_bigarray and Unix.write_bigarray can be used.
- Remove reference to Meio until it's actually working with stable
versions of Eio.
- Remove the "Please try porting your programs" request now that Eio is
stable.
- Use a simpler and more typical example for the switches section.
- In the `Executor_pool` make the second example create the pool the
same way as the first one (and shrink it a bit).
- Replace out-of-date retro-httpaf-bench example with cohttp-eio and
capnp-rpc examples.
- In `Net.run_server`, suggest using `Executor_pool`.
Instead of having separate Alloc, Alloc_or_wait and Free effects,
the scheduler now provides a single Get effect to return itself,
and the actual work is now done in the calling fiber. This is cleaner,
and seems to be slightly faster too.
Note that `alloc_fixed_or_wait` is currently not cancellable (it wasn't
before either, but it's more obvious now).
It would be possible to use DLS to store the scheduler rather than using
an effect. However, the improvement in speed is minimal and there are
some complications with sys-threads, so probably better to wait for
OCaml to support thread-local-storage first.