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

Mac build support #110

Open
matejsp opened this issue Mar 18, 2022 · 5 comments
Open

Mac build support #110

matejsp opened this issue Mar 18, 2022 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@matejsp
Copy link

matejsp commented Mar 18, 2022

Unable to build on mac Monterey 12.2.1. Any chance to get around this?

➜  virtiofsd git:(main) cargo build --release
   Compiling vhost v0.3.0
   Compiling futures-executor v0.3.19
   Compiling structopt v0.3.26
error[E0432]: unresolved import `vmm_sys_util::eventfd`
  --> /Users/myuser/.cargo/registry/src/github.com-1ecc6299db9ec823/vhost-0.3.0/src/backend.rs:16:19
   |
16 | use vmm_sys_util::eventfd::EventFd;
   |                   ^^^^^^^ could not find `eventfd` in `vmm_sys_util`

error[E0432]: unresolved import `vmm_sys_util::sock_ctrl_msg`
  --> /Users/myuser/.cargo/registry/src/github.com-1ecc6299db9ec823/vhost-0.3.0/src/vhost_user/connection.rs:18:19
   |
18 | use vmm_sys_util::sock_ctrl_msg::ScmSocket;
   |                   ^^^^^^^^^^^^^ could not find `sock_ctrl_msg` in `vmm_sys_util`

   Compiling futures v0.3.19
error[E0599]: no method named `send_with_fds` found for struct `UnixStream` in the current scope
   --> /Users/myuser/.cargo/registry/src/github.com-1ecc6299db9ec823/vhost-0.3.0/src/vhost_user/connection.rs:142:19
    |
142 |         self.sock.send_with_fds(iovs, rfds).map_err(Into::into)
    |                   ^^^^^^^^^^^^^ method not found in `UnixStream`

error[E0599]: no method named `recv_with_fds` found for struct `UnixStream` in the current scope
   --> /Users/myuser/.cargo/registry/src/github.com-1ecc6299db9ec823/vhost-0.3.0/src/vhost_user/connection.rs:317:45
    |
317 |         let (bytes, _) = unsafe { self.sock.recv_with_fds(&mut iovs, &mut [])? };
    |                                             ^^^^^^^^^^^^^ method not found in `UnixStream`

error[E0599]: no method named `recv_with_fds` found for struct `UnixStream` in the current scope
   --> /Users/myuser/.cargo/registry/src/github.com-1ecc6299db9ec823/vhost-0.3.0/src/vhost_user/connection.rs:349:38
    |
349 |         let (bytes, fds) = self.sock.recv_with_fds(iovs, &mut fd_array)?;
    |                                      ^^^^^^^^^^^^^ method not found in `UnixStream`

Some errors have detailed explanations: E0432, E0599.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `vhost` due to 5 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed
@jiangliu
Copy link
Member

We need to find macos counterparts for send fd with UDS and eventfd:)

@slp
Copy link
Collaborator

slp commented Mar 18, 2022

Funny, right now I'm working on implementing macOS support on vmm-sys-util (which will enable vhost and vhost-user-backend to work on it too). Sending ancillary data (i.e. for sending fds) is supported on macOS, so it's just a matter of including the traits. As for eventfd and epoll, I'm emulating the first with pipefd and the second with kqueue. They aren't semantically identical, but they're close enough to allow daemons consuming vhost-user-backend to work properly.

@jiangliu
Copy link
Member

The vmm_sys_util::sock_ctrl_msg related issues are solved by enhancing the vmm_sys_util, but the EventFd is problematic.

@jiangliu
Copy link
Member

Funny, right now I'm working on implementing macOS support on vmm-sys-util (which will enable vhost and vhost-user-backend to work on it too). Sending ancillary data (i.e. for sending fds) is supported on macOS, so it's just a matter of including the traits. As for eventfd and epoll, I'm emulating the first with pipefd and the second with kqueue. They aren't semantically identical, but they're close enough to allow daemons consuming vhost-user-backend to work properly.

I have done a quick poc for sock_ctrl_msg:)

@stefano-garzarella
Copy link
Member

@slp @jiangliu any plan on working on this?

If you have some PoC to share, maybe this could become a good first issue for some Mac user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants