Hmbown/CodeWhale · error

atomic built-in snapshot publication is unsupported on this…

Error message

atomic built-in snapshot publication is unsupported on this platform

What it means

publish_snapshot publishes built-in plugin snapshots atomically (rename-based) only on macOS, Linux, and Windows. On any other target the cfg'd fallback returns io::ErrorKind::Unsupported with this message, because no atomic publication primitive was implemented there.

Solutions

  1. Run codewhale on a supported platform (macOS, Linux, or Windows).
  2. Implement publish_snapshot for the target platform in plugins/builtin.rs with an atomic rename-equivalent.
  3. As a workaround, disable built-in plugin materialization if the platform build permits it.
Defensive patterns

Strategy: fallback

Validate before calling

if !(cfg!(target_os = "macos") || cfg!(target_os = "linux") || cfg!(target_os = "windows")) {
    eprintln!("built-in plugin snapshots unsupported on this target");
}

Try / catch

match publish_snapshot(&src, &dst) {
    Err(e) if e.kind() == std::io::ErrorKind::Unsupported => eprintln!("skipping plugin snapshot on this platform"),
    other => other?,
}

Prevention

When it happens

Trigger: Running a build of codewhale compiled for a platform other than macOS/Linux/Windows (e.g. wasm, freebsd) and triggering built-in plugin snapshot publication.

Common situations: Cross-compiling or running on an unusual/unofficial target; contributing a port and hitting plugin materialization in tests.

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/ae0b5693b2369623. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/plugins/builtin.rs:403

        .as_os_str()
        .encode_wide()
        .chain(Some(0))
        .collect();
    // SAFETY: both paths are nul-terminated and live through the call. Omitting
    // MOVEFILE_REPLACE_EXISTING preserves every existing destination entry.
    unsafe {
        MoveFileExW(
            PCWSTR(source.as_ptr()),
            PCWSTR(destination.as_ptr()),
            MOVEFILE_WRITE_THROUGH,
        )
    }
    .map_err(|_| io::Error::last_os_error())
}

#[cfg(not(any(target_os = "macos", target_os = "linux", windows)))]
fn publish_snapshot(_source: &Path, _destination: &Path) -> io::Result<()> {
    Err(io::Error::new(
        io::ErrorKind::Unsupported,
        "atomic built-in snapshot publication is unsupported on this platform",
    ))
}

/// Refuse to write through a symbolic link or reparse point, the same rule
/// [`super::discovery`] applies when it scans a plugin root.
fn reject_symlink(path: &Path) -> io::Result<()> {
    match fs::symlink_metadata(path) {
        Ok(metadata) if metadata_is_link_or_reparse(&metadata) => Err(io::Error::new(
            io::ErrorKind::InvalidInput,
            format!(
                "built-in plugin path may not be a symbolic link or reparse point: {}",
                path.display()
            ),
        )),
        Ok(_) => Ok(()),
        Err(error) if error.kind() == io::ErrorKind::NotFound => Ok(()),

View on GitHub (pinned to 73e0f67d83)