Skip to content

Commit

Permalink
Merge pull request #429 from stepchowfun/aarch64-unknown-linux-gnu
Browse files Browse the repository at this point in the history
Add support for AArch64 GNU Linux
  • Loading branch information
stepchowfun authored May 23, 2023
2 parents b827a53 + 0c6f600 commit 8deaee7
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 15 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ jobs:
name: x86_64-unknown-linux-musl
path: artifacts/typical
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/typical-aarch64-unknown-linux-gnu artifacts/typical
- uses: actions/upload-artifact@v2
with:
name: aarch64-unknown-linux-gnu
path: artifacts/typical
if-no-files-found: error
ci-windows:
name: Build for Windows
runs-on: windows-latest
Expand Down Expand Up @@ -169,6 +179,9 @@ jobs:
mv \
artifacts/x86_64-unknown-linux-musl/typical \
artifacts/typical-x86_64-unknown-linux-musl
mv \
artifacts/aarch64-unknown-linux-gnu/typical \
artifacts/typical-aarch64-unknown-linux-gnu
mv \
artifacts/x86_64-apple-darwin/typical \
artifacts/typical-x86_64-apple-darwin
Expand All @@ -185,6 +198,7 @@ jobs:
--message "v$VERSION" \
--attach 'artifacts/typical-x86_64-unknown-linux-gnu' \
--attach 'artifacts/typical-x86_64-unknown-linux-musl' \
--attach 'artifacts/typical-aarch64-unknown-linux-gnu' \
--attach 'artifacts/typical-x86_64-apple-darwin' \
--attach 'artifacts/typical-aarch64-apple-darwin' \
--attach 'artifacts/typical-x86_64-pc-windows-msvc.exe' \
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ 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.9.4] - 2023-05-23

### Added
- Typical supports a new platform: AArch64 GNU Linux.

## [0.9.3] - 2023-05-13

### Added
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "typical"
version = "0.9.3"
version = "0.9.4"
authors = ["Stephan Boyer <[email protected]>"]
edition = "2021"
description = "Data interchange with algebraic data types."
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -690,9 +690,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 Typical with this command:
If you're running macOS or Linux (AArch64 or x86-64), you can install Typical with this command:

```sh
curl https://raw.githubusercontent.com/stepchowfun/typical/main/install.sh -LSfs | sh
Expand Down
11 changes: 6 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@
if uname -a | grep -qi 'x86_64.*GNU/Linux'; then
echo 'x86-64 GNU Linux detected.'
FILENAME=typical-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=typical-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=typical-aarch64-unknown-linux-gnu
elif uname -a | grep -qi 'Darwin.*x86_64'; then
echo 'x86-64 macOS detected.'
FILENAME=typical-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=typical-aarch64-apple-darwin
fi
Expand Down
23 changes: 17 additions & 6 deletions toast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 the following packages:
#
Expand Down Expand Up @@ -313,10 +314,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
Expand All @@ -326,6 +334,9 @@ tasks:
cp \
target/x86_64-unknown-linux-musl/release/typical \
artifacts/typical-x86_64-unknown-linux-musl
cp \
target/aarch64-unknown-linux-gnu/release/typical \
artifacts/typical-aarch64-unknown-linux-gnu
publish:
description: Publish the crate to crates.io.
Expand Down

0 comments on commit 8deaee7

Please sign in to comment.