From b24f5b7a8b620956a22a5d6923d9d565388a859c Mon Sep 17 00:00:00 2001 From: Warm Beer Date: Fri, 2 Aug 2024 20:02:55 +0200 Subject: [PATCH 1/8] feat: add `aarch64-apple-darwin` support --- Cargo.toml | 2 +- src/cmd.rs | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b8c9d1d..4a871cb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ semver = "1.0.4" serde = "1.0" serde_derive = "1.0" serde_json = "1.0" -sn-releases = "0.2.0" +sn-releases = "0.2.7" tempfile = "3.8.1" textwrap = "0.16.0" tokio = { version = "1.26", features = ["full"] } diff --git a/src/cmd.rs b/src/cmd.rs index 2d080fc..7c5653e 100644 --- a/src/cmd.rs +++ b/src/cmd.rs @@ -202,14 +202,10 @@ fn get_platform() -> Result { } Ok(format!("{}-pc-{}-msvc", ARCH, OS)) } - "macos" => { - if ARCH != "x86_64" { - println!( - "We currently only have x86_64 binaries available for macOS. On Mx Macs, Rosetta will run these x86_64 binaries." - ); - } - Ok(format!("{}-apple-darwin", ARCH)) - } + "macos" => match ARCH { + "x86_64" | "aarch64" => Ok(format!("{}-apple-darwin", ARCH)), + _ => Err(eyre!("We currently do not have binaries for the {OS}/{ARCH} combination")), + }, &_ => Err(eyre!("{OS} is not currently supported by safeup")), } } From 91be520b7a08e5e7bee6def9594d8d953f3d85d5 Mon Sep 17 00:00:00 2001 From: Warm Beer Date: Fri, 2 Aug 2024 22:32:51 +0200 Subject: [PATCH 2/8] feat: add `aarch64-apple-darwin` release binaries --- .github/workflows/pr.yml | 2 ++ .github/workflows/release.yml | 6 ++++++ Justfile | 2 ++ install.sh | 8 +++++++- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5b775a0..10bbd90 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -27,6 +27,8 @@ jobs: target: x86_64-pc-windows-msvc - os: macos-latest target: x86_64-apple-darwin + - os: macos-latest + target: aarch64-apple-darwin - os: ubuntu-latest target: x86_64-unknown-linux-musl steps: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b1ace7e..46bd77f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,6 +20,8 @@ jobs: target: x86_64-pc-windows-msvc - os: macos-latest target: x86_64-apple-darwin + - os: macos-latest + target: aarch64-apple-darwin - os: ubuntu-latest target: x86_64-unknown-linux-musl - os: ubuntu-latest @@ -76,6 +78,10 @@ jobs: with: name: safeup-x86_64-apple-darwin path: artifacts/x86_64-apple-darwin/release + - uses: actions/download-artifact@master + with: + name: safeup-aarch64-apple-darwin + path: artifacts/aarch64-apple-darwin/release - uses: actions/download-artifact@master with: name: safeup-arm-unknown-linux-musleabi diff --git a/Justfile b/Justfile index 1e0529e..712c018 100644 --- a/Justfile +++ b/Justfile @@ -10,6 +10,7 @@ build-release-artifacts arch: supported_archs=( "x86_64-pc-windows-msvc" "x86_64-apple-darwin" + "aarch64-apple-darwin" "x86_64-unknown-linux-musl" "arm-unknown-linux-musleabi" "armv7-unknown-linux-musleabihf" @@ -58,6 +59,7 @@ package-release-assets: architectures=( "x86_64-pc-windows-msvc" "x86_64-apple-darwin" + "aarch64-apple-darwin" "x86_64-unknown-linux-musl" "arm-unknown-linux-musleabi" "armv7-unknown-linux-musleabihf" diff --git a/install.sh b/install.sh index 73f4360..3bd0d06 100755 --- a/install.sh +++ b/install.sh @@ -55,7 +55,13 @@ function detect_arch() { arch_triple="x86_64-unknown-$os-musl" fi ;; - aarch64*) arch_triple="aarch64-unknown-$os-musl" ;; + aarch64*) + if [[ $os == "mac" ]]; then + arch_triple="aarch64-apple-darwin" + else + arch_triple="aarch64-unknown-$os-musl" + fi + ;; arm64*) if [[ $os == "mac" ]]; then echo "Mac arm64 architecture not supported, installing x86_64 version" From c9436a93791e0eca3c2441d0d6c337627d3a1f5c Mon Sep 17 00:00:00 2001 From: Warm Beer Date: Fri, 2 Aug 2024 22:47:26 +0200 Subject: [PATCH 3/8] chore(fmt): formatting --- src/cmd.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cmd.rs b/src/cmd.rs index 7c5653e..6248925 100644 --- a/src/cmd.rs +++ b/src/cmd.rs @@ -204,7 +204,9 @@ fn get_platform() -> Result { } "macos" => match ARCH { "x86_64" | "aarch64" => Ok(format!("{}-apple-darwin", ARCH)), - _ => Err(eyre!("We currently do not have binaries for the {OS}/{ARCH} combination")), + _ => Err(eyre!( + "We currently do not have binaries for the {OS}/{ARCH} combination" + )), }, &_ => Err(eyre!("{OS} is not currently supported by safeup")), } From a57c0e6870cc27a414788ebb8e95b50778640140 Mon Sep 17 00:00:00 2001 From: Warm Beer Date: Fri, 2 Aug 2024 23:17:18 +0200 Subject: [PATCH 4/8] chore(workflow): update client version to `0.94.0` --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 10bbd90..5779da0 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -10,7 +10,7 @@ on: pull_request env: RUST_BACKTRACE: 1 RUSTFLAGS: "-D warnings" - CLIENT_VERSION: 0.77.27 + CLIENT_VERSION: 0.94.0 NODE_VERSION: 0.83.25 NODE_MANAGER_VERSION: 0.1.8 From 8b2d427738363bbd0bc8cd9eda84ed96adce9a14 Mon Sep 17 00:00:00 2001 From: Warm Beer Date: Mon, 5 Aug 2024 09:33:42 +0200 Subject: [PATCH 5/8] chore(workflow): update node version to `0.110.0` --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5779da0..77de109 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -11,7 +11,7 @@ env: RUST_BACKTRACE: 1 RUSTFLAGS: "-D warnings" CLIENT_VERSION: 0.94.0 - NODE_VERSION: 0.83.25 + NODE_VERSION: 0.110.0 NODE_MANAGER_VERSION: 0.1.8 jobs: From 4980c55c46d43c3efdb3d9790078b32a98daba33 Mon Sep 17 00:00:00 2001 From: Warm Beer Date: Mon, 5 Aug 2024 09:37:49 +0200 Subject: [PATCH 6/8] chore(workflow): update node manager version to `0.10.1` --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 77de109..a3fc36c 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -12,7 +12,7 @@ env: RUSTFLAGS: "-D warnings" CLIENT_VERSION: 0.94.0 NODE_VERSION: 0.110.0 - NODE_MANAGER_VERSION: 0.1.8 + NODE_MANAGER_VERSION: 0.10.1 jobs: # The code in this crate uses lots of conditional compilation for cross-platform capabilities. From f1742dfbab496c4c75ad805fbd142355bc8a1274 Mon Sep 17 00:00:00 2001 From: Warm Beer Date: Tue, 6 Aug 2024 15:21:06 +0200 Subject: [PATCH 7/8] fix(test): impl `download_winsw` --- src/install.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/install.rs b/src/install.rs index dba97d1..83b252e 100644 --- a/src/install.rs +++ b/src/install.rs @@ -489,6 +489,7 @@ mod test { dest_dir_path: &Path, callback: &ProgressCallback, ) -> SnReleaseResult; + async fn download_winsw(&self, dest_path: &Path, callback: &ProgressCallback) -> SnReleaseResult<()>; fn extract_release_archive(&self, archive_path: &Path, extract_dir: &Path) -> SnReleaseResult; } } From f4d2bcff99aeb0e1f6b99fec00008abe79a2e675 Mon Sep 17 00:00:00 2001 From: Warm Beer Date: Tue, 6 Aug 2024 15:27:27 +0200 Subject: [PATCH 8/8] chore: remove unused dependency --- Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 4a871cb..858af1e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,6 @@ indicatif = "0.17.3" indoc = "2.0.1" lazy_static = "1.4.0" prettytable-rs = "0.10.0" -reqwest = { version = "0.11", default-features = false, features = ["json", "rustls-tls"] } semver = "1.0.4" serde = "1.0" serde_derive = "1.0"