From 23f69f475ea2d707ebdf72d97ef5ebd947a85ac4 Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Fri, 8 Dec 2023 05:17:47 +0000 Subject: [PATCH] feat: add support for `aarch64-unknown-gnu-linux` --- .fluentci/src/dagger/jobs.ts | 14 +++++++++++++- .github/workflows/release.yml | 1 + crates/cli/Cargo.toml | 2 +- flake.nix | 2 +- install.sh | 11 ++++++++++- 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.fluentci/src/dagger/jobs.ts b/.fluentci/src/dagger/jobs.ts index 11deefd..8823ff4 100644 --- a/.fluentci/src/dagger/jobs.ts +++ b/.fluentci/src/dagger/jobs.ts @@ -35,12 +35,24 @@ export const build = async (src = ".") => { .container() .from("rust:1.73-bullseye") .withExec(["apt-get", "update"]) - .withExec(["apt-get", "install", "-y", "build-essential"]) + .withExec([ + "apt-get", + "install", + "-y", + "build-essential", + "gcc-aarch64-linux-gnu", + ]) .withDirectory("/app", context, { exclude }) .withWorkdir("/app") .withMountedCache("/app/target", client.cacheVolume("target")) .withMountedCache("/root/cargo/registry", client.cacheVolume("registry")) .withMountedCache("/assets", client.cacheVolume("gh-release-assets")) + .withEnvVariable( + "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER", + Deno.env.get("TARGET") === "aarch64-unknown-linux-gnu" + ? "aarch64-linux-gnu-gcc" + : "" + ) .withEnvVariable("TAG", Deno.env.get("TAG") || "latest") .withEnvVariable( "TARGET", diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 14455ac..cde6430 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,6 +9,7 @@ jobs: strategy: matrix: target: + - aarch64-unknown-linux-gnu - x86_64-unknown-linux-gnu steps: - uses: actions/checkout@v3 diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 3644be4..a0f9aa9 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT" name = "crosup" readme = "../../README.md" repository = "https://github.com/tsirysndr/crosup" -version = "0.5.0" +version = "0.5.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/flake.nix b/flake.nix index 73ab1da..13448b9 100644 --- a/flake.nix +++ b/flake.nix @@ -40,7 +40,7 @@ inherit src; pname = "crosup"; - version = "0.5.0"; + version = "0.5.1"; cargoExtraArgs = "--package=crosup"; buildInputs = [ diff --git a/install.sh b/install.sh index 214f1e5..04ad9eb 100644 --- a/install.sh +++ b/install.sh @@ -19,7 +19,16 @@ if [ "$OS" = "Darwin" ]; then ASSET_NAME="_x86_64-apple-darwin.tar.gz" fi elif [ "$OS" = "Linux" ]; then - ASSET_NAME="_x86_64-unknown-linux-gnu.tar.gz" + # Determine the CPU architecture + ARCH=$(uname -m) + if [ "$ARCH" = "aarch64" ]; then + ASSET_NAME="_aarch64-unknown-linux-gnu.tar.gz" + elif [ "$ARCH" = "x86_64" ]; then + ASSET_NAME="_x86_64-unknown-linux-gnu.tar.gz" + else + echo "Unsupported architecture: $ARCH" + exit 1 + fi else echo "Unsupported operating system: $OS" exit 1