Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support kqueue on macOS #4007

Open
danielsn opened this issue Nov 1, 2024 · 2 comments
Open

Support kqueue on macOS #4007

danielsn opened this issue Nov 1, 2024 · 2 comments
Labels
A-mac Area: Affects only macOS targets A-shims Area: This affects the external function shims C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement

Comments

@danielsn
Copy link

danielsn commented Nov 1, 2024

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.

@RalfJung
Copy link
Member

RalfJung commented Nov 1, 2024

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.

@RalfJung RalfJung added C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement A-shims Area: This affects the external function shims A-mac Area: Affects only macOS targets labels Nov 1, 2024
@RalfJung RalfJung changed the title kqueue not supported on OSX Support kqueue on OSX Nov 1, 2024
@RalfJung RalfJung changed the title Support kqueue on OSX Support kqueue on macOS Nov 1, 2024
@saethlin
Copy link
Member

saethlin commented Nov 1, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-mac Area: Affects only macOS targets A-shims Area: This affects the external function shims C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement
Projects
None yet
Development

No branches or pull requests

3 participants