Skip to content

Commit c3ba3f7

Browse files
Install newer ninja-build in the Amazon Linux 2 Dockerfile
1 parent 0abcf7f commit c3ba3f7

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

swift-ci/main/amazon-linux/2/Dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ RUN yum -y install \
4040
wget \
4141
which
4242

43-
# Install ninja-build to save build-time
44-
RUN yum -y install ninja-build && ln -s /usr/bin/ninja-build /usr/bin/ninja
45-
4643
RUN mkdir -p /usr/local/lib/python3.7/site-packages/
4744

4845
RUN easy_install-3.7 six
@@ -92,7 +89,7 @@ ENV PATH="${SWIFT_PREFIX}/usr/bin:${PATH}"
9289

9390

9491
COPY ./swift-ci/main/install-extra-packages.sh /tmp/install-extra-packages.sh
95-
RUN /tmp/install-extra-packages.sh cmake sccache && rm /tmp/install-extra-packages.sh
92+
RUN /tmp/install-extra-packages.sh cmake sccache ninja && rm /tmp/install-extra-packages.sh
9693

9794
USER build-user
9895

swift-ci/main/install-extra-packages.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ install_wasmtime() {
88

99
install_cmake() {
1010
local version="3.29.7"
11-
local workdir="$(mktemp -d)"
11+
local workdir
12+
workdir="$(mktemp -d)"
1213
curl -L -o "$workdir/install_cmake.sh" "https://github.com/Kitware/CMake/releases/download/v$version/cmake-$version-linux-$(uname -m).sh"
1314
chmod +x "$workdir/install_cmake.sh"
1415
"$workdir/install_cmake.sh" --skip-license --prefix="$PREFIX"
@@ -26,6 +27,15 @@ install_sccache() {
2627
ln -sf "$PREFIX/sccache/sccache" "$PREFIX/bin/sccache"
2728
}
2829

30+
install_ninja() {
31+
local version="v1.11.1"
32+
local workdir
33+
workdir="$(mktemp -d)"
34+
curl -L "https://github.com/ninja-build/ninja/archive/refs/tags/$version.tar.gz" | tar xz --strip-component=1
35+
cmake -B "$workdir" -S . -DCMAKE_INSTALL_PREFIX="$PREFIX"
36+
cmake --build "$workdir" --target install -- -j "$(nproc)"
37+
}
38+
2939
# ./install-extra-packages.sh [package1] [package2] ...
3040
# Install packages into $PREFIX (default: /usr/local)
3141

0 commit comments

Comments
 (0)