Skip to content

Commit

Permalink
try ubuntu 22.04 again
Browse files Browse the repository at this point in the history
  • Loading branch information
vnghia committed Aug 9, 2024
1 parent 3e6ef30 commit 5aaecc6
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ passthrough = [

[build]
pre-build = "ci/cross-pre-build.sh"


[target.aarch64-unknown-linux-gnu]
dockerfile = "ci/cross/Dockerfile.aarch64"
9 changes: 8 additions & 1 deletion ci/cross-pre-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
set -euxo pipefail

if [[ "$CROSS_TARGET" == "aarch64-unknown-linux-gnu" ]]; then
apt-get update && apt-get install --assume-yes libssl-dev build-essential

sed 's/^deb http/deb [arch=amd64] http/' -i '/etc/apt/sources.list'
echo 'deb [arch=arm64] http://archive.ubuntu.com/pub/ubuntu/ports jammy main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb [arch=arm64] http://archive.ubuntu.com/pub/ubuntu/ports jammy-updates main restricted universe multiverse' >> /etc/apt/sources.list
echo 'deb [arch=arm64] http://archive.ubuntu.com/pub/ubuntu/ports jammy-backports main restricted universe multiverse' >> /etc/apt/sources.list

dpkg --add-architecture $CROSS_DEB_ARCH
apt-get update && apt-get --assume-yes install libssl-dev:$CROSS_DEB_ARCH
apt-get update && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH pkg-config:$CROSS_DEB_ARCH
fi
14 changes: 14 additions & 0 deletions ci/cross/Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install --assume-yes --no-install-recommends \
g++-aarch64-linux-gnu \
libc6-dev-arm64-cross

ENV CROSS_TOOLCHAIN_PREFIX=aarch64-linux-gnu-
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER="$CROSS_TOOLCHAIN_PREFIX"gcc \
AR_aarch64_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"ar \
CC_aarch64_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"gcc \
CXX_aarch64_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"g++ \
RUST_TEST_THREADS=1 \
PKG_CONFIG_PATH="/usr/lib/aarch64-linux-gnu/pkgconfig/:${PKG_CONFIG_PATH}"

0 comments on commit 5aaecc6

Please sign in to comment.