tinyhumansai/openhuman · error · io::Error

Landlock is only supported on Linux with the sandbox-landloc

Error message

Landlock is only supported on Linux with the sandbox-landlock feature

What it means

Stub-implementation error: this LandlockSandbox::new() only compiles when NOT (Linux AND feature sandbox-landlock), so reaching it means the binary was built without the sandbox-landlock Cargo feature or for a non-Linux target. It is a build-configuration fact, not a runtime environment failure — the backend simply does not exist in this binary.

Source

Thrown at src/openhuman/security/landlock.rs:160

    }

    fn name(&self) -> &str {
        "landlock"
    }

    fn description(&self) -> &str {
        "Linux kernel LSM sandboxing (filesystem access control)"
    }
}

// Stub implementations for non-Linux or when feature is disabled
#[cfg(not(all(feature = "sandbox-landlock", target_os = "linux")))]
pub struct LandlockSandbox;

#[cfg(not(all(feature = "sandbox-landlock", target_os = "linux")))]
impl LandlockSandbox {
    pub fn new() -> std::io::Result<Self> {
        Err(std::io::Error::new(
            std::io::ErrorKind::Unsupported,
            "Landlock is only supported on Linux with the sandbox-landlock feature",
        ))
    }

    pub fn with_workspace(_workspace_dir: Option<std::path::PathBuf>) -> std::io::Result<Self> {
        Err(std::io::Error::new(
            std::io::ErrorKind::Unsupported,
            "Landlock is only supported on Linux",
        ))
    }

    pub fn probe() -> std::io::Result<Self> {
        Err(std::io::Error::new(
            std::io::ErrorKind::Unsupported,
            "Landlock is only supported on Linux",
        ))
    }

View on GitHub (pinned to 7491200858)

Solutions

  1. Rebuild with --features sandbox-landlock on a Linux target
  2. Use the platform-appropriate backend (Seatbelt on macOS, AppContainer on Windows)
  3. Check backend availability at runtime and skip landlock selection on unsupported builds
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at src/openhuman/security/landlock.rs:160 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/02bc663ee25f40f9. Report an issue: GitHub.