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 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
HiroKenEz
2026-10-26 10:46:43 +00:00
committed by GitHub
parent 7c31631ea6
commit cfb3f52aec
+3
View File
@@ -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()));