From f1dd42de9e851fbcb503bd879d1c37586f3139bd Mon Sep 17 00:00:00 2001 From: Sherzod Mutalov Date: Wed, 25 Jun 2025 23:13:59 +0500 Subject: [PATCH] fix: use system npx on old mac's --- src-tauri/src/core/mcp.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/core/mcp.rs b/src-tauri/src/core/mcp.rs index 4a8644bc9..95382b3a1 100644 --- a/src-tauri/src/core/mcp.rs +++ b/src-tauri/src/core/mcp.rs @@ -513,7 +513,16 @@ async fn schedule_mcp_start_task( let mut cmd = Command::new(command.clone()); - if command == "npx" { + let mut is_macos_without_avx2 = false; + #[cfg(all(target_os="macos", any(target_arch = "x86", target_arch = "x86_64"))) ] + { + is_macos_without_avx2 = !is_x86_feature_detected!("avx2"); + if is_macos_without_avx2 { + log::warn!("Your CPU doesn't support AVX2 instruction"); + } + } + + if command == "npx" && !is_macos_without_avx2 { let mut cache_dir = app_path.clone(); cache_dir.push(".npx"); let bun_x_path = format!("{}/bun", bin_path.display());