Repository navigation
Build async-io on macOS and report why io-uring isn't available - #270
Merged
Merged
Conversation
Kranzes
force-pushed
the
async-io-macos
branch
from
October 19, 2026 16:42
6eb0f37 to
edd7b8a
Compare
Kranzes
marked this pull request as ready for review
October 19, 2026 16:47
Kranzes
requested review from
bergwolf,
eryugey,
imeoer,
jiangliu and
liubogithub
as code owners
October 19, 2026 16:47
Kranzes
force-pushed
the
async-io-macos
branch
from
October 19, 2026 17:19
edd7b8a to
0747cf7
Compare
Kranzes
force-pushed
the
async-io-macos
branch
from
October 28, 2026 15:05
0747cf7 to
3f5caba
Compare
Collaborator
AsyncFileReadWriteVolatile used tokio_uring only for IoBuf::bytes_total(), so call FileVolatileBuf::cap() instead. The vfs async handlers used the Linux-only libc::stat64 and VfsOptions::no_open, so use fuse_abi::stat64 and check no_open on Linux only. The umbrella crate now forwards async-io to the transports with pkg?/feature, so async-io alone no longer pulls in the Linux-only virtiofs transport. Signed-off-by: Ilan Joselevich <personal@ilanjoselevich.com>
async-io failed to build on macOS, because it pulled in io-uring on every platform and io-uring only builds on Linux. The code that uses io_uring was already Linux-only. Make io-uring a Linux-only dependency, like tokio-uring. Other platforms run async-io on tokio. The macfuse example gets the AsyncFileSystem impl that async-io requires, and the Makefile builds and tests async-io on macOS. Signed-off-by: Ilan Joselevich <personal@ilanjoselevich.com>
When the io-uring probe failed, set_runtime_type(RuntimeType::Uring) returned "async runtime type is Tokio, not Uring". The probe only logged its reason, so an application couldn't tell a low RLIMIT_MEMLOCK from a seccomp filter. Keep the probe's error and return it from set_runtime_type(), with its kind. The fallback warning includes it too. The test blocks io_uring_setup() with a seccomp filter, and skips where it can't install one, such as under QEMU. Signed-off-by: Ilan Joselevich <personal@ilanjoselevich.com>
Kranzes
force-pushed
the
async-io-macos
branch
from
October 29, 2026 17:56
3f5caba to
287cbc7
Compare
Contributor
Author
jiangliu
approved these changes
Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
async-ioonly builds on Linux, because it pulls inio-uringon every platform. Most of the async code doesn't need io_uring, and the tokio runtime already serves Linux without it. This buildsasync-ioon macOS, where it runs on tokio.AsyncFileReadWriteVolatileusedtokio_uringonly forIoBuf::bytes_total(), and the Vfs async handlers used the Linux-onlylibc::stat64andVfsOptions::no_open. The umbrella crate forwardsasync-ioto the transports withpkg?/feature, soasync-ioalone no longer pulls in the Linux-only virtiofs transport.io-uringbecomes a Linux-only dependency offuse-backend-core, liketokio-uring. The macfuse example gets theAsyncFileSystemimpl thatasync-iorequires, andmake check-macosbuilds, lints and testsasync-io.set_runtime_type(RuntimeType::Uring)returned "async runtime type is Tokio, not Uring" when the probe failed, and only the log said why. It now returns the probe's error with its kind, so an application can tell a lowRLIMIT_MEMLOCKfrom a seccomp filter. The test blocksio_uring_setup()with a seccomp filter.This changes the umbrella crate's
async-io. It no longer turns on thefusedevandvirtiofstransports, so code that uses items they gate, such asabi::virtio_fs, has to enable them. A crate that depends on a transport crate directly must enable that crate'sasync-iotoo, or its writers fail asynchronous replies withEINVAL.The asynchronous fusedev transport (
FuseDevTask,AsyncFuseServing) stays Linux-only.fuse-backend-fusedev's ownio-uringdependency for thefusedev-uringfeature is unchanged.Tested on Linux 7.2.10 with
make checkand the mount tests in a user namespace. For macOS,cargo check --target aarch64-apple-darwin --testsand clippy pass withfusedev,async-ioandfusedev,fuse-t,async-io, and an earlier version of this branch built on macOS 26 (arm64). I don't have macFUSE set up, so nothing mounted on macOS.