[libcxx-commits] [libcxx] a9ddb77 - [libc++][CI] Prepares building C++ modules.
Mark de Wever via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Apr 11 09:43:05 PDT 2023
Author: Mark de Wever
Date: 2023-04-11T18:42:53+02:00
New Revision: a9ddb772453316c7cc792d9f8518cb85fabc131e
URL: https://github.com/llvm/llvm-project/commit/a9ddb772453316c7cc792d9f8518cb85fabc131e
DIFF: https://github.com/llvm/llvm-project/commit/a9ddb772453316c7cc792d9f8518cb85fabc131e.diff
LOG: [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
Added:
Modified:
libcxx/utils/ci/Dockerfile
Removed:
################################################################################
diff --git a/libcxx/utils/ci/Dockerfile b/libcxx/utils/ci/Dockerfile
index 4de0c809f8c9a..85d0ff17b2a84 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
More information about the libcxx-commits
mailing list