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 1 commit
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
12 changes: 12 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 @@ -44,8 +46,18 @@ jobs:
- 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
env:
RUSTFLAGS: "-D warnings"
if: ${{ matrix.settings.target }} == aarch64-unknown-linux-gnu
run: |
sudo apt update
sudo apt install -y crossbuild-essential-arm64
cargo build --target ${{ matrix.settings.target }} --release

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use cross for this, that's what we do in the other workflows.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't been able to build with cross for that target locally. I end up getting an error from the linker that it's unable to link something, so I end up having to build in a Linux ARM64 VM.

Oddly though, I'm not even getting that far in the workflow runner with cross. It fails when trying to build the ring crate. Any idea how to get past that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, looking at this, cross apparently doesn't have the right build tools installed? I thought cross pulled a container image that was configured for whatever target you specified.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not running through cross, you need to swap out the cargo command for cross, look at the other workflows for examples.

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