{"record":{"id":"36fd22a61b4eff61","repo":"astrid-runtime/astrid","slug":"the-fskit-provider-is-available-only-on-macos","errorCode":null,"errorMessage":"the FSKit provider is available only on macOS","messagePattern":"the FSKit provider is available only on macOS","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-storage-provider-fskit/src/main.rs","lineNumber":605,"sourceCode":"#[cfg(target_os = \"macos\")]\nfn native_mount_is_active(mountpoint: &Path) -> Result<bool> {\n    let status = nix::sys::statfs::statfs(mountpoint)\n        .with_context(|| format!(\"inspect native mountpoint {}\", mountpoint.display()))?;\n    Ok(status.filesystem_type_name() == \"astridfs\")\n}\n\n#[cfg(not(target_os = \"macos\"))]\npub(crate) fn native_unmount(mountpoint: &Path) -> std::future::Ready<Result<()>> {\n    let _ = mountpoint;\n    std::future::ready(Err(anyhow::anyhow!(\n        \"the FSKit provider is available only on macOS\"\n    )))\n}\n\n#[cfg(not(target_os = \"macos\"))]\npub(crate) fn native_mount_is_active(mountpoint: &Path) -> Result<bool> {\n    let _ = mountpoint;\n    bail!(\"the FSKit provider is available only on macOS\")\n}\n\nfn resolve_record(selector: &StorageMountSelectorV1) -> Result<MountRecord> {\n    let registry = load_registry()?;\n    match selector {\n        StorageMountSelectorV1::MountId(mount_id) => registry\n            .mounts\n            .values()\n            .find(|record| record.mount_id == *mount_id)\n            .cloned()\n            .with_context(|| format!(\"mount {mount_id} is not registered\")),\n        StorageMountSelectorV1::NativePath(path) => registry\n            .mounts\n            .get(&path_key(path))\n            .cloned()\n            .with_context(|| format!(\"mountpoint is not registered: {}\", path.display())),\n    }\n}","sourceCodeStart":587,"sourceCodeEnd":623,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-storage-provider-fskit/src/main.rs#L587-L623","documentation":"On non-macOS platforms, native_mount_is_active is a stub that always returns this error: the FSKit provider is macOS-only because FSKit is an Apple framework. Any attempt to query mount activity (and, transitively, mount/unmount flows that consult it) on Linux or other platforms fails immediately with this message.","triggerScenarios":"Calling native_mount_is_active (or code paths that depend on it, such as mount-state checks) while compiled for a non-macOS target (cfg(not(target_os = \"macos\"))).","commonSituations":"Running an fskit-provider-based test suite on a Linux CI runner; accidentally selecting the fskit storage provider in a cross-platform app; container builds where target_os is linux.","solutions":["Run the FSKit provider only on macOS (12.0+) hosts","Feature-gate or cfg-gate the caller so fskit paths are skipped on non-macOS targets","Select a platform-appropriate storage provider on Linux/Windows"],"exampleFix":"// before\nassert!(native_mount_is_active(&mp)?); // runs on Linux CI\n// after\n#[cfg(target_os = \"macos\")]\nassert!(native_mount_is_active(&mp)?);","handlingStrategy":"fallback","validationCode":"#[cfg(not(target_os = \"macos\"))]\nfn fskit_supported() -> bool { false }\n#[cfg(target_os = \"macos\")]\nfn fskit_supported() -> bool { true }","typeGuard":null,"tryCatchPattern":"match native_mount_is_active(&mp) {\n    Err(e) if e.to_string().contains(\"only on macOS\") => {\n        // fall back to a non-FSKit provider or skip the test\n    }\n    other => other?,\n}","preventionTips":["cfg-gate fskit usage behind target_os = \"macos\"","Skip fskit integration tests on non-macOS CI runners","Choose platform-appropriate storage providers in cross-platform apps"],"tags":["macos","platform-limitation","fskit","unsupported-platform"],"backgroundTag":"unsupported-platform","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}