about summary refs log tree commit diff
path: root/tvix/store/src/bin/tvix-store.rs
diff options
context:
space:
mode:
authorBrian Olsen <brian@maven-group.org>2023-09-29T16·50+0200
committerBrian Olsen <me@griff.name>2023-10-02T15·46+0000
commitcfb810d81a4f5ba60e8d3c5502390d60799aa636 (patch)
tree0c3ddac2a5ee38151db245475d0159c09b6028cb /tvix/store/src/bin/tvix-store.rs
parent5c2cad0ac48d7f223fe76b27d3d7ea9d38529e25 (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/bin/tvix-store.rs')
-rw-r--r--tvix/store/src/bin/tvix-store.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/tvix/store/src/bin/tvix-store.rs b/tvix/store/src/bin/tvix-store.rs
index aeae270f35..548176e24f 100644
--- a/tvix/store/src/bin/tvix-store.rs
+++ b/tvix/store/src/bin/tvix-store.rs
@@ -139,12 +139,19 @@ enum Commands {
     },
 }
 
-#[cfg(feature = "fuse")]
+#[cfg(all(feature = "fuse", not(target_os = "macos")))]
 fn default_threads() -> usize {
     std::thread::available_parallelism()
         .map(|threads| threads.into())
         .unwrap_or(4)
 }
+// On MacFUSE only a single channel will receive ENODEV when the file system is
+// unmounted and so all the other channels will block forever.
+// See https://github.com/osxfuse/osxfuse/issues/974
+#[cfg(all(feature = "fuse", target_os = "macos"))]
+fn default_threads() -> usize {
+    1
+}
 
 #[tokio::main]
 async fn main() -> Result<(), Box<dyn std::error::Error>> {