libnyanpasu/clash-nyanpasu · error · std::io::Error (Unsupported)
file symlinks are unsupported on this platform
Error message
file symlinks are unsupported on this platform
What it means
`create_file_symlink` in profile_file.rs provides symlink creation for unix and windows, but on any other target (cfg falls through) it returns an `Unsupported` io::Error stating file symlinks are unsupported. This is a compile-time platform gate: the code has no implementation for that platform.
Source
Thrown at backend/tauri/src/service/profile_file.rs:497
#[cfg(not(windows))]
{
name == MATERIALIZATION_ROOT
}
}
fn create_file_symlink(target: &Path, link: &Path) -> std::io::Result<()> {
#[cfg(windows)]
{
std::os::windows::fs::symlink_file(target, link)
}
#[cfg(unix)]
{
std::os::unix::fs::symlink(target, link)
}
#[cfg(not(any(unix, windows)))]
{
let _ = (target, link);
Err(std::io::Error::new(
std::io::ErrorKind::Unsupported,
"file symlinks are unsupported on this platform",
))
}
}
fn hash_tagged(tag: &[u8], content: &[u8]) -> String {
let mut digest = Sha256::new();
digest.update(tag);
digest.update([0]);
digest.update(content);
hex::encode(digest.finalize())
}
fn valid_operation_id(operation_id: &str) -> bool {
operation_id.len() == 16
&& operation_id
.bytes()View on GitHub (pinned to f7dbce2997)
Solutions
- Run only on supported platforms (unix/windows).
- Add a platform-specific implementation or copy-based fallback in create_file_symlink for the new target.
- Refactor callers to use a copy fallback when symlink support is absent.
Example fix
// before
Err(std::io::Error::new(ErrorKind::Unsupported, "file symlinks are unsupported on this platform"))
// after
std::fs::copy(target, link).map_err(|e| std::io::Error::new(e.kind(), format!("symlink unsupported; copy fallback failed: {e}"))) Defensive patterns
Strategy: fallback
Validate before calling
if !(cfg!(unix) || cfg!(windows)) {
// use copy fallback instead of symlink
} Try / catch
match create_file_symlink(target, link) {
Err(e) if e.kind() == std::io::ErrorKind::Unsupported => std::fs::copy(target, link)?,
other => other?,
} Prevention
- Only target unix/windows platforms for the profile-link feature
- Provide a copy fallback for unsupported targets
- Gate symlink-dependent features behind a platform check at startup
When it happens
Trigger: Calling `create_ready_link` (directly or via journal/cleanup or atomic-write paths) on a platform that is neither unix nor windows (e.g. wasm target), reaching the fallback branch of `create_file_symlink`.
Common situations: Cross-compiling the service for an exotic target, running profile-linking logic in a wasm/web environment, or porting the profile service to a new OS without adding a symlink implementation.
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
- runtime candidate directory is a symlink or reparse point: {
- profile directory is a symlink, reparse point, or non-direct
- materialization journal is not a regular file: {}
- private materialization artifact is not a regular file: {}
- staged file is not a regular file
AI-assisted analysis of libnyanpasu/clash-nyanpasu@f7dbce2997 (2026-09-08).
Data as JSON: /api/errors/f4a0a6c235e79a72.
Report an issue: GitHub.