From 1fc16df4aa08c25a671b69db408968b128ca8486 Mon Sep 17 00:00:00 2001 From: Evgenii Novozhilov Date: Mon, 10 Jul 2023 21:10:27 +0300 Subject: [PATCH] Use correct filter for IntelliJ SDK architecture selector IntelliJ SDK uses amd64 unlike x86_64 os.arch JVM property on macOS. This fixes #5058 which makes impossible running intellij with bazel plugin on intel mac. --- .../blaze/plugin/run/IntellijWithPluginClasspathHelper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin_dev/src/com/google/idea/blaze/plugin/run/IntellijWithPluginClasspathHelper.java b/plugin_dev/src/com/google/idea/blaze/plugin/run/IntellijWithPluginClasspathHelper.java index 9afec9d4c64..5f893b8eefb 100644 --- a/plugin_dev/src/com/google/idea/blaze/plugin/run/IntellijWithPluginClasspathHelper.java +++ b/plugin_dev/src/com/google/idea/blaze/plugin/run/IntellijWithPluginClasspathHelper.java @@ -26,6 +26,7 @@ import com.intellij.openapi.util.BuildNumber; import com.intellij.openapi.util.SystemInfo; import com.intellij.util.PathsList; +import com.intellij.util.system.CpuArch; import java.io.File; import java.io.IOException; @@ -114,7 +115,6 @@ static Launch readLaunchInfo(Sdk ideaJdk) { } Path info = location.resolve("product-info.json"); String os = resolveOsName(); - String arch = System.getProperty("os.arch"); if (Files.exists(info)) { try { @@ -130,7 +130,7 @@ static Launch readLaunchInfo(Sdk ideaJdk) { } return productInfo.launch.stream() - .filter(l -> Objects.equals(l.os, os) && Objects.equals(l.arch, arch)) + .filter(l -> Objects.equals(l.os, os) && Objects.equals(CpuArch.fromString(l.arch), CpuArch.CURRENT)) .findFirst() .orElse(null); } catch (IOException e) {