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

Add support to generate Linux ARM64 #4

Merged
merged 2 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
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: 6 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Setup Cache
uses: Swatinem/rust-cache@v2

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

Expand All @@ -55,10 +52,10 @@ jobs:
# runner: ubuntu-latest
# target: riscv64gc-unknown-linux-gnu
# command: cross
# - name: Linux-arm64
# runner: ubuntu-latest
# target: aarch64-unknown-linux-gnu
# command: cross
- name: Linux-arm64
runner: ubuntu-latest
target: aarch64-unknown-linux-gnu
command: cross
- name: MacOS-amd64
runner: macos-latest
target: x86_64-apple-darwin
Expand All @@ -76,7 +73,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install requirements (Linux)
if: matrix.runner == 'ubuntu-latest' && matrix.command == 'cargo'
if: matrix.target == 'x86_64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install protobuf-compiler
Expand Down Expand Up @@ -106,7 +103,7 @@ jobs:
shell: bash
run: |
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
cargo binstall --no-confirm cross
cargo binstall --force --no-confirm cross

- name: Copy config
working-directory: tripa
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Rust test

on:
pull_request:
branches: [ "main" ]
branches: ["main"]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -49,6 +49,5 @@ jobs:
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
cargo binstall --no-confirm cross
# TODO: Remove true after fix tests
- name: Test
run: cargo test --workspace --no-fail-fast || true
run: cargo test --workspace --no-fail-fast
9 changes: 4 additions & 5 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# add depency for reqwest that use openssl and protobuf for celestia
[target.riscv64gc-unknown-linux-gnu]
image = "ghcr.io/cross-rs/riscv64gc-unknown-linux-gnu:edge"
# add depency for reqwest that use openssl and protobuf for celestia
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get --assume-yes install libssl-dev:$CROSS_DEB_ARCH protobuf-compiler",
"apt-get update && apt-get --assume-yes install pkg-config libssl-dev:$CROSS_DEB_ARCH protobuf-compiler",
]

[target.aarch64-unknown-linux-gnu]
image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu:edge"
# add depency for reqwest that use openssl and protobuf for celestia
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get --assume-yes install libssl-dev:$CROSS_DEB_ARCH protobuf-compiler",
]
"apt-get update && apt-get --assume-yes install pkg-config libssl-dev:$CROSS_DEB_ARCH protobuf-compiler",
]
2 changes: 2 additions & 0 deletions decode-batch/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build]
rustflags = ["-C", "target-feature=+crt-static"]
3 changes: 3 additions & 0 deletions tripa/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[env]
RUST_TEST_THREADS = "1"

[build]
rustflags = ["-C", "target-feature=+crt-static"]
stskeeps marked this conversation as resolved.
Show resolved Hide resolved