Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add apple silicon support (aarch64-apple-darwin) #31

Merged
merged 8 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ on: pull_request
env:
RUST_BACKTRACE: 1
RUSTFLAGS: "-D warnings"
CLIENT_VERSION: 0.77.27
NODE_VERSION: 0.83.25
NODE_MANAGER_VERSION: 0.1.8
CLIENT_VERSION: 0.94.0
NODE_VERSION: 0.110.0
NODE_MANAGER_VERSION: 0.10.1

jobs:
# The code in this crate uses lots of conditional compilation for cross-platform capabilities.
Expand All @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ 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"
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"] }
Expand Down
2 changes: 2 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
8 changes: 7 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 6 additions & 8 deletions src/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,12 @@ fn get_platform() -> Result<String> {
}
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")),
}
}
Expand Down
1 change: 1 addition & 0 deletions src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ mod test {
dest_dir_path: &Path,
callback: &ProgressCallback,
) -> SnReleaseResult<PathBuf>;
async fn download_winsw(&self, dest_path: &Path, callback: &ProgressCallback) -> SnReleaseResult<()>;
fn extract_release_archive(&self, archive_path: &Path, extract_dir: &Path) -> SnReleaseResult<PathBuf>;
}
}
Expand Down
Loading