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(ci): correct ARM64 builds #4876

Merged
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
7 changes: 1 addition & 6 deletions .github/workflows/base_node_binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,7 @@ jobs:
- name: Cache cargo files and outputs
uses: Swatinem/rust-cache@v1

- name: Revert Cargo.toml for Ubuntu to cross-compile ARM64
if: ${{ startsWith(runner.os,'Linux') && matrix.builds.name == 'linux-arm64' }}
run: sed -i-bak -e '/^resolver/s/2/1/' Cargo.toml

- name: Build rust binaries - Normal
#if: ${{ matrix.builds.name != 'linux-arm64' }}
- name: Build rust binaries
uses: actions-rs/cargo@v1
env:
RUSTFLAGS: "-C target_cpu=${{ matrix.builds.target_cpu }}"
Expand Down
40 changes: 33 additions & 7 deletions Cross.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,47 @@ passthrough = ["CFLAGS"]

[target.aarch64-unknown-linux-gnu]
image = "ubuntu:18.04"
pre-build = [
"apt-get update && apt-get install --assume-yes cmake gcc clang-10 pkg-config-aarch64-linux-gnu gcc-aarch64-linux-gnu g++-aarch64-linux-gnu && alias pkg-config=aarch64-linux-gnu-pkg-config"
]
# Mergered all scripts/install_ubuntu_dependencies*.sh scripts
pre-build = [ """
apt-get update && \
apt-get -y install \
openssl \
libssl-dev \
pkg-config \
libsqlite3-dev \
clang-10 \
git \
cmake \
dh-autoreconf \
libc++-dev \
libc++abi-dev \
libprotobuf-dev \
protobuf-compiler \
libncurses5-dev \
libncursesw5-dev \
zip \
curl \
pkg-config-aarch64-linux-gnu \
gcc-aarch64-linux-gnu \
g++-aarch64-linux-gnu && \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
export PATH="$HOME/.cargo/bin:$PATH" && \
rustup target add aarch64-unknown-linux-gnu && \
rustup toolchain install stable-aarch64-unknown-linux-gnu
""" ]

[target.aarch64-unknown-linux-gnu.env]
passthrough = [
"CFLAGS",
"RUST_DEBUG",
"RUSTFLAGS",
"ARCH",
"FEATURES",
"ROARING_ARCH",
"BUILD_TARGET=aarch64-unknown-linux-gnu/",
"RUST_TARGET=--target=aarch64-unknown-linux-gnu",
"TARGET",
"RUST_TARGET",
"BUILD_TARGET",
"CARGO_BUILD_TARGET",
"CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc",
"CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc",
"CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++",
"BINDGEN_EXTRA_CLANG_ARGS=--sysroot /usr/aarch64-linux-gnu/include/",
]