Skip to content

Commit

Permalink
ci: fix aarch64 binary builds
Browse files Browse the repository at this point in the history
  • Loading branch information
vemonet committed Mar 30, 2024
1 parent ab8f3ba commit 888c734
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ rustflags = [
"-C", "link-arg=dynamic_lookup",
]

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
# [target.aarch64-unknown-linux-gnu]
# linker = "aarch64-linux-gnu-gcc"
11 changes: 8 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,21 @@ jobs:
- name: Add target
run: rustup update && rustup target add ${{ matrix.target }}

- name: Install aarch64 dependencies
if: matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'aarch64-apple-darwin'
- name: Install aarch64 linux dependencies
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: sudo apt update && sudo apt install -y g++-aarch64-linux-gnu
# echo -e "\n\n[target.aarch64-unknown-linux-gnu]\nlinker = \"aarch64-linux-gnu-gcc\"" >> .cargo/config.toml

- name: Add aarch64 linker
if: matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'aarch64-apple-darwin'
run: echo -e "\n\n[target.aarch64-unknown-linux-gnu]\nlinker = \"aarch64-linux-gnu-gcc\"" >> .cargo/config.toml
# This can't be directly added to cargo config.toml because it makes the wheel build fails

- uses: Swatinem/rust-cache@v2

- name: Build binary
run: cargo build --release --target ${{ matrix.target }}
working-directory: ./cli
# NOTE: for linux aarch64, we might need to set the sysroot
# env:
# BINDGEN_EXTRA_CLANG_ARGS: --sysroot /usr/aarch64-linux-gnu

Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
cache: npm
cache-dependency-path: "./js/package.json"
- run: |
rustup update
cargo install wasm-pack
./scripts/test-js.sh
- name: Run tests
run: ./scripts/test-js.sh

test-python:
name: 🐍 Tests Python
Expand All @@ -51,9 +59,9 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: 3.12
- run: |
rustup update
./scripts/test-python.sh
- run: rustup update
- name: Run tests
run: ./scripts/test-python.sh

cov:
name: ☂️ Coverage
Expand Down

0 comments on commit 888c734

Please sign in to comment.