Skip to content

Commit 10214e1

Browse files
authored
[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.
1 parent 30a64fd commit 10214e1

File tree

5 files changed

+13
-54
lines changed

5 files changed

+13
-54
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,7 @@ jobs:
2626
os: ubuntu-24.04
2727

2828
- artifact: arm64-linux
29-
os: ubuntu-24.04
30-
rust_target: aarch64-unknown-linux-gnu
31-
env:
32-
# Don't build a sysroot for this cross-compiled target since it
33-
# would require a host compiler and the sysroot is otherwise
34-
# already built on other CI builders.
35-
WASI_SDK_CI_SKIP_SYSROOT: 1
36-
37-
WASI_SDK_CI_TOOLCHAIN_LLVM_CMAKE_ARGS: >-
38-
-DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc
39-
-DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++
40-
-DCMAKE_CROSSCOMPILING=True
41-
-DCMAKE_CXX_FLAGS=-march=armv8-a
42-
-DCMAKE_SYSTEM_PROCESSOR=arm64
43-
-DCMAKE_SYSTEM_NAME=Linux
44-
-DLLVM_HOST_TRIPLE=aarch64-linux-gnu
45-
-DRUST_TARGET=aarch64-unknown-linux-gnu
29+
os: ubuntu-22.04-arm
4630

4731
- artifact: arm64-macos
4832
os: macos-14

ci/docker-build.sh

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#!/bin/sh
22

33
# This is a helper script invoked from CI which will execute the `ci/build.sh`
4-
# script within a docker container. This builds `ci/docker/Dockerfile.common`
5-
# along with the specified `ci/docker/Dockerfile.$x` from the command line.
4+
# script within a docker container. This contain is built using the Dockerfile located at `ci/docker/Dockerfile`
65
# This container is then used to execute `ci/build.sh`.
76

87
set -e
@@ -16,17 +15,8 @@ fi
1615

1716
set -x
1817

19-
# Build the base image which the image below can used.
20-
docker build \
21-
--file ci/docker/Dockerfile.common \
22-
--tag wasi-sdk-builder-base \
23-
ci/docker
24-
25-
# Build the container that is going to be used
26-
docker build \
27-
--file ci/docker/Dockerfile.$1 \
28-
--tag wasi-sdk-builder \
29-
ci/docker
18+
# Build the Docker imager
19+
docker build --tag wasi-sdk-builder ci/docker
3020

3121
# Perform the build in `/src`. The current directory is mounted read-write at
3222
# this location as well. To ensure that container-created files are reasonable

ci/docker/Dockerfile.common renamed to ci/docker/Dockerfile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,20 @@ RUN apt-get update \
1919

2020
# Install a more recent version of CMake than what 18.04 has since that's what
2121
# LLVM requires.
22-
RUN curl -sSLO https://github.com/Kitware/CMake/releases/download/v3.29.5/cmake-3.29.5-linux-x86_64.tar.gz \
23-
&& tar xf cmake-3.29.5-linux-x86_64.tar.gz \
24-
&& rm cmake-3.29.5-linux-x86_64.tar.gz \
22+
RUN ARCH=$(uname -m) \
23+
&& curl -sSLO https://github.com/Kitware/CMake/releases/download/v3.29.5/cmake-3.29.5-linux-${ARCH}.tar.gz \
24+
&& tar xf cmake-3.29.5-linux-${ARCH}.tar.gz \
25+
&& rm cmake-3.29.5-linux-${ARCH}.tar.gz \
2526
&& mkdir -p /opt \
26-
&& mv cmake-3.29.5-linux-x86_64 /opt/cmake
27+
&& mv cmake-3.29.5-linux-${ARCH} /opt/cmake
2728

2829
ENV PATH /opt/cmake/bin:$PATH
2930

3031
# As with CMake install a later version of Ninja than waht 18.04 has.
31-
RUN curl -sSLO https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-linux.zip \
32-
&& unzip ninja-linux.zip \
32+
RUN ARCH=$(uname -m) \
33+
&& if [ "$ARCH" = "aarch64" ]; then SUFFIX=-aarch64; fi \
34+
&& curl -sSL -o ninja.zip https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-linux${SUFFIX}.zip \
35+
&& unzip ninja.zip \
3336
&& rm *.zip \
3437
&& mv ninja /opt/cmake/bin
3538

ci/docker/Dockerfile.arm64-linux

Lines changed: 0 additions & 11 deletions
This file was deleted.

ci/docker/Dockerfile.x86_64-linux

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)