From 84b148dd449e8b15d13468b6162aa6e718707cc1 Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Thu, 13 Aug 2026 11:20:40 +0900 Subject: [PATCH 1/2] test: require standard Intel Homebrew executable target --- .../brew_cleanup_intel_install_contract.rs | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src-tauri/tests/brew_cleanup_intel_install_contract.rs diff --git a/src-tauri/tests/brew_cleanup_intel_install_contract.rs b/src-tauri/tests/brew_cleanup_intel_install_contract.rs new file mode 100644 index 000000000..c9125388f --- /dev/null +++ b/src-tauri/tests/brew_cleanup_intel_install_contract.rs @@ -0,0 +1,26 @@ +use std::path::PathBuf; + +fn brew_cleanup_source() -> String { + std::fs::read_to_string(PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("src/brew_cleanup.rs")) + .expect("brew cleanup production source must be readable") +} + +#[test] +fn standard_intel_homebrew_repository_target_is_admitted_without_following_alias_symlinks() { + let source = brew_cleanup_source(); + let (_, macos_implementation) = source + .split_once("#[cfg(target_os = \"macos\")]\nfn fixed_brew_path()") + .expect("macOS fixed Homebrew executable admission must remain present"); + let (fixed_brew_path, _) = macos_implementation + .split_once("#[cfg(not(target_os = \"macos\"))]") + .expect("non-macOS fail-closed boundary must remain present"); + + assert!( + fixed_brew_path.contains("Path::new(\"/usr/local/Homebrew/bin/brew\")"), + "fixed candidates must include the standard Intel Homebrew repository target" + ); + assert!( + fixed_brew_path.contains("!metadata.file_type().is_symlink()"), + "Intel compatibility must not weaken symbolic-link rejection" + ); +} From 4bda9d27e6d0c9cefcfcf44f61bf9b985864631d Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Thu, 13 Aug 2026 11:32:10 +0900 Subject: [PATCH 2/2] fix: admit standard Intel Homebrew executable target --- src-tauri/src/brew_cleanup.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src-tauri/src/brew_cleanup.rs b/src-tauri/src/brew_cleanup.rs index 1f67b6220..2f6028767 100644 --- a/src-tauri/src/brew_cleanup.rs +++ b/src-tauri/src/brew_cleanup.rs @@ -109,6 +109,7 @@ fn fixed_brew_path() -> Result { for path in [ Path::new("/opt/homebrew/bin/brew"), + Path::new("/usr/local/Homebrew/bin/brew"), Path::new("/usr/local/bin/brew"), ] { let metadata = std::fs::symlink_metadata(path).ok();