[ci] Use native arm runner instead of cross compiling (#509)

With Ubuntu arm Github runners now available for general availability
(see Github blogpost here
https://github.blog/changelog/2025-01-16-linux-arm64-hosted-runners-now-available-for-free-in-public-repositories-public-preview/
) there is no longer a need to use the Ubuntu x86 runner and cross
compile in the ci. This means you no longer need to skip building the
sysroot on the ci for this platform.
pull/515/head
mcbarton 7 months ago committed by GitHub
parent 30a64fd513
commit 10214e10af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -26,23 +26,7 @@ jobs:
os: ubuntu-24.04
- artifact: arm64-linux
os: ubuntu-24.04
rust_target: aarch64-unknown-linux-gnu
env:
# Don't build a sysroot for this cross-compiled target since it
# would require a host compiler and the sysroot is otherwise
# already built on other CI builders.
WASI_SDK_CI_SKIP_SYSROOT: 1
WASI_SDK_CI_TOOLCHAIN_LLVM_CMAKE_ARGS: >-
-DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc
-DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++
-DCMAKE_CROSSCOMPILING=True
-DCMAKE_CXX_FLAGS=-march=armv8-a
-DCMAKE_SYSTEM_PROCESSOR=arm64
-DCMAKE_SYSTEM_NAME=Linux
-DLLVM_HOST_TRIPLE=aarch64-linux-gnu
-DRUST_TARGET=aarch64-unknown-linux-gnu
os: ubuntu-22.04-arm
- artifact: arm64-macos
os: macos-14

@ -1,8 +1,7 @@
#!/bin/sh
# This is a helper script invoked from CI which will execute the `ci/build.sh`
# script within a docker container. This builds `ci/docker/Dockerfile.common`
# along with the specified `ci/docker/Dockerfile.$x` from the command line.
# script within a docker container. This contain is built using the Dockerfile located at `ci/docker/Dockerfile`
# This container is then used to execute `ci/build.sh`.
set -e
@ -16,17 +15,8 @@ fi
set -x
# Build the base image which the image below can used.
docker build \
--file ci/docker/Dockerfile.common \
--tag wasi-sdk-builder-base \
ci/docker
# Build the container that is going to be used
docker build \
--file ci/docker/Dockerfile.$1 \
--tag wasi-sdk-builder \
ci/docker
# Build the Docker imager
docker build --tag wasi-sdk-builder ci/docker
# Perform the build in `/src`. The current directory is mounted read-write at
# this location as well. To ensure that container-created files are reasonable

@ -19,17 +19,20 @@ RUN apt-get update \
# Install a more recent version of CMake than what 18.04 has since that's what
# LLVM requires.
RUN curl -sSLO https://github.com/Kitware/CMake/releases/download/v3.29.5/cmake-3.29.5-linux-x86_64.tar.gz \
&& tar xf cmake-3.29.5-linux-x86_64.tar.gz \
&& rm cmake-3.29.5-linux-x86_64.tar.gz \
RUN ARCH=$(uname -m) \
&& curl -sSLO https://github.com/Kitware/CMake/releases/download/v3.29.5/cmake-3.29.5-linux-${ARCH}.tar.gz \
&& tar xf cmake-3.29.5-linux-${ARCH}.tar.gz \
&& rm cmake-3.29.5-linux-${ARCH}.tar.gz \
&& mkdir -p /opt \
&& mv cmake-3.29.5-linux-x86_64 /opt/cmake
&& mv cmake-3.29.5-linux-${ARCH} /opt/cmake
ENV PATH /opt/cmake/bin:$PATH
# As with CMake install a later version of Ninja than waht 18.04 has.
RUN curl -sSLO https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-linux.zip \
&& unzip ninja-linux.zip \
RUN ARCH=$(uname -m) \
&& if [ "$ARCH" = "aarch64" ]; then SUFFIX=-aarch64; fi \
&& curl -sSL -o ninja.zip https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-linux${SUFFIX}.zip \
&& unzip ninja.zip \
&& rm *.zip \
&& mv ninja /opt/cmake/bin

@ -1,11 +0,0 @@
FROM wasi-sdk-builder-base
# Install an extra C++ toolchain which can target arm64 linux.
RUN apt-get install -y g++-aarch64-linux-gnu
# Configure Rust to use this new compiler for linking Rust executables.
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER aarch64-linux-gnu-gcc
# Note that `.github/workflows/main.yml` sets various bits and bobs of
# configuration and cmake flags that may get passed to the underlying build. For
# example LLVM is instructed to use the toolchain installed above.

@ -1,7 +0,0 @@
FROM wasi-sdk-builder-base
# No extra configuration necessary for x86_64 over what `Dockerfile.common`
# already has.
#
# Note though that `.github/workflows/main.yml` still sets various bits and bobs
# of configuration and cmake flags that may get passed to the underlying build.
Loading…
Cancel
Save