From 4540fd0fc70a3d85e55ca17df54fc86b343e5cde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Str=C3=B6mberg?= Date: Fri, 24 Jun 2022 17:26:54 +0200 Subject: [PATCH] Use arm64 lsp on macoa (#1783) Fixes #1780 --- CHANGELOG.md | 1 + src/lsp/download.ts | 6 +++++- src/lsp/utilities.ts | 4 +--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ef591d13..df13f8b5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Changes to Calva. - Fix: [Error reporting for load file differs from evaluate code](https://github.com/BetterThanTomorrow/calva/issues/1774) - Fix: [Accepting and rejecting Github Copilot suggestions does not work](https://github.com/BetterThanTomorrow/calva/issues/1781) +- [Use Apple Silicon clojure-lsp builds on M1 and M2 macs when available](https://github.com/BetterThanTomorrow/calva/issues/1780) ## [2.0.286] - 2022-06-13 diff --git a/src/lsp/download.ts b/src/lsp/download.ts index 664a22097..59d4172b6 100644 --- a/src/lsp/download.ts +++ b/src/lsp/download.ts @@ -73,7 +73,11 @@ async function unzipFile(zipFilePath: string, extensionPath: string): Promise { - const artifactName = lspUtil.getArtifactDownloadName(); + // There were no Apple Silicon builds prior to version 2022.06.22-14.09.50 + const artifactName = + version >= '2022.06.22-14.09.50' || process.platform !== 'darwin' + ? lspUtil.getArtifactDownloadName() + : lspUtil.getArtifactDownloadName('darwin', 'x64'); const url = version !== 'nightly' ? `https://github.com/clojure-lsp/clojure-lsp/releases/download/${version}/${artifactName}` diff --git a/src/lsp/utilities.ts b/src/lsp/utilities.ts index 5d708413e..c7f52c079 100644 --- a/src/lsp/utilities.ts +++ b/src/lsp/utilities.ts @@ -7,9 +7,7 @@ const versionFileName = 'clojure-lsp-version'; const artifacts = { darwin: { x64: 'clojure-lsp-native-macos-amd64.zip', - // Should M1 Macs use emulated native binary or native standalone jar until M1 native available? - // For now, let's use the Intel binary - arm64: 'clojure-lsp-native-macos-amd64.zip', + arm64: 'clojure-lsp-native-macos-aarch64.zip', }, linux: { x64: 'clojure-lsp-native-static-linux-amd64.zip',