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
12 changes: 9 additions & 3 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
matrix:
# We build a dynamic-linked linux binary because otherwise HSM support fails with:
# Error: IO: Dynamic loading not supported
os: [macos-13, macos-13-xlarge, ubuntu-22.04, ubuntu-24.04, windows-2022]
os: [macos-13, macos-13-xlarge, ubuntu-22.04, ubuntu-22.04-arm, ubuntu-24.04, ubuntu-24.04-arm, windows-2022]
include:
- os: macos-13
target: x86_64-apple-darwin
Expand All @@ -66,9 +66,15 @@ jobs:
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
binary_path: target/x86_64-unknown-linux-gnu/release/dfx
- os: ubuntu-22.04-arm
target: aarch64-unknown-linux-gnu
binary_path: target/aarch64-unknown-linux-gnu/release/dfx
- os: ubuntu-24.04
target: x86_64-unknown-linux-gnu
binary_path: target/x86_64-unknown-linux-gnu/release/dfx
- os: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
binary_path: target/aarch64-unknown-linux-gnu/release/dfx
- os: windows-2022
target: x86_64-pc-windows-msvc
binary_path: target\x86_64-pc-windows-msvc\release\dfx.exe
Expand Down Expand Up @@ -114,7 +120,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-13, macos-13-xlarge, ubuntu-22.04, ubuntu-24.04]
os: [macos-13, macos-13-xlarge, ubuntu-22.04, ubuntu-22.04-arm, ubuntu-24.04, ubuntu-24.04-arm]
steps:
- uses: actions/checkout@v4
- name: Download dfx binary
Expand Down Expand Up @@ -184,7 +190,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-13, macos-13-xlarge, ubuntu-22.04, ubuntu-24.04]
os: [macos-13, macos-13-xlarge, ubuntu-22.04, ubuntu-22.04-arm, ubuntu-24.04, ubuntu-24.04-arm]
steps:
- name: Checking out repo
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-13-large, macos-13-xlarge, windows-latest ]
os: [ ubuntu-latest, ubuntu-24.04-arm, macos-13-large, macos-13-xlarge, windows-latest ]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prepare-dfx-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-13-large, macos-13-xlarge ]
os: [ ubuntu-latest, ubuntu-24.04-arm, macos-13-large, macos-13-xlarge ]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
Expand Down
21 changes: 18 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
matrix:
# We build a dynamic-linked linux binary because otherwise HSM support fails with:
# Error: IO: Dynamic loading not supported
target: [ x86_64-apple-darwin, aarch64-apple-darwin, x86_64-unknown-linux-gnu ]
target: [ x86_64-apple-darwin, aarch64-apple-darwin, x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu ]
include:
- os: macos-13-large
target: x86_64-apple-darwin
Expand All @@ -48,6 +48,11 @@ jobs:
binary_path: target/x86_64-unknown-linux-gnu/release
name: x86_64-linux
tar: tar
- os: ubuntu-22.04-arm
target: aarch64-unknown-linux-gnu
binary_path: target/aarch64-unknown-linux-gnu/release
name: aarch64-linux
tar: tar
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -93,8 +98,18 @@ jobs:
- name: Check dynamically-linked libraries (ubuntu)
run: |
ACTUAL="$(ldd ${{ matrix.binary_path }}/dfx | awk '{ print $1 }' | sort | awk -v d=" " '{s=(NR==1?s:s d)$0}END{printf "%s",s}')"
EXPECTED="/lib64/ld-linux-x86-64.so.2 libc.so.6 libgcc_s.so.1 libm.so.6 libstdc++.so.6 linux-vdso.so.1"

if [[ "${{ matrix.target }}" == "x86_64-unknown-linux-gnu" ]]; then
EXPECTED="/lib64/ld-linux-x86-64.so.2 libc.so.6 libgcc_s.so.1 libm.so.6 libstdc++.so.6 linux-vdso.so.1"
elif [[ "${{ matrix.target }}" == "aarch64-unknown-linux-gnu" ]]; then
EXPECTED="/lib/ld-linux-aarch64.so.1 libc.so.6 libgcc_s.so.1 libm.so.6 libstdc++.so.6 linux-vdso.so.1"
else
echo "Unsupported target: ${{ matrix.target }}"
exit 1
fi

echo "Dynamically-linked libraries:"
echo " Target: ${{ matrix.target }}"
echo " Actual: $ACTUAL"
echo " Expected: $EXPECTED"
if [ "$ACTUAL" != "$EXPECTED" ]; then
Expand Down Expand Up @@ -151,7 +166,7 @@ jobs:
strategy:
fail-fast: false
matrix:
name: [ 'x86_64-darwin', 'aarch64-darwin', 'x86_64-linux' ]
name: [ 'x86_64-darwin', 'aarch64-darwin', 'x86_64-linux', 'aarch64-linux' ]
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-13-large, macos-13-xlarge ]
os: [ ubuntu-latest, ubuntu-24.04-arm, macos-13-large, macos-13-xlarge ]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

# UNRELEASED

### feat: add dfx native support for aarch64-Linux

Add dfx native support for aarch64-Linux.

### feat: support canister snapshot download and upload.

Added `dfx canister snapshot download` and `dfx canister snapshot upload` commands to download and upload the canister snapshot.
Expand Down
2 changes: 1 addition & 1 deletion scripts/update-motoko.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ motoko_base_sha=$(curl --proto '=https' --tlsv1.2 -sSfL "$motoko_base_url" | sha
jq '.common."motoko-base" = {url: $url, sha256: $sha256, version: $version}' --arg version "$version" \
--arg url "$motoko_base_url" --arg sha256 "$motoko_base_sha" "$sources" | sponge "$sources"

declare -A variants=([x86_64-darwin]=Darwin-x86_64 [x86_64-linux]=Linux-x86_64 [arm64-darwin]=Darwin-arm64)
declare -A variants=([x86_64-darwin]=Darwin-x86_64 [x86_64-linux]=Linux-x86_64 [arm64-darwin]=Darwin-arm64 [arm64-linux]=Linux-aarch64)
for platform in "${!variants[@]}"; do
motoko_url=$(printf 'https://github.com/dfinity/motoko/releases/download/%s/motoko-%s-%s.tar.gz' \
"$(urlencode "$version")" "$(urlencode "${variants[$platform]}")" "$(urlencode "$version")")
Expand Down
2 changes: 1 addition & 1 deletion scripts/update-replica.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ rev=$1
echo "Updating sources to rev ${rev}"
jq '."replica-rev" = $rev' --arg rev "$rev" "$sources" | sponge "$sources"

declare -A variants=([x86_64-darwin]=pocket-ic.gz [x86_64-linux]=pocket-ic.gz [arm64-darwin]=pocket-ic-server-arm64-darwin)
declare -A variants=([x86_64-darwin]=pocket-ic.gz [x86_64-linux]=pocket-ic.gz [arm64-darwin]=pocket-ic-server-arm64-darwin [arm64-linux]=pocket-ic-server-arm64-linux)
for platform in "${!variants[@]}"; do
pocketic_url=$(printf 'https://download.dfinity.systems/ic/%s/binaries/%s/%s' "$rev" "$platform" "${variants[$platform]}")
pocketic_sha=$(curl --proto '=https' --tlsv1.2 -sSfL "$pocketic_url" | sha256sum | head -c 64)
Expand Down
13 changes: 9 additions & 4 deletions scripts/workflows/e2e-matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import json
import os

# Only run these tests on macOS
MACOS_TESTS = ["dfx/bitcoin", "dfx/canister_http_adapter", "dfx/start"]
# Only run these tests on macOS and Ubuntu-arm64
SELECTED_TESTS = ["dfx/bitcoin", "dfx/canister_http_adapter", "dfx/start"]

# Run these tests in serial
SERIAL_TESTS = ["dfx/start", "dfx/bitcoin", "dfx/cycles-ledger", "dfx/ledger", "dfx/serial_misc"]
Expand All @@ -31,8 +31,8 @@ def test_scripts(prefix):
"serial": serial,
})

# macOS: only run selected tests
if test in MACOS_TESTS:
# macOS and Ubuntu-arm64: only run selected tests
if test in SELECTED_TESTS:
include.append({
"test": test,
"os": "macos-13",
Expand All @@ -43,6 +43,11 @@ def test_scripts(prefix):
"os": "macos-13-xlarge",
"serial": serial,
})
include.append({
"test": test,
"os": "ubuntu-22.04-arm",
"serial": serial,
})
Comment thread
vincent-dfinity marked this conversation as resolved.

matrix = {
"include": include,
Expand Down
16 changes: 14 additions & 2 deletions scripts/workflows/provision-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,20 @@ sudo apt-get install --yes bats parallel moreutils
# Modifications needed for some tests
if [ "$E2E_TEST" = "tests-dfx/bitcoin.bash" ]; then
BITCOIN_CORE_VERSION=22.0
BITCOIN_CORE_FILENAME="bitcoin-$BITCOIN_CORE_VERSION-x86_64-linux-gnu.tar.gz"
BITCOIN_CORE_TARBALL_SHA="59ebd25dd82a51638b7a6bb914586201e67db67b919b2a1ff08925a7936d1b16"

# Check architecture and set filename and sha
ARCH=$(uname -m)
if [ "$ARCH" = "x86_64" ]; then
BITCOIN_CORE_FILENAME="bitcoin-$BITCOIN_CORE_VERSION-x86_64-linux-gnu.tar.gz"
BITCOIN_CORE_TARBALL_SHA="59ebd25dd82a51638b7a6bb914586201e67db67b919b2a1ff08925a7936d1b16"
elif [ "$ARCH" = "aarch64" ]; then
BITCOIN_CORE_FILENAME="bitcoin-$BITCOIN_CORE_VERSION-aarch64-linux-gnu.tar.gz"
BITCOIN_CORE_TARBALL_SHA="ac718fed08570a81b3587587872ad85a25173afa5f9fbbd0c03ba4d1714cfa3e"
else
echo "Unsupported architecture: $ARCH"
exit 1
fi

(
cd "$(mktemp -d)"
wget "https://bitcoin.org/bin/bitcoin-core-$BITCOIN_CORE_VERSION/$BITCOIN_CORE_FILENAME"
Expand Down
3 changes: 3 additions & 0 deletions src/dfx/assets/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ impl Source {
struct Sources {
#[serde(rename = "x86_64-linux")]
x86_64_linux: HashMap<String, Source>,
#[serde(rename = "arm64-linux")]
aarch64_linux: HashMap<String, Source>,
#[serde(rename = "x86_64-darwin")]
x86_64_darwin: HashMap<String, Source>,
#[serde(rename = "arm64-darwin")]
Expand Down Expand Up @@ -104,6 +106,7 @@ fn find_assets(sources: Sources) -> PathBuf {
("x86_64", "macos") => sources.x86_64_darwin, // rosetta
("aarch64", "macos") => sources.aarch64_darwin, // aarch64
("x86_64", "linux" | "windows") => sources.x86_64_linux,
("aarch64", "linux") => sources.aarch64_linux,
(arch, os) => panic!("Unsupported OS type {arch}-{os}"),
};
source_set.extend(sources.common);
Expand Down
12 changes: 12 additions & 0 deletions src/dfx/assets/dfx-asset-sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@
"rev": "e915efecc8af90993ccfc499721ebe826aadba60"
}
},
"arm64-linux": {
"motoko": {
"url": "https://github.com/dfinity/motoko/releases/download/0.14.13/motoko-Linux-aarch64-0.14.13.tar.gz",
"sha256": "0571dbfa9e857aa19c4181654ddd84de25b9409163587a2c64730795dbb7cd05",
"version": "0.14.13"
},
"pocket-ic": {
"url": "https://download.dfinity.systems/ic/e915efecc8af90993ccfc499721ebe826aadba60/binaries/arm64-linux/pocket-ic-server-arm64-linux",
"sha256": "10a7cf4366bc1704a8eccde96c53e4cbdbc51ddd455427fb04d675b4c7f6fe37",
"rev": "e915efecc8af90993ccfc499721ebe826aadba60"
}
},
"common": {
"motoko-base": {
"url": "https://github.com/dfinity/motoko/releases/download/0.14.13/motoko-base-library.tar.gz",
Expand Down
Loading