From cfb3f52aec3ed993a84c9c61e3c064291b304207 Mon Sep 17 00:00:00 2001 From: HiroKenEz <59478073+HiroKenEz@users.noreply.github.com> Date: Mon, 26 Oct 2026 10:46:43 +0000 Subject: [PATCH] cli_link: the symlink test runs on Unix only, so the UI tests build on Windows (#6545) (#6546) * claim: #6545 * cli_link: the Unix-only link code and its test build on Unix only, so the UI crate builds on Windows (#6545) slot() is used only by link_in's Unix version, and links_only_where_it_may makes its own link with std::os::unix::fs::symlink; gate both like link_in. On Windows the test failed to compile (E0433) and clippy -D warnings flagged slot as dead code. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- crates/ui-egui/src/cli_link.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/ui-egui/src/cli_link.rs b/crates/ui-egui/src/cli_link.rs index 286d94168..3400bc925 100644 --- a/crates/ui-egui/src/cli_link.rs +++ b/crates/ui-egui/src/cli_link.rs @@ -45,6 +45,7 @@ pub fn plan(slot: &Slot, cli: &Path) -> Plan { /// The folders a link goes in, best first. pub const DIRS: &[&str] = &["/opt/homebrew/bin", "/usr/local/bin"]; +#[cfg(unix)] fn slot(link: &Path) -> Slot { match std::fs::symlink_metadata(link) { Err(_) => Slot::Empty, @@ -155,6 +156,8 @@ mod tests { assert_eq!(plan(&Slot::Other, cli), Plan::Skip); } + // `link_in` only makes links on Unix, and the test makes its own with `std::os::unix`. + #[cfg(unix)] #[test] fn links_only_where_it_may() { let d = std::env::temp_dir().join(format!("solidcraft-cli-link-{}", std::process::id()));