From 713868b204f151acd1989c3f29ff9d3bc944c306 Mon Sep 17 00:00:00 2001 From: Dominic Elm Date: Fri, 3 Dec 2021 19:58:33 +0100 Subject: [PATCH 1/2] feat: add support for macos aarch64 --- src/install/mod.rs | 2 +- src/target.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/install/mod.rs b/src/install/mod.rs index 06bf72a..6474d1e 100644 --- a/src/install/mod.rs +++ b/src/install/mod.rs @@ -172,7 +172,7 @@ fn prebuilt_url(tool: &Tool, version: &str) -> Result { Tool::WasmOpt => "x86-linux", _ => bail!("Unrecognized target!"), } - } else if target::MACOS && target::x86_64 { + } else if target::MACOS && (target::x86_64 || target::aarch64) { "x86_64-apple-darwin" } else if target::WINDOWS && target::x86_64 { match tool { diff --git a/src/target.rs b/src/target.rs index cfaff6a..0a6d38f 100644 --- a/src/target.rs +++ b/src/target.rs @@ -13,3 +13,5 @@ pub const WINDOWS: bool = cfg!(target_os = "windows"); pub const x86_64: bool = cfg!(target_arch = "x86_64"); #[allow(non_upper_case_globals)] pub const x86: bool = cfg!(target_arch = "x86"); +#[allow(non_upper_case_globals)] +pub const aarch64: bool = cfg!(target_arch = "aarch64"); From 08825f20113f8be2fc2fcedddd51dedca9669f97 Mon Sep 17 00:00:00 2001 From: Dominic Elm Date: Tue, 14 Dec 2021 08:56:09 +0100 Subject: [PATCH 2/2] fix: add support for arm64 when using npm --- npm/binary.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/binary.js b/npm/binary.js index d66bf98..41b33d8 100644 --- a/npm/binary.js +++ b/npm/binary.js @@ -13,7 +13,7 @@ const getPlatform = () => { if (type === "Linux" && arch === "x64") { return "x86_64-unknown-linux-musl"; } - if (type === "Darwin" && arch === "x64") { + if (type === "Darwin" && (arch === "x64" || arch === "arm64")) { return "x86_64-apple-darwin"; }