{"record":{"id":"ae0b5693b2369623","repo":"Hmbown/CodeWhale","slug":"atomic-built-in-snapshot-publication-is-unsupported-on-this","errorCode":null,"errorMessage":"atomic built-in snapshot publication is unsupported on this platform","messagePattern":"atomic built-in snapshot publication is unsupported on this platform","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/plugins/builtin.rs","lineNumber":403,"sourceCode":"        .as_os_str()\n        .encode_wide()\n        .chain(Some(0))\n        .collect();\n    // SAFETY: both paths are nul-terminated and live through the call. Omitting\n    // MOVEFILE_REPLACE_EXISTING preserves every existing destination entry.\n    unsafe {\n        MoveFileExW(\n            PCWSTR(source.as_ptr()),\n            PCWSTR(destination.as_ptr()),\n            MOVEFILE_WRITE_THROUGH,\n        )\n    }\n    .map_err(|_| io::Error::last_os_error())\n}\n\n#[cfg(not(any(target_os = \"macos\", target_os = \"linux\", windows)))]\nfn publish_snapshot(_source: &Path, _destination: &Path) -> io::Result<()> {\n    Err(io::Error::new(\n        io::ErrorKind::Unsupported,\n        \"atomic built-in snapshot publication is unsupported on this platform\",\n    ))\n}\n\n/// Refuse to write through a symbolic link or reparse point, the same rule\n/// [`super::discovery`] applies when it scans a plugin root.\nfn reject_symlink(path: &Path) -> io::Result<()> {\n    match fs::symlink_metadata(path) {\n        Ok(metadata) if metadata_is_link_or_reparse(&metadata) => Err(io::Error::new(\n            io::ErrorKind::InvalidInput,\n            format!(\n                \"built-in plugin path may not be a symbolic link or reparse point: {}\",\n                path.display()\n            ),\n        )),\n        Ok(_) => Ok(()),\n        Err(error) if error.kind() == io::ErrorKind::NotFound => Ok(()),","sourceCodeStart":385,"sourceCodeEnd":421,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/plugins/builtin.rs#L385-L421","documentation":"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.","triggerScenarios":"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.","commonSituations":"Cross-compiling or running on an unusual/unofficial target; contributing a port and hitting plugin materialization in tests.","solutions":["Run codewhale on a supported platform (macOS, Linux, or Windows).","Implement publish_snapshot for the target platform in plugins/builtin.rs with an atomic rename-equivalent.","As a workaround, disable built-in plugin materialization if the platform build permits it."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"if !(cfg!(target_os = \"macos\") || cfg!(target_os = \"linux\") || cfg!(target_os = \"windows\")) {\n    eprintln!(\"built-in plugin snapshots unsupported on this target\");\n}","typeGuard":null,"tryCatchPattern":"match publish_snapshot(&src, &dst) {\n    Err(e) if e.kind() == std::io::ErrorKind::Unsupported => eprintln!(\"skipping plugin snapshot on this platform\"),\n    other => other?,\n}","preventionTips":["Only expect built-in plugin materialization on macOS, Linux, or Windows.","When porting, implement an atomic rename-equivalent for publish_snapshot.","Feature-gate plugin usage on unofficial targets."],"tags":["plugins","platform","unsupported"],"backgroundTag":"unsupported-platform","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}