fix(tvix/castore/fs): fix build for MacOS

fuse_backend_rs::api::filesystem::Layer is not exposed for non-Linux, and
feature-flagged on virtiofs, so only implement the trait for these cases.

Change-Id: Id8455dc5be502f8375836ba04288d50c59d69d89
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12693
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
This commit is contained in:
Florian Klink 2024-10-27 13:40:09 +01:00 committed by clbot
parent 057e4e3a99
commit e79815dda9

View file

@ -24,7 +24,7 @@ use crate::{
use bstr::ByteVec;
use fuse_backend_rs::abi::fuse_abi::{stat64, OpenOptions};
use fuse_backend_rs::api::filesystem::{
Context, FileSystem, FsOptions, GetxattrReply, Layer, ListxattrReply, ROOT_ID,
Context, FileSystem, FsOptions, GetxattrReply, ListxattrReply, ROOT_ID,
};
use futures::StreamExt;
use parking_lot::RwLock;
@ -300,7 +300,8 @@ const ROOT_NODES_BUFFER_SIZE: usize = 16;
const XATTR_NAME_DIRECTORY_DIGEST: &[u8] = b"user.tvix.castore.directory.digest";
const XATTR_NAME_BLOB_DIGEST: &[u8] = b"user.tvix.castore.blob.digest";
impl<BS, DS, RN> Layer for TvixStoreFs<BS, DS, RN>
#[cfg(all(feature = "virtiofs", target_os = "linux"))]
impl<BS, DS, RN> fuse_backend_rs::api::filesystem::Layer for TvixStoreFs<BS, DS, RN>
where
BS: BlobService + Clone + Send + 'static,
DS: DirectoryService + Send + Clone + 'static,