Skip to content

Commit

Permalink
tweak: Switch to using cross for arm64 linux
Browse files Browse the repository at this point in the history
  • Loading branch information
notheotherben committed Apr 24, 2024
1 parent 5d0ea8f commit 0718f2d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,8 @@ jobs:
- arch: "arm64"
os: linux
run_on: ubuntu-latest
target: aarch64-unknown-linux-musl
setup: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu lld pkg-config
# Ensure that the libgcc library can be found
sudo ln -s /usr/aarch64-linux-gnu/lib/libgcc_s.so.1 /usr/aarch64-linux-gnu/lib/libgcc_s.so
Invoke-WebRequest -OutFile /tmp/protoc.zip -Uri https://github.com/protocolbuffers/protobuf/releases/download/v${env:PROTOC_VERSION}/protoc-${env:PROTOC_VERSION}-linux-x86_64.zip
Expand-Archive /tmp/protoc.zip -DestinationPath ../tools
Add-Content -Path $env:GITHUB_PATH -Value "$((get-item ./).parent.fullname)/tools/bin"
target: aarch64-unknown-linux-gnu
cross: true
flags: --features openssl_src

# Apple MacOS builds
Expand Down Expand Up @@ -167,6 +158,7 @@ jobs:
- name: cargo build
uses: actions-rs/[email protected]
with:
use-cross: ${{ matrix.cross }}
command: build
args: --release --target ${{ matrix.target }} ${{ matrix.flags }}

Expand Down
9 changes: 9 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[target.aarch64-unknown-linux-gnu]
pre-build = [
"apt update && apt install -y protobuf-compiler"
]

[target.x86_64-unknown-linux-gnu]
pre-build = [
"apt update && apt install -y protobuf-compiler"
]

0 comments on commit 0718f2d

Please sign in to comment.