From 7f0f54a5e150ca691709baf75a92f8f38fb5d859 Mon Sep 17 00:00:00 2001 From: Stephan Boyer Date: Mon, 22 May 2023 02:30:55 -0700 Subject: [PATCH] Add support for AArch64 GNU Linux --- .github/workflows/ci.yml | 15 +++++++++++++++ CHANGELOG.md | 5 +++++ Cargo.lock | 2 +- Cargo.toml | 2 +- install.sh | 11 ++++++----- toast.yml | 21 ++++++++++++++++----- 6 files changed, 44 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 845e0df..deac1db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,6 +41,17 @@ jobs: name: x86_64-unknown-linux-musl path: artifacts/tagref 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/tagref-aarch64-unknown-linux-gnu artifacts/tagref + - uses: actions/upload-artifact@v2 + with: + name: aarch64-unknown-linux-gnu + path: artifacts/tagref + if-no-files-found: error ci-windows: name: Build for Windows runs-on: windows-latest @@ -162,6 +173,9 @@ jobs: mv \ artifacts/x86_64-unknown-linux-musl/tagref \ artifacts/tagref-x86_64-unknown-linux-musl + mv \ + artifacts/aarch64-unknown-linux-gnu/tagref \ + artifacts/tagref-aarch64-unknown-linux-gnu mv \ artifacts/x86_64-apple-darwin/tagref \ artifacts/tagref-x86_64-apple-darwin @@ -178,6 +192,7 @@ jobs: --message "v$VERSION" \ --attach 'artifacts/tagref-x86_64-unknown-linux-gnu' \ --attach 'artifacts/tagref-x86_64-unknown-linux-musl' \ + --attach 'artifacts/tagref-aarch64-unknown-linux-gnu' \ --attach 'artifacts/tagref-x86_64-apple-darwin' \ --attach 'artifacts/tagref-aarch64-apple-darwin' \ --attach 'artifacts/tagref-x86_64-pc-windows-msvc.exe' \ diff --git a/CHANGELOG.md b/CHANGELOG.md index 1416cf4..ac2e92d 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). +## [1.8.2] - 2023-05-22 + +### Added +- Tagref supports a new platform: AArch64 GNU Linux. + ## [1.8.1] - 2023-05-11 ### Added diff --git a/Cargo.lock b/Cargo.lock index a8dc482..5d093f4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -209,7 +209,7 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] name = "tagref" -version = "1.8.1" +version = "1.8.2" dependencies = [ "atty", "clap", diff --git a/Cargo.toml b/Cargo.toml index c7f8d33..ab4e348 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tagref" -version = "1.8.1" +version = "1.8.2" authors = ["Stephan Boyer "] edition = "2021" description = "Tagref helps you maintain cross-references in your code." diff --git a/install.sh b/install.sh index 734c86e..e44ac52 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=tagref-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=tagref-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=tagref-aarch64-unknown-linux-gnu + elif uname -a | grep -qi 'Darwin.*x86_64'; then echo 'x86-64 macOS detected.' FILENAME=tagref-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=tagref-aarch64-apple-darwin fi diff --git a/toast.yml b/toast.yml index a111d69..ee3b31a 100644 --- a/toast.yml +++ b/toast.yml @@ -29,12 +29,13 @@ tasks: command: | # Install the following packages: # - # - build-essential - Used for linking the binary - # - curl - Used for installing Tagref and Rust - # - ripgrep - Used for various linting tasks - # - shellcheck - Used for linting shell scripts + # - 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 + # - ripgrep - Used for various linting tasks + # - shellcheck - Used for linting shell scripts apt-get update - apt-get install --yes build-essential curl ripgrep shellcheck + apt-get install --yes curl gcc-aarch64-linux-gnu gcc-x86-64-linux-gnu ripgrep shellcheck install_tagref: description: Install Tagref, a reference checking tool. @@ -202,10 +203,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 + + # 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 for both Linux targets with Cargo. 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 @@ -215,6 +223,9 @@ tasks: cp \ target/x86_64-unknown-linux-musl/release/tagref \ artifacts/tagref-x86_64-unknown-linux-musl + cp \ + target/aarch64-unknown-linux-gnu/release/tagref \ + artifacts/tagref-aarch64-unknown-linux-gnu publish: description: Publish the crate to crates.io.