Hmbown/CodeWhale · error · io::Error

Confined Fleet artifact I/O is unavailable on this platform

Error message

Confined Fleet artifact I/O is unavailable on this platform

What it means

This error means confined Fleet artifact I/O is only implemented for Unix and Windows; on other targets the WorkspaceFile stub always fails. The library throws it from WorkspaceFile::open on cfg(all(not(unix), not(windows))) builds.

Solutions

  1. Run on a supported platform (Linux/macOS or Windows)
  2. Implement WorkspaceFile for the target platform if you own the build
  3. Avoid Fleet artifact features on unsupported targets
Defensive patterns

Strategy: fallback

Validate before calling

// compile-time guard
#[cfg(all(not(unix), not(windows)))]
compile_error!("Fleet artifact I/O requires unix or windows");

Try / catch

match WorkspaceFile::open(dir, name, write) {
    Ok(f) => use_file(f),
    Err(e) if e.kind() == std::io::ErrorKind::Unsupported => {
        eprintln!("Fleet artifact I/O unsupported on this target");
    }
    Err(e) => return Err(e.into()),
}

Prevention

When it happens

Trigger: Calling WorkspaceFile::open on a platform that is neither unix nor windows (e.g. wasm, embedded, exotic OS targets).

Common situations: Cross-compiling the TUI crate for an unsupported target; running Codewhale inside a wasm host.

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 Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/351c11531c4d6321. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/fleet/files.rs:506

    #[test]
    fn artifact_paths_cannot_name_windows_alternate_data_streams() {
        for path in ["receipt.json:private", "dir/receipt:private", ":stream"] {
            assert!(
                !path_is_confined(Path::new(path)),
                "accepted stream path {path}"
            );
        }
    }
}

#[cfg(all(not(unix), not(windows)))]
#[derive(Debug)]
pub(crate) struct WorkspaceFile;
#[cfg(all(not(unix), not(windows)))]
impl WorkspaceFile {
    pub(crate) fn open(_: &Path, _: &Path, _: bool) -> io::Result<Self> {
        Err(io::Error::new(
            io::ErrorKind::Unsupported,
            "Confined Fleet artifact I/O is unavailable on this platform",
        ))
    }
    pub(crate) fn sibling(&self, _: &str) -> io::Result<Self> {
        unreachable!()
    }
    pub(crate) fn open_update(&self, _: bool, _: bool) -> io::Result<File> {
        unreachable!()
    }
    pub(crate) fn replace(&self, _: &[u8]) -> io::Result<()> {
        unreachable!()
    }
    pub(crate) fn open_file(&self) -> io::Result<File> {
        unreachable!()
    }
    pub(crate) fn publish(&self, _: &[u8]) -> io::Result<()> {
        unreachable!()

View on GitHub (pinned to 73e0f67d83)