Skip to content

Commit 2e3c763

Browse files
committed
ci: Build linux-aarch64 toolchains and host tools natively
This commit updates the CI workflow to build the linux-aarch64 toolchains and host tools natively on the ARM64 zephyr-runner in order to reduce build time and any complexities related to cross compilation. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent c8e0448 commit 2e3c763

File tree

1 file changed

+5
-36
lines changed

1 file changed

+5
-36
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ jobs:
223223
if [ "${build_host_linux_aarch64}" == "y" ]; then
224224
MATRIX_HOSTS+='{
225225
"name": "linux-aarch64",
226-
"runner": "zephyr-runner-linux-x64-4xlarge",
226+
"runner": "zephyr-runner-linux-arm64-4xlarge",
227227
"container": "ghcr.io/zephyrproject-rtos/sdk-build:v1.2.3",
228228
"archive": "tar.xz"
229229
},'
@@ -416,12 +416,7 @@ jobs:
416416
pkg-config texinfo p7zip
417417
418418
# Install dependencies for cross compilation
419-
if [ "${{ matrix.host.name }}" == "linux-aarch64" ]; then
420-
# Install aarch64-linux-gnu cross toolchain
421-
sudo apt-get install -y binutils-aarch64-linux-gnu \
422-
gcc-aarch64-linux-gnu \
423-
g++-aarch64-linux-gnu
424-
elif [ "${{ matrix.host.name }}" == "windows-x86_64" ]; then
419+
if [ "${{ matrix.host.name }}" == "windows-x86_64" ]; then
425420
# Install MinGW-w64 cross toolchain
426421
sudo apt-get install -y binutils-mingw-w64 gcc-mingw-w64 \
427422
g++-mingw-w64
@@ -634,13 +629,7 @@ jobs:
634629
EOF
635630
636631
# Set Canadian cross compilation configurations
637-
if [ "${{ matrix.host.name }}" == "linux-aarch64" ]; then
638-
# Building for linux-aarch64 on linux-x86_64
639-
cat <<EOF >> .config
640-
CT_CANADIAN=y
641-
CT_HOST="aarch64-linux-gnu"
642-
EOF
643-
elif [ "${{ matrix.host.name }}" == "macos-aarch64" ]; then
632+
if [ "${{ matrix.host.name }}" == "macos-aarch64" ]; then
644633
# Building for macos-aarch64 on macos-x86_64
645634
cat <<EOF >> .config
646635
CT_CANADIAN=y
@@ -660,18 +649,7 @@ jobs:
660649
CT_GDB_CROSS_PYTHON_VARIANT=y
661650
EOF
662651
663-
if [ "${{ matrix.host.name }}" == "linux-aarch64" ]; then
664-
# Clone crosskit-aarch64-linux-libpython cross compilation kit
665-
git clone \
666-
https://github.com/stephanosio/crosskit-aarch64-linux-libpython.git \
667-
${WORKSPACE}/crosskit-aarch64-linux-libpython
668-
# Use Python 3.8.0
669-
export LIBPYTHON_KIT_ROOT=${WORKSPACE}/crosskit-aarch64-linux-libpython/python-3.8.0
670-
# Set Python configuration resolver for GDB
671-
cat <<EOF >> .config
672-
CT_GDB_CROSS_PYTHON_BINARY="${LIBPYTHON_KIT_ROOT}/bin/python"
673-
EOF
674-
elif [ "${{ matrix.host.name }}" == "macos-aarch64" ]; then
652+
if [ "${{ matrix.host.name }}" == "macos-aarch64" ]; then
675653
# Clone crosskit-aarch64-darwin-libpython cross compilation kit
676654
git clone \
677655
https://github.com/stephanosio/crosskit-aarch64-darwin-libpython.git \
@@ -720,10 +698,7 @@ jobs:
720698
popd
721699
722700
# Resolve output directory path
723-
if [ "${{ matrix.host.name }}" == "linux-aarch64" ]; then
724-
OUTPUT_BASE="${WORKSPACE}/output"
725-
OUTPUT_DIR="HOST-aarch64-linux-gnu"
726-
elif [ "${{ matrix.host.name }}" == "macos-aarch64" ]; then
701+
if [ "${{ matrix.host.name }}" == "macos-aarch64" ]; then
727702
OUTPUT_BASE="${WORKSPACE}/output"
728703
OUTPUT_DIR="HOST-aarch64-apple-darwin"
729704
elif [ "${{ matrix.host.name }}" == "windows-x86_64" ]; then
@@ -903,12 +878,6 @@ jobs:
903878
# Patch Poky sanity configuration to allow building as root
904879
sed -i '/^INHERIT/ s/./#&/' poky/meta/conf/sanity.conf
905880
906-
# Resolve host machine type
907-
if [ "${{ matrix.host.name }}" == "linux-aarch64" ]; then
908-
# Cross compiling for AArch64 host on x86-64
909-
export MACHINE="aarch64"
910-
fi
911-
912881
# Build meta-zephyr-sdk
913882
${POKY_BASE}/scripts/meta-zephyr-sdk-build.sh tools
914883

0 commit comments

Comments
 (0)