{"record":{"id":"ac913d8cc7bc2bbb","repo":"nikivdev/code","slug":"symlinks-are-only-supported-on-unix-like-systems","errorCode":null,"errorMessage":"symlinks are only supported on unix-like systems","messagePattern":"symlinks are only supported on unix-like systems","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/home.rs","lineNumber":474,"sourceCode":"\n    Ok(())\n}\n\nfn create_symlink(source: &Path, dest: &Path) -> Result<()> {\n    #[cfg(unix)]\n    {\n        std::os::unix::fs::symlink(source, dest).with_context(|| {\n            format!(\n                \"failed to symlink {} -> {}\",\n                dest.display(),\n                source.display()\n            )\n        })?;\n        return Ok(());\n    }\n    #[cfg(not(unix))]\n    {\n        bail!(\"symlinks are only supported on unix-like systems\");\n    }\n}\n\nfn ensure_kar_repo(flow_bin: &Path, prefer_ssh: bool, repo_url: &str) -> Result<()> {\n    let repo_url = coerce_repo_url(repo_url, prefer_ssh);\n    let repo = parse_repo_input(&repo_url)?;\n    let root = config::expand_path(DEFAULT_REPOS_ROOT);\n    let owner_dir = root.join(&repo.owner);\n    let repo_path = owner_dir.join(&repo.repo);\n\n    ensure_repo(&repo_path, Some(&repo.clone_url), \"kar\", true)?;\n\n    let flow_toml = repo_path.join(\"flow.toml\");\n    if !flow_toml.exists() {\n        println!(\n            \"No flow.toml found in {}; skipping f deploy\",\n            repo_path.display()\n        );","sourceCodeStart":456,"sourceCodeEnd":492,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/home.rs#L456-L492","documentation":"create_symlink is the cross-platform symlink helper; symlink creation is only implemented for unix-like targets. On non-unix builds (cfg(not(unix)), e.g. Windows), the function deliberately fails with this message instead of attempting an unsupported operation. Called from ensure_link_targets when setting up dotfile links.","triggerScenarios":"Running a binary compiled for a non-unix platform and reaching ensure_link_targets -> create_symlink; e.g. using the dotfile sync feature on Windows (including Windows without a unix compatibility layer).","commonSituations":"Running the tool on Windows; using WSL incorrectly by invoking the Windows binary instead of the Linux one; CI runners on Windows executing the sync step.","solutions":["Run the tool on Linux/macOS (or inside WSL using the Linux binary)","Skip the symlink-sync feature on Windows and manage links manually","Use Windows Developer Mode + a fork adding junction/symlink support"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"#[cfg(not(unix))]\nif uses_symlink_sync {\n    eprintln!(\"symlink sync unsupported on this platform; skipping\");\n}","typeGuard":"fn symlinks_supported() -> bool { cfg!(unix) }","tryCatchPattern":"match create_symlink(...) {\n    Ok(()) => {},\n    Err(e) if e.to_string().contains(\"only supported on unix\") => {\n        fallback_copy(&src, &dest)?; // copy instead of link on unsupported platforms\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Run dotfile sync on Linux/macOS or inside WSL with the Linux binary","Gate sync features behind cfg(unix) in cross-platform scripts","Document platform limits in CI matrices (skip Windows sync jobs)"],"tags":["platform","symlink","windows"],"backgroundTag":"unsupported-platform-symlink","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}