Support kqueue on macOS
I was trying to run Miri on this test, and got the following error message:
--- STDERR: data-pipeline trace_exporter::tests::new_defaults ---
error: unsupported operation: can't call foreign function `kqueue` on OS `macos`
--> /Users/daniel.schwartznarbonne/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-0.8.11/src/sys/unix/selector/kqueue.rs:73:18
|
73 | let kq = syscall!(kqueue())?;
| ^^^^^^^^^^^^^^^^^^ can't call foreign function `kqueue` on OS `macos`
|
= help: if this is a basic API commonly used on this target, please report an issue with Miri
= help: however, note that Miri does not aim to support every FFI function out there; for instance, we will not support APIs for things such as GUIs, scripting languages, or databases
I would argue that kqueue is a sufficiently common API that Miri should consider supporting it.
Thanks for the report! We are currently in the process of implementing epoll support. So kqueue is definitely in scope. (IIUC, this is the macOS equivalent to epoll.)
However, I personally won't spend my time implementing APIs for a proprietary OS, so this will likely have to be driven by outside contributions (or maybe one of my fellow team members).
Meanwhile, you can use --target x86_64-unknown-linux-gnu even on a macOS host (no further tooling required) to execute the better-supported Linux codepaths.
APIs for a proprietary OS
The BSDs also have an API called kqueue, though I don't know if it is exactly the same. The Solarish OSes use yet another mechanism for evented I/O called event ports.
Hi I would like to work on this issue.
@RalfJung how should I approach this issue? What all do I need to implement here to make kqueue working?
I'm afraid I won't be able to provide mentoring for this, sorry.