Skip to content

Commit

Permalink
fix(ci): correct ARM64 builds (#4876)
Browse files Browse the repository at this point in the history
Description:
Remove selective hack that reverted resolver from 1 to 2. Fix ARM64 builds by removing env overrides in Cross.toml breaking openssl-sys

Motivation and Context:
Make ARM64 builds standard

How Has This Been Tested?
Build test in locally and in local fork
  • Loading branch information
leet4tari authored Nov 4, 2022
1 parent c0d1f58 commit 7628692
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 13 deletions.
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/",
]

0 comments on commit 7628692

Please sign in to comment.