diff --git a/libcxx/utils/ci/Dockerfile b/libcxx/utils/ci/Dockerfile --- a/libcxx/utils/ci/Dockerfile +++ b/libcxx/utils/ci/Dockerfile @@ -70,6 +70,10 @@ RUN ln -s /usr/bin/clang-format-$LLVM_LATEST_VERSION /usr/bin/clang-format && [ -e $(readlink /usr/bin/clang-format) ] RUN ln -s /usr/bin/git-clang-format-$LLVM_LATEST_VERSION /usr/bin/git-clang-format && [ -e $(readlink /usr/bin/git-clang-format) ] +# Install clang-tidy +RUN apt-get install -y clang-tidy-$LLVM_LATEST_VERSION +RUN ln -s /usr/bin/clang-tidy-$LLVM_LATEST_VERSION /usr/bin/clang-tidy && [ -e $(readlink /usr/bin/clang-tidy) ] + # Install the most recent GCC ENV GCC_LATEST_VERSION=11 RUN add-apt-repository ppa:ubuntu-toolchain-r/test diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot --- a/libcxx/utils/ci/run-buildbot +++ b/libcxx/utils/ci/run-buildbot @@ -94,6 +94,10 @@ "${@}" } +function create-db-symlink() { + ln -s ${BUILD_DIR}/compile_commands.json . +} + function generate-cmake-libcxx-win() { # TODO: Clang-cl in MSVC configurations don't have access to compiler_rt # builtins helpers for int128 division. See @@ -193,6 +197,7 @@ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx03.cmake" \ -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + create-db-symlink check-runtimes check-abi-list ;; @@ -201,6 +206,7 @@ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \ -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + create-db-symlink check-runtimes check-abi-list ;; @@ -209,6 +215,7 @@ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx14.cmake" \ -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + create-db-symlink check-runtimes check-abi-list ;; @@ -217,6 +224,7 @@ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx17.cmake" \ -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + create-db-symlink check-runtimes check-abi-list ;; @@ -225,6 +233,7 @@ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx20.cmake" \ -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + create-db-symlink check-runtimes check-abi-list ;; @@ -233,6 +242,7 @@ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx2b.cmake" \ -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + create-db-symlink check-runtimes check-abi-list ;; @@ -241,6 +251,7 @@ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-assertions.cmake" \ -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + create-db-symlink check-runtimes check-abi-list ;; @@ -249,6 +260,7 @@ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-debug-iterators.cmake" \ -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + create-db-symlink check-runtimes check-abi-list ;; @@ -257,6 +269,7 @@ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-noexceptions.cmake" \ -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + create-db-symlink check-runtimes ;; generic-modules) @@ -295,6 +308,7 @@ clean generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared-gcc.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + create-db-symlink check-runtimes ;; generic-gcc-cxx11) @@ -304,6 +318,7 @@ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \ -DLIBCXX_TEST_CONFIG="llvm-libc++-shared-gcc.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + create-db-symlink check-runtimes ;; generic-asan) @@ -404,6 +419,7 @@ --sdk "macosx" \ --architectures "${arch}" \ --version "999.99" + create-db-symlink # TODO: It would be better to run the tests against the fake-installed version of libc++ instead xcrun --sdk macosx ninja -vC "${BUILD_DIR}/${arch}" check-cxx check-cxxabi @@ -435,7 +451,7 @@ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \ -DLIBCXX_TEST_PARAMS="${PARAMS}" \ -DLIBCXXABI_TEST_PARAMS="${PARAMS}" - + create-db-symlink check-runtimes ;; benchmarks) @@ -548,6 +564,7 @@ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \ -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + create-db-symlink check-runtimes ;; aarch64-noexceptions) @@ -557,6 +574,7 @@ -DLIBCXXABI_ENABLE_EXCEPTIONS=OFF \ -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + create-db-symlink check-runtimes ;; # Aka Armv8 32 bit @@ -565,6 +583,7 @@ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Arm.cmake" \ -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + create-db-symlink check-runtimes ;; armv8-noexceptions) @@ -572,6 +591,7 @@ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Thumb-noexceptions.cmake" \ -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + create-db-symlink check-runtimes ;; # Armv7 32 bit. One building Arm only one Thumb only code. @@ -580,6 +600,7 @@ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Arm.cmake" \ -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + create-db-symlink check-runtimes ;; armv7-noexceptions) @@ -587,6 +608,7 @@ generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Thumb-noexceptions.cmake" \ -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" + create-db-symlink check-runtimes ;; clang-cl-dll) @@ -599,6 +621,7 @@ # setting when cmake and the test driver does the right thing automatically. generate-cmake-libcxx-win -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF \ -DLIBCXX_TEST_CONFIG="llvm-libc++-shared-clangcl.cfg.in" + create-db-symlink echo "+++ Running the libc++ tests" ${NINJA} -vC "${BUILD_DIR}" check-cxx ;; @@ -606,6 +629,7 @@ clean generate-cmake-libcxx-win -DLIBCXX_ENABLE_SHARED=OFF \ -DLIBCXX_TEST_CONFIG="llvm-libc++-static-clangcl.cfg.in" + create-db-symlink echo "+++ Running the libc++ tests" ${NINJA} -vC "${BUILD_DIR}" check-cxx ;; @@ -644,6 +668,7 @@ -DLIBCXX_TEST_CONFIG="ibm-libc++-shared.cfg.in" \ -DLIBCXXABI_TEST_CONFIG="ibm-libc++abi-shared.cfg.in" \ -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" + create-db-symlink # TODO: use check-runtimes once libunwind builds cleanly on AIX. ${NINJA} -vC "${BUILD_DIR}" install-cxx install-cxxabi ${NINJA} -vC "${BUILD_DIR}" check-cxx check-cxxabi