astrid-runtime/astrid · error

the FSKit provider is available only on macOS

Error message

the FSKit provider is available only on macOS

What it means

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.

Source

Thrown at crates/astrid-storage-provider-fskit/src/main.rs:605

#[cfg(target_os = "macos")]
fn native_mount_is_active(mountpoint: &Path) -> Result<bool> {
    let status = nix::sys::statfs::statfs(mountpoint)
        .with_context(|| format!("inspect native mountpoint {}", mountpoint.display()))?;
    Ok(status.filesystem_type_name() == "astridfs")
}

#[cfg(not(target_os = "macos"))]
pub(crate) fn native_unmount(mountpoint: &Path) -> std::future::Ready<Result<()>> {
    let _ = mountpoint;
    std::future::ready(Err(anyhow::anyhow!(
        "the FSKit provider is available only on macOS"
    )))
}

#[cfg(not(target_os = "macos"))]
pub(crate) fn native_mount_is_active(mountpoint: &Path) -> Result<bool> {
    let _ = mountpoint;
    bail!("the FSKit provider is available only on macOS")
}

fn resolve_record(selector: &StorageMountSelectorV1) -> Result<MountRecord> {
    let registry = load_registry()?;
    match selector {
        StorageMountSelectorV1::MountId(mount_id) => registry
            .mounts
            .values()
            .find(|record| record.mount_id == *mount_id)
            .cloned()
            .with_context(|| format!("mount {mount_id} is not registered")),
        StorageMountSelectorV1::NativePath(path) => registry
            .mounts
            .get(&path_key(path))
            .cloned()
            .with_context(|| format!("mountpoint is not registered: {}", path.display())),
    }
}

View on GitHub (pinned to affd8760f4)

Solutions

  1. Run the FSKit provider only on macOS (12.0+) hosts
  2. Feature-gate or cfg-gate the caller so fskit paths are skipped on non-macOS targets
  3. Select a platform-appropriate storage provider on Linux/Windows

Example fix

// before
assert!(native_mount_is_active(&mp)?); // runs on Linux CI
// after
#[cfg(target_os = "macos")]
assert!(native_mount_is_active(&mp)?);
Defensive patterns

Strategy: fallback

Validate before calling

#[cfg(not(target_os = "macos"))]
fn fskit_supported() -> bool { false }
#[cfg(target_os = "macos")]
fn fskit_supported() -> bool { true }

Try / catch

match native_mount_is_active(&mp) {
    Err(e) if e.to_string().contains("only on macOS") => {
        // fall back to a non-FSKit provider or skip the test
    }
    other => other?,
}

Prevention

When it happens

Trigger: 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"))).

Common situations: 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.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09). Data as JSON: /api/errors/36fd22a61b4eff61. Report an issue: GitHub.