Skip to content

Commit

Permalink
[ci] Use native arm runner instead of cross compiling (#509)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mcbarton authored Feb 8, 2025
1 parent 30a64fd commit 10214e1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 54 deletions.
18 changes: 1 addition & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 3 additions & 13 deletions ci/docker-build.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
15 changes: 9 additions & 6 deletions ci/docker/Dockerfile.common → ci/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 0 additions & 11 deletions ci/docker/Dockerfile.arm64-linux

This file was deleted.

7 changes: 0 additions & 7 deletions ci/docker/Dockerfile.x86_64-linux

This file was deleted.

0 comments on commit 10214e1

Please sign in to comment.