Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: linux arm64 cross-compilation (hopefully) #653

Closed
wants to merge 7 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/build-rust-cross-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
target: x86_64-pc-windows-msvc
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
- os: ubuntu-22.04
target: aarch64-unknown-linux-gnu

steps:
- name: Checkout
Expand All @@ -38,14 +40,27 @@ jobs:
- name: Cache cargo registry
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3

- name: Install Cross (aarch64-unknown-linux-gnu)
if: ${{ matrix.settings.target == 'aarch64-unknown-linux-gnu' }}
run: cargo install cross --locked --git https://github.com/cross-rs/cross.git --rev 185398b1b885820515a212de720a306b08e2c8c9

- name: Add build architecture
run: rustup target add ${{ matrix.settings.target }}

- name: Build Rust
env:
RUSTFLAGS: "-D warnings"
if: ${{ matrix.settings.target != 'aarch64-unknown-linux-gnu' }}
run: cargo build --target ${{ matrix.settings.target }} --release

- name: Build Rust (aarch64-unknown-linux-gnu)
env:
RUSTFLAGS: "-D warnings"
if: ${{ matrix.settings.target == 'aarch64-unknown-linux-gnu' }}
run: |
cargo clean
cross build --target ${{ matrix.settings.target }} --release

- name: Upload Artifact
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
Expand Down
Loading