From 6b41fb681440d85daa15416550436e258a408d73 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 28 Nov 2026 18:55:41 +0700 Subject: [PATCH] craft-xtask: compare canonical paths in the working-directory test On macOS the temp directory is under /var, a link to /private/var, so current_dir() reads back the /private/var path and the assert failed on main's macOS gate. --- crates/xtask/src/names.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/xtask/src/names.rs b/crates/xtask/src/names.rs index c20337f604..e75ece461e 100644 --- a/crates/xtask/src/names.rs +++ b/crates/xtask/src/names.rs @@ -2857,7 +2857,9 @@ fn seven() { let _ = "seven"; } let policy = Policy { skip: change_directory, ..POLICY }; let found = scan(Path::new("."), &[Input::rust(Path::new("src"))], &policy).unwrap(); assert_eq!(hits(&found), [("src/a.rs".to_owned(), 1, "AzureKit")]); - assert_eq!(std::env::current_dir().unwrap(), PathBuf::from(root).join("switched")); + // Canonical on both sides: macOS temp paths run through the /var -> /private/var link. + let canonical = |p: PathBuf| p.canonicalize().unwrap(); + assert_eq!(canonical(std::env::current_dir().unwrap()), canonical(PathBuf::from(root).join("switched"))); return; } let dir = tempfile::tempdir().unwrap();