From 742091100c200b297cb0bff3f456f4ceb89e67d6 Mon Sep 17 00:00:00 2001 From: Stephan Boyer Date: Tue, 23 May 2023 03:29:56 -0700 Subject: [PATCH] Add support for AArch64 GNU Linux --- .github/workflows/ci.yml | 14 ++++++++++++++ CHANGELOG.md | 5 +++++ Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 4 ++-- install.sh | 11 ++++++----- toast.yml | 25 ++++++++++++++++++++++--- 7 files changed, 51 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86338f6..8e7b467 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,6 +41,16 @@ jobs: name: x86_64-unknown-linux-musl path: artifacts/toast if-no-files-found: error + - run: | + # Make Bash not silently ignore errors. + set -euo pipefail + # The artifact name will contain the target triple, so the file name doesn't need to. + mv artifacts/toast-aarch64-unknown-linux-gnu artifacts/toast + - uses: actions/upload-artifact@v2 + with: + name: aarch64-unknown-linux-gnu + path: artifacts/toast + if-no-files-found: error ci-windows: name: Build for Windows runs-on: windows-latest @@ -162,6 +172,9 @@ jobs: mv \ artifacts/x86_64-unknown-linux-musl/toast \ artifacts/toast-x86_64-unknown-linux-musl + mv \ + artifacts/aarch64-unknown-linux-gnu/toast \ + artifacts/toast-aarch64-unknown-linux-gnu mv \ artifacts/x86_64-apple-darwin/toast \ artifacts/toast-x86_64-apple-darwin @@ -178,6 +191,7 @@ jobs: --message "v$VERSION" \ --attach 'artifacts/toast-x86_64-unknown-linux-gnu' \ --attach 'artifacts/toast-x86_64-unknown-linux-musl' \ + --attach 'artifacts/toast-aarch64-unknown-linux-gnu' \ --attach 'artifacts/toast-x86_64-apple-darwin' \ --attach 'artifacts/toast-aarch64-apple-darwin' \ --attach 'artifacts/toast-x86_64-pc-windows-msvc.exe' \ diff --git a/CHANGELOG.md b/CHANGELOG.md index ca28db1..122c575 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.47.3] - 2023-05-23 + +### Added +- Toast supports a new platform: AArch64 GNU Linux. + ## [0.47.2] - 2023-05-13 ### Added diff --git a/Cargo.lock b/Cargo.lock index dfb4b66..e3d041e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -630,7 +630,7 @@ dependencies = [ [[package]] name = "toast" -version = "0.47.2" +version = "0.47.3" dependencies = [ "atty", "clap", diff --git a/Cargo.toml b/Cargo.toml index 8dd3eae..a331065 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "toast" -version = "0.47.2" +version = "0.47.3" authors = ["Stephan Boyer "] edition = "2021" description = "Containerize your development and continuous integration environments." diff --git a/README.md b/README.md index 397c99e..1133af3 100644 --- a/README.md +++ b/README.md @@ -451,9 +451,9 @@ ARGS: ## Installation instructions -### Installation on macOS (AArch64 or x86-64) or Linux (x86-64) +### Installation on macOS or Linux (AArch64 or x86-64) -If you're running macOS (AArch64 or x86-64) or Linux (x86-64), you can install Toast with this command: +If you're running macOS or Linux (AArch64 or x86-64), you can install Toast with this command: ```sh diff --git a/install.sh b/install.sh index 9fb4a23..42939db 100755 --- a/install.sh +++ b/install.sh @@ -21,15 +21,16 @@ if uname -a | grep -qi 'x86_64.*GNU/Linux'; then echo 'x86-64 GNU Linux detected.' FILENAME=toast-x86_64-unknown-linux-gnu - elif uname -a | grep -qi 'x86_64 Linux'; then + elif uname -a | grep -qi 'x86_64.*Linux'; then echo 'x86-64 non-GNU Linux detected.' FILENAME=toast-x86_64-unknown-linux-musl - fi - if uname -a | grep -qi 'Darwin.*x86_64'; then + elif uname -a | grep -qi 'aarch64.*GNU/Linux'; then + echo 'AArch64 GNU Linux detected.' + FILENAME=toast-aarch64-unknown-linux-gnu + elif uname -a | grep -qi 'Darwin.*x86_64'; then echo 'x86-64 macOS detected.' FILENAME=toast-x86_64-apple-darwin - fi - if uname -a | grep -qi 'Darwin.*arm64'; then + elif uname -a | grep -qi 'Darwin.*arm64'; then echo 'AArch64 macOS detected.' FILENAME=toast-aarch64-apple-darwin fi diff --git a/toast.yml b/toast.yml index 604fdee..e196c4d 100644 --- a/toast.yml +++ b/toast.yml @@ -29,13 +29,22 @@ tasks: command: | # Install the following packages: # - # - build-essential - Used for linking the binary # - curl - Used for installing Tagref and Rust + # - gcc-aarch64-linux-gnu - Used for linking the binary for AArch64 + # - gcc-x86-64-linux-gnu - Used for linking the binary for x86-64 + # - gnupg - Used to install Docker's GPG key # - lsb-release - Used below to determine the Ubuntu release codename # - ripgrep - Used for various linting tasks # - shellcheck - Used for linting shell scripts apt-get update - apt-get install --yes build-essential curl lsb-release ripgrep shellcheck + apt-get install --yes \ + curl \ + gcc-aarch64-linux-gnu \ + gcc-x86-64-linux-gnu \ + gnupg \ + lsb-release \ + ripgrep \ + shellcheck # Download Docker's official GPG key. curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \ @@ -217,10 +226,17 @@ tasks: # Add the targets. It's likely that this script is currently running in one of them. rustup target add x86_64-unknown-linux-gnu rustup target add x86_64-unknown-linux-musl + rustup target add aarch64-unknown-linux-gnu - # Build the project for both Linux targets with Cargo. + # Set the linkers. + export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-linux-gnu-gcc + export CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=x86_64-linux-gnu-gcc + export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc + + # Build the project with Cargo for each Linux target. cargo-online build --release --target x86_64-unknown-linux-gnu cargo-online build --release --target x86_64-unknown-linux-musl + cargo-online build --release --target aarch64-unknown-linux-gnu # Move the binaries to a more conveniennt location for exporting. mkdir artifacts @@ -230,6 +246,9 @@ tasks: cp \ target/x86_64-unknown-linux-musl/release/toast \ artifacts/toast-x86_64-unknown-linux-musl + cp \ + target/aarch64-unknown-linux-gnu/release/toast \ + artifacts/toast-aarch64-unknown-linux-gnu validate_release: description: Validate the release.