Skip to content

Commit

Permalink
Install newer ninja-build in the Amazon Linux 2 Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
kateinoigakukun committed Aug 10, 2024
1 parent 0abcf7f commit c3ba3f7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
5 changes: 1 addition & 4 deletions swift-ci/main/amazon-linux/2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ RUN yum -y install \
wget \
which

# Install ninja-build to save build-time
RUN yum -y install ninja-build && ln -s /usr/bin/ninja-build /usr/bin/ninja

RUN mkdir -p /usr/local/lib/python3.7/site-packages/

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


COPY ./swift-ci/main/install-extra-packages.sh /tmp/install-extra-packages.sh
RUN /tmp/install-extra-packages.sh cmake sccache && rm /tmp/install-extra-packages.sh
RUN /tmp/install-extra-packages.sh cmake sccache ninja && rm /tmp/install-extra-packages.sh

USER build-user

Expand Down
12 changes: 11 additions & 1 deletion swift-ci/main/install-extra-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ install_wasmtime() {

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

install_ninja() {
local version="v1.11.1"
local workdir
workdir="$(mktemp -d)"
curl -L "https://github.com/ninja-build/ninja/archive/refs/tags/$version.tar.gz" | tar xz --strip-component=1
cmake -B "$workdir" -S . -DCMAKE_INSTALL_PREFIX="$PREFIX"
cmake --build "$workdir" --target install -- -j "$(nproc)"
}

# ./install-extra-packages.sh [package1] [package2] ...
# Install packages into $PREFIX (default: /usr/local)

Expand Down

0 comments on commit c3ba3f7

Please sign in to comment.