hanzo-kai: the tree copy makes a symlink on Windows too

`copy` reached for std::os::unix::fs::symlink unguarded, so the windows-amd64 build of v0.7.0 failed at
hanzo-kai while the four other targets built. Each platform's symlink call sits under its cfg; the
other two unix-only sites in the Hanzo crates were already gated at the function and module.
This commit is contained in:
2026-10-15 09:04:15 -07:00
parent a8af775a94
commit 0f0f83ce3a
+8 -1
View File
@@ -552,7 +552,14 @@ fn copy(from: &Path, to: &Path) -> std::io::Result<()> {
let dest = to.join(&name);
if kind.is_symlink() {
if let Ok(target) = std::fs::read_link(e.path()) {
let _ = std::os::unix::fs::symlink(target, dest);
#[cfg(unix)]
let _ = std::os::unix::fs::symlink(&target, &dest);
#[cfg(windows)]
let _ = if e.path().is_dir() {
std::os::windows::fs::symlink_dir(&target, &dest)
} else {
std::os::windows::fs::symlink_file(&target, &dest)
};
}
} else if kind.is_dir() {
if !skipped(&name.to_string_lossy()) {