tvix/store: fix virtiofs on MacOS

#312
Opened by flokli at 2023-09-26T10·53+00

When building //tvix:store, we currently disabled the fuse and virtiofs features if running on Darwin (and people need to manually disable these features when running cargo build locally).

Repro (on MacOS):

nix-shell . -A tvix.shell
cd tvix/store
cargo build
[…]
error[E0432]: unresolved import `vmm_sys_util::eventfd`
  --> /Users/flokli/.cargo/registry/src/index.crates.io-6f17d22bba15001f/vhost-0.6.1/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/flokli/.cargo/registry/src/index.crates.io-6f17d22bba15001f/vhost-0.6.1/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 tempfile v3.5.0
error[E0599]: no method named `send_with_fds` found for struct `UnixStream` in the current scope
   --> /Users/flokli/.cargo/registry/src/index.crates.io-6f17d22bba15001f/vhost-0.6.1/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/flokli/.cargo/registry/src/index.crates.io-6f17d22bba15001f/vhost-0.6.1/src/vhost_user/connection.rs:317:45
    |
317 | ....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/flokli/.cargo/registry/src/index.crates.io-6f17d22bba15001f/vhost-0.6.1/src/vhost_user/connection.rs:349:38
    |
349 | ....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` (lib) due to 5 previous errors
warning: build failed, waiting for other jobs to finish...

  1. flokli changed the subject of this issue from "tvix/store: fix fuse / virtiofs feature on Darwin" to "tvix/store: fix fuse / virtiofs feature on MacOS" at 2023-09-26T10·56+00
  2. https://cl.tvl.fyi/c/depot/+/9490 fixes the fuse bits on MacOS.

    flokli at 2023-10-02T14·12+00

  3. MacOS support for virtiofs is blocked on https://github.com/rust-vmm/vhost/issues/110

    cbrewster at 2023-10-04T22·51+00

  4. Maybe we remove virtiofs from default features for now? But the nix builds can enable it by default for linux.

    Kind of annoying if cargo build doesn't work when developing on mac

    cbrewster at 2023-10-04T23·00+00

  5. We did do this, virtiofs is not in the default list of features anymore - and the Nix plumbing adds it when it detects it's building on Linux.

    flokli at 2023-10-16T08·35+00

  6. flokli changed the subject of this issue from "tvix/store: fix fuse / virtiofs feature on MacOS" to "tvix/store: fix virtiofs on MacOS" at 2023-10-16T08·35+00