summaryrefslogtreecommitdiff
path: root/libcxx/utils
diff options
context:
space:
mode:
authorMark de Wever <koraq@xs4all.nl>2023-03-15 08:07:05 +0100
committerMark de Wever <koraq@xs4all.nl>2023-04-11 18:42:53 +0200
commita9ddb772453316c7cc792d9f8518cb85fabc131e (patch)
tree2a0c133503e3c94f271e83fe3d5bd81dd1cd0a85 /libcxx/utils
parent51f0b809ca76c3cb037ea1195253af48f9d212e2 (diff)
downloadllvm-a9ddb772453316c7cc792d9f8518cb85fabc131e.tar.gz
[libc++][CI] Prepares building C++ modules.
D144994 adds modules to libc++. In order to test them some newer and additional tools are required. CMake 3.26 This is in combination with Clang 16 or newer makes it possible to conveniently build modules with CMake. Unfortunately CMake 3.26 in our setup has an issue with unused linker flags. This causes libunwind not to compile at all. D145596 contains a quick-fix which is in the module patch. The patch D142957 and followups will contain a proper fix. Therefore install CMake 3.26 in a separate location, allowing to test the module patch in the CI. Ninja 1.11 Building modules requires dynamic rules, which requires this version. This is a CMake 3.26 requirement to use modules. Note that without using modules CMake still accepts older Ninja versions. clang-scan-deps (in the tools package) This tool is used by CMake to get the module dependencies. Note strictly this currently will only be used for Clang 16 and Clang 17. Clang 15 and Clang 14 are not needed. They are installed to keep updating to Clang 18 and later easier. (In the future we might not test modular build with all Clang versions, however at the moment the feature is still in development in both Clang and libc++ so it would be good to detect regressions.) Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D146822
Diffstat (limited to 'libcxx/utils')
-rw-r--r--libcxx/utils/ci/Dockerfile20
1 files changed, 19 insertions, 1 deletions
diff --git a/libcxx/utils/ci/Dockerfile b/libcxx/utils/ci/Dockerfile
index 4de0c809f8c9..85d0ff17b2a8 100644
--- a/libcxx/utils/ci/Dockerfile
+++ b/libcxx/utils/ci/Dockerfile
@@ -38,7 +38,13 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y bash curl
# Install various tools used by the build or the test suite
-RUN apt-get update && apt-get install -y ninja-build python3 python3-sphinx python3-distutils python3-psutil git gdb
+#RUN apt-get update && apt-get install -y ninja-build python3 python3-sphinx python3-distutils python3-psutil git gdb
+# TODO add ninja-build once 1.11 is available in Ubuntu, also remove the manual installation.
+RUN apt-get update && apt-get install -y python3 python3-sphinx python3-distutils python3-psutil git gdb
+RUN apt-get update && apt-get install -y wget && \
+ wget -qO /usr/local/bin/ninja.gz https://github.com/ninja-build/ninja/releases/latest/download/ninja-linux.zip && \
+ gunzip /usr/local/bin/ninja.gz && \
+ chmod a+x /usr/local/bin/ninja
# Install dependencies required to run the LLDB data formatter tests
RUN apt-get update && apt-get install -y python3 python3-dev libpython3-dev uuid-dev libncurses5-dev swig3.0 libxml2-dev libedit-dev
@@ -68,6 +74,12 @@ RUN bash /tmp/llvm.sh $(($LLVM_HEAD_VERSION - 2)) # previous release
RUN bash /tmp/llvm.sh $(($LLVM_HEAD_VERSION - 1)) # latest release
RUN bash /tmp/llvm.sh $LLVM_HEAD_VERSION # current ToT
+# Install clang-scan-deps, which is required to build modules; always all supported versions.
+RUN apt-get update && apt-get install -y clang-tools-$(($LLVM_HEAD_VERSION - 3)) \
+ clang-tools-$(($LLVM_HEAD_VERSION - 2)) \
+ clang-tools-$(($LLVM_HEAD_VERSION - 1)) \
+ clang-tools-$LLVM_HEAD_VERSION
+
# Install clang-format; always use the lastest stable branch.
RUN apt-get update && apt-get install -y clang-format-$(($LLVM_HEAD_VERSION - 2)) clang-format-$(($LLVM_HEAD_VERSION - 1))
@@ -91,6 +103,12 @@ RUN wget https://github.com/Kitware/CMake/releases/download/v3.21.1/cmake-3.21.1
RUN bash /tmp/install-cmake.sh --prefix=/usr --exclude-subdir --skip-license
RUN rm /tmp/install-cmake.sh
+# Install a newer CMake for modules
+# TODO Remove the duplicated installation when all runtimes can be build with CMake 3.26.
+RUN wget https://github.com/Kitware/CMake/releases/download/v3.26.1/cmake-3.26.1-linux-x86_64.sh -O /tmp/install-cmake.sh
+RUN bash /tmp/install-cmake.sh --prefix=/opt --exclude-subdir --skip-license
+RUN rm /tmp/install-cmake.sh
+
# Change the user to a non-root user, since some of the libc++ tests
# (e.g. filesystem) require running as non-root. Also setup passwordless sudo.
RUN apt-get update && apt-get install -y sudo