Skip to content

Commit

Permalink
new: Add Linux arm64 support. (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj authored Dec 11, 2023
1 parent 41478b7 commit 60dc560
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ codegen-units = 1
lto = true
panic = "abort"
strip = "debuginfo"

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
6 changes: 6 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ jobs:
fail-fast: false
matrix:
include:
- target: aarch64-unknown-linux-gnu
host: buildjet-8vcpu-ubuntu-2204-arm
ext: ""

- target: x86_64-unknown-linux-gnu
host: ubuntu-20.04
ext: ""
Expand Down Expand Up @@ -58,6 +62,8 @@ jobs:
run: |
rustup target add ${{ matrix.target }}
cargo build --release --target ${{ matrix.target }}
env:
RUST_BACKTRACE: 1
- name: Rename binary
run: mv ./target/${{ matrix.target }}/release/proto${{ matrix.ext }} ./proto-${{ matrix.target }}${{ matrix.ext }}
# Canary
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ jobs:
with:
submodules: recursive
- name: Install cargo-dist
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.5.0/cargo-dist-installer.sh | sh"
# we specify bash to get pipefail; it guards against the `curl` command
# failing. otherwise `sh` won't catch that `curl` returned non-0
shell: bash
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.6.0-prerelease.2/cargo-dist-installer.sh | sh"
# sure would be cool if github gave us proper conditionals...
# so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
# functionality based on whether this is a pull_request, and whether it's from a fork.
Expand Down Expand Up @@ -106,6 +109,10 @@ jobs:
submodules: recursive
- uses: swatinem/rust-cache@v2
- name: Install cargo-dist
if: ${{ contains(matrix.runner, 'arm') }}
run: cargo install cargo-dist --git https://github.com/axodotdev/cargo-dist --tag v0.6.0-prerelease.2
- name: Install cargo-dist
if: ${{ !contains(matrix.runner, 'arm') }}
run: ${{ matrix.install_dist }}
# Get the dist-manifest
- name: Fetch local artifacts
Expand Down Expand Up @@ -156,7 +163,7 @@ jobs:
with:
submodules: recursive
- name: Install cargo-dist
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.5.0/cargo-dist-installer.sh | sh"
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.6.0-prerelease.2/cargo-dist-installer.sh | sh"
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
- name: Fetch local artifacts
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -200,7 +207,7 @@ jobs:
with:
submodules: recursive
- name: Install cargo-dist
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.5.0/cargo-dist-installer.sh | sh"
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.6.0-prerelease.2/cargo-dist-installer.sh | sh"
# Fetch artifacts from scratch-storage
- name: Fetch artifacts
uses: actions/download-artifact@v3
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
- [Rust](https://github.com/moonrepo/rust-plugin/blob/master/CHANGELOG.md)
- [TOML schema](https://github.com/moonrepo/schema-plugin/blob/master/CHANGELOG.md)

## Unreleased

#### 🚀 Updates

- Added Linux arm64 gnu and musl support (`aarch64-unknown-linux-gnu` and `aarch64-unknown-linux-musl`).

## 0.24.2

#### 🚀 Updates
Expand Down
10 changes: 8 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,16 @@ tracing = "0.1.40"
# Config for 'cargo dist'
[workspace.metadata.dist]
# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax)
cargo-dist-version = "0.5.0"
cargo-dist-version = "0.6.0-prerelease.2"
# CI backends to support
ci = ["github"]
# Target platforms to build apps for (Rust target-triple syntax)
targets = [
"aarch64-unknown-linux-gnu",
"x86_64-unknown-linux-gnu",
"aarch64-apple-darwin",
"x86_64-apple-darwin",
"aarch64-unknown-linux-musl",
"x86_64-unknown-linux-musl",
"x86_64-pc-windows-msvc",
]
Expand All @@ -59,10 +61,14 @@ installers = []
# Path that installers should place binaries in
install-path = "~/.proto/bin"
# Publish jobs to run in CI
pr-run-mode = "plan"
pr-run-mode = "upload"
# Skip checking whether the specified configuration files are up to date
allow-dirty = ["ci"]

[workspace.metadata.dist.github-custom-runners]
aarch64-unknown-linux-gnu = "buildjet-4vcpu-ubuntu-2204-arm"
aarch64-unknown-linux-musl = "buildjet-4vcpu-ubuntu-2204-arm"

[profile.dist]
inherits = "release"
lto = "thin"

0 comments on commit 60dc560

Please sign in to comment.