diff options
author | Brian Olsen <brian@maven-group.org> | 2023-09-29T16·50+0200 |
---|---|---|
committer | Brian Olsen <me@griff.name> | 2023-10-02T15·46+0000 |
commit | cfb810d81a4f5ba60e8d3c5502390d60799aa636 (patch) | |
tree | 0c3ddac2a5ee38151db245475d0159c09b6028cb /tvix/store/src/fs/fuse.rs | |
parent | 5c2cad0ac48d7f223fe76b27d3d7ea9d38529e25 (diff) |
fix(tvix/store): Fix FUSE support on MacOS r/6687
This partially fixes b/312 and gets FUSE to work again on MacOS. It is mostly small type changes and an update to fuse-backend-rs because upstream currently doesn't work with MacFuse. It also sets the default FUSE thread count on MacOS to 1 because otherwise the mount command will hang when shutting down as only one thread gets ENODEV and all the others just keep blocking. Change-Id: Ifb3c4268caf296c487049c1dc4618acb32497f44 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9490 Tested-by: BuildkiteCI Reviewed-by: Connor Brewster <cbrewster@hey.com> Reviewed-by: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix/store/src/fs/fuse.rs')
-rw-r--r-- | tvix/store/src/fs/fuse.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tvix/store/src/fs/fuse.rs b/tvix/store/src/fs/fuse.rs index 8535c7858450..d2a734882196 100644 --- a/tvix/store/src/fs/fuse.rs +++ b/tvix/store/src/fs/fuse.rs @@ -11,6 +11,11 @@ where channel: fuse_backend_rs::transport::FuseChannel, } +#[cfg(target_os = "macos")] +const BADFD: libc::c_int = libc::EBADF; +#[cfg(target_os = "linux")] +const BADFD: libc::c_int = libc::EBADFD; + impl<FS> FuseServer<FS> where FS: FileSystem + Sync + Send, @@ -29,7 +34,7 @@ where match e { // This indicates the session has been shut down. fuse_backend_rs::Error::EncodeMessage(e) - if e.raw_os_error() == Some(libc::EBADFD) => + if e.raw_os_error() == Some(BADFD) => { break; } @@ -63,6 +68,7 @@ impl FuseDaemon { let mut session = FuseSession::new(mountpoint.as_ref(), "tvix-store", "", true) .map_err(|e| io::Error::new(io::ErrorKind::Other, e.to_string()))?; + #[cfg(target_os = "linux")] session.set_allow_other(false); session .mount() |