Browse Source

Build for aarch64 which is needed for RPi4

compile-for-aarch64
Philipp Hoenisch 3 years ago
parent
commit
e4762462ef
No known key found for this signature in database GPG Key ID: E5F8E74C672BC666
  1. 2
      .cargo/config.toml
  2. 17
      .github/workflows/build-release-binary.yml
  3. 18
      .github/workflows/ci.yml
  4. 2
      rust-toolchain.toml

2
.cargo/config.toml

@ -1,2 +1,4 @@
[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"
[target.aarch64-unknown-linux-gnu]
linker = "aarch64-unknown-linux-gnu"

17
.github/workflows/build-release-binary.yml

@ -18,6 +18,10 @@ jobs:
target: armv7-unknown-linux-gnueabihf
os: ubuntu-latest
archive_ext: tar
- bin: taker
target: aarch64-unknown-linux-gnu
os: ubuntu-latest
archive_ext: tar
- bin: taker
target: x86_64-apple-darwin
os: macos-latest
@ -34,6 +38,10 @@ jobs:
target: armv7-unknown-linux-gnueabihf
os: ubuntu-latest
archive_ext: tar
- bin: maker
target: aarch64-unknown-linux-gnu
os: ubuntu-latest
archive_ext: tar
- bin: maker
target: x86_64-apple-darwin
os: macos-latest
@ -63,6 +71,12 @@ jobs:
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf
- name: Install compiler for armhf arch
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install 'gcc-aarch64-linux-gnu'
- uses: actions/setup-node@v2
with:
node-version: '16'
@ -80,7 +94,8 @@ jobs:
run: cargo build --target=${{ matrix.target }} --release --bin ${{ matrix.bin }}
- name: Smoke test the binary
if: matrix.target != 'armv7-unknown-linux-gnueabihf' # armv7-unknown-linux-gnueabihf is only cross-compiled, no smoke test
# armv7-* and aarch64-* is only cross-compiled, no smoke test
if: matrix.target != 'armv7-unknown-linux-gnueabihf' AND matrix.target != 'aarch64-unknown-linux-gnu'
run: target/${{ matrix.target }}/release/${{ matrix.bin }} --help
# Remove once python 3 is the default

18
.github/workflows/ci.yml

@ -94,20 +94,32 @@ jobs:
daemons_arm_build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- target: armv7-unknown-linux-gnueabihf
- target: aarch64-unknown-linux-gnu
steps:
- uses: actions/checkout@v2
- name: Setup rust toolchain
run: rustup show
- uses: Swatinem/rust-cache@v1.3.0
- name: Install compiler for armhf arch
if: matrix.target == 'armv7-unknown-linux-gnueabihf'
run: |
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf
- run: cargo build --target=armv7-unknown-linux-gnueabihf --bins
- name: Install compiler for aarch64 arch
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install 'gcc-aarch64-linux-gnu'
- run: cargo build --target=${{ matrix.target }} --bins
- name: Upload binaries
uses: actions/upload-artifact@v2
with:
name: maker-and-taker-binaries-armv7
path: |
target/armv7-unknown-linux-gnueabihf/debug/maker
target/armv7-unknown-linux-gnueabihf/debug/taker
target/${{ matrix.target }}/debug/maker
target/${{ matrix.target }}/debug/taker

2
rust-toolchain.toml

@ -1,4 +1,4 @@
[toolchain]
channel = "1.55"
components = ["clippy"]
targets = ["armv7-unknown-linux-gnueabihf"]
targets = ["armv7-unknown-linux-gnueabihf", "aarch64-unknown-linux-gnu"]

Loading…
Cancel
Save