Rename IO backends to support Linux platforms without io_uring #628
+43
−42
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.
As was suggested in #502 I have renamed the IO backends from
darwin
tounix
and fromlinux
toio_uring
. Theunix
backend is now available to Linux platforms without io_uring.A few things to confirm
cfg()
blocks fortarget_os = "macos"
now usetarget_family = "unix"
. If this is not wanted, it can be changed totarget_os = "macos"
andtarget_os = "linux"
with anany()
io_uring
but that is a choice that may not be liked.io_uring
feature is on by default, which right now cannot be changed if building the root project. However, this matches the previous behavior of usingio_uring
on Linux. What is the path to let platforms without support disable the feature? Should a root level feature be defined?make
successfully. However, I am on Linux and don't have access to a Mac, so someone would need to try that this doesn't break anything, although the changes are pretty simple. Oops, forgot about CI, that should take care of it.On the topic of letting platforms disable io_uring support, the primary example is Google, which posted this blog in 2023 about disabling io_uring by default in most of their servers/platforms, including Android (prime candidate user for a SQLite rewrite).
Another way to implement compatibility for platforms with io_uring disabled, without using the feature flag, would be to make a Linux PlatformIO wrapper that implements
IO
and tries to build a UringIO. If that fails, it builds a UnixIO and returns that as theArch<dyn IO>
. This, however, would require changingto
and then
Let me know what you think