Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest-large, macos-latest]
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased] - ReleaseDate

- `dfxvm` now has the aarch64-linux version and supports installing dfx with the aarch64-linux binaries.

## [1.0.1] - 2025-07-02

- `dfxvm --list` now supports listing the available dfx versions.
Expand Down
3 changes: 2 additions & 1 deletion dist-workspace.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ci = "github"
# The installers to generate for each app
installers = []
# Target platforms to build apps for (Rust target-triple syntax)
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu"]
targets = ["aarch64-apple-darwin", "aarch64-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu"]
# Which actions to run on pull requests
pr-run-mode = "plan"
# The archive format to use for non-windows builds (defaults .tar.xz)
Expand All @@ -21,5 +21,6 @@ dist = true
[dist.github-custom-runners]
global = "ubuntu-22.04"
x86_64-unknown-linux-gnu = "ubuntu-22.04"
aarch64-unknown-linux-gnu = "ubuntu-22.04-arm"
x86_64-apple-darwin = "macos-13"
aarch64-apple-darwin = "macos-15"
4 changes: 3 additions & 1 deletion src/dfxvm/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,10 @@ async fn download_verified_tarball(

#[allow(unused_variables)]
fn format_tarball_basename(version: &Version) -> &'static str {
#[cfg(target_os = "linux")]
#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
return "dfx-x86_64-unknown-linux-gnu";
#[cfg(all(target_os = "linux", target_arch = "aarch64"))]
return "dfx-aarch64-unknown-linux-gnu";
#[cfg(all(target_os = "macos", target_arch = "x86_64"))]
return "dfx-x86_64-apple-darwin";
#[cfg(all(target_os = "macos", target_arch = "aarch64"))]
Expand Down
6 changes: 4 additions & 2 deletions src/dfxvm/self_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,13 @@ pub fn cleanup_self_updater(locations: &Locations) -> Result<(), CleanupSelfUpda
}

fn format_tarball_url(settings: &Settings) -> Result<Url, FormatTarballUrlError> {
#[cfg(target_arch = "aarch64")]
#[cfg(all(target_os = "macos", target_arch = "aarch64"))]
let architecture = "aarch64-apple-darwin";
#[cfg(all(target_os = "macos", target_arch = "x86_64"))]
let architecture = "x86_64-apple-darwin";
#[cfg(target_os = "linux")]
#[cfg(all(target_os = "linux", target_arch = "aarch64"))]
let architecture = "aarch64-unknown-linux-gnu";
#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
let architecture = "x86_64-unknown-linux-gnu";

let basename = format!("dfxvm-{}", architecture);
Expand Down
5 changes: 3 additions & 2 deletions tests/suite/common/file_contents.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::common::ReleaseAsset;
use flate2::write::GzEncoder;
use flate2::Compression;
use semver::Version;
use serde_json::json;
use sha2::{Digest, Sha256};
use std::io::Write;
Expand Down Expand Up @@ -48,8 +49,8 @@ pub fn dist_manifest_json(latest: &str) -> String {
.to_string()
}

pub fn dfx_tarball(contents: &[u8]) -> Vec<u8> {
let dirname = ReleaseAsset::dfx_tarball_basename();
pub fn dfx_tarball(version: &Version, contents: &[u8]) -> Vec<u8> {
let dirname = ReleaseAsset::dfx_tarball_basename(version);
let include_docs = false;

tool_tarball("dfx", dirname, contents, include_docs)
Expand Down
42 changes: 28 additions & 14 deletions tests/suite/common/release_asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ impl ReleaseAsset {
}

pub fn dfx_tarball_with_dfx_contents(version: &str, executable: &[u8]) -> ReleaseAsset {
let filename = Self::dfx_tarball_filename().to_string();
let version = Version::parse(version).unwrap();
let filename = Self::dfx_tarball_filename(&version).to_string();

// must match the download_url_template in ReleaseServer::new
let url_path = format!("/any/arbitrary/path/{version}/{filename}");

let contents = dfx_tarball(executable);
let contents = dfx_tarball(&version, executable);
ReleaseAsset {
url_path,
filename,
Expand Down Expand Up @@ -52,27 +52,41 @@ impl ReleaseAsset {
.unwrap()
}

pub fn dfx_tarball_basename() -> &'static str {
#[cfg(target_os = "macos")]
let basename = "dfx-x86_64-apple-darwin";
#[cfg(target_os = "linux")]
let basename = "dfx-x86_64-unknown-linux-gnu";
basename
#[allow(unused_variables)]
pub fn dfx_tarball_basename(version: &Version) -> &'static str {
#[cfg(all(target_os = "macos", target_arch = "x86_64"))]
return "dfx-x86_64-apple-darwin";
#[cfg(all(target_os = "macos", target_arch = "aarch64"))]
{
// This is the first version that supports aarch64-apple-darwin.
let aarch64_apple_darwin_version = Version::parse("0.28.0-beta.1").unwrap();
if version >= &aarch64_apple_darwin_version {
return "dfx-aarch64-apple-darwin";
}
return "dfx-x86_64-apple-darwin";
}
#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
return "dfx-x86_64-unknown-linux-gnu";
#[cfg(all(target_os = "linux", target_arch = "aarch64"))]
return "dfx-aarch64-unknown-linux-gnu";
}

pub fn dfx_tarball_filename() -> String {
let basename = Self::dfx_tarball_basename();
pub fn dfx_tarball_filename(version: &Version) -> String {
let basename = Self::dfx_tarball_basename(version);
let archive_format = "tar.gz";
format!("{basename}.{archive_format}")
}

#[allow(unused_variables)]
pub fn dfxvm_tarball_basename() -> String {
#[cfg(target_arch = "aarch64")]
let arch_and_os = "aarch64-apple-darwin";
#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
let arch_and_os = "x86_64-unknown-linux-gnu";
#[cfg(all(target_os = "linux", target_arch = "aarch64"))]
let arch_and_os = "aarch64-unknown-linux-gnu";
#[cfg(all(target_os = "macos", target_arch = "x86_64"))]
let arch_and_os = "x86_64-apple-darwin";
#[cfg(target_os = "linux")]
let arch_and_os = "x86_64-unknown-linux-gnu";
#[cfg(all(target_os = "macos", target_arch = "aarch64"))]
let arch_and_os = "aarch64-apple-darwin";

format!("dfxvm-{}", arch_and_os)
}
Expand Down
Loading