https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/136162
They will be built with the just built clang either way. This avoids building the runtimes twice when LLDB is also tested. >From cb827a1a19380f47213e5f2bafc32a5a8a9f32fe Mon Sep 17 00:00:00 2001 From: Matheus Izvekov <mizve...@gmail.com> Date: Thu, 17 Apr 2025 13:45:09 -0300 Subject: [PATCH] [ci] skip clang installation and separate configuration for runtimes. They will be built with the just built clang either way. This avoids building the runtimes twice when LLDB is also tested. --- .ci/monolithic-linux.sh | 53 +++++++++++------------------------------ 1 file changed, 14 insertions(+), 39 deletions(-) diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh index 2e4b4e6118efd..1fa72bdcd066d 100755 --- a/.ci/monolithic-linux.sh +++ b/.ci/monolithic-linux.sh @@ -18,7 +18,6 @@ set -o pipefail MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}" BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build}" -INSTALL_DIR="${BUILD_DIR}/install" rm -rf "${BUILD_DIR}" ccache --zero-stats @@ -81,69 +80,45 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \ -D LIBCXX_CXX_ABI=libcxxabi \ -D MLIR_ENABLE_BINDINGS_PYTHON=ON \ -D LLDB_ENABLE_PYTHON=ON \ - -D LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS=ON \ - -D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" + -D LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS=ON echo "--- ninja" + # Targets are not escaped as they are passed as separate arguments. ninja -C "${BUILD_DIR}" -k 0 ${targets} runtimes="${3}" runtime_targets="${4}" -# Compiling runtimes with just-built Clang and running their tests -# as an additional testing for Clang. +# Run runtimes tests. +# We don't need to do a clean separate build of runtimes, because runtimes +# will be built against just built clang, and because LIBCXX_TEST_PARAMS +# and LIBCXXABI_TEST_PARAMS only affect lit configuration, which successfully +# propagates without a clean build. Other that those two variables, builds +# are supposed to be the same. if [[ "${runtimes}" != "" ]]; then if [[ "${runtime_targets}" == "" ]]; then echo "Runtimes to build are specified, but targets are not." exit 1 fi - echo "--- ninja install-clang" - - ninja -C ${BUILD_DIR} install-clang install-clang-resource-headers - - RUNTIMES_BUILD_DIR="${MONOREPO_ROOT}/build-runtimes" - INSTALL_DIR="${BUILD_DIR}/install" - mkdir -p ${RUNTIMES_BUILD_DIR} - echo "--- cmake runtimes C++26" - rm -rf "${RUNTIMES_BUILD_DIR}" - cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ - -D CMAKE_C_COMPILER="${INSTALL_DIR}/bin/clang" \ - -D CMAKE_CXX_COMPILER="${INSTALL_DIR}/bin/clang++" \ - -D LLVM_ENABLE_RUNTIMES="${runtimes}" \ - -D LIBCXX_CXX_ABI=libcxxabi \ - -D CMAKE_BUILD_TYPE=RelWithDebInfo \ - -D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \ -D LIBCXX_TEST_PARAMS="std=c++26" \ - -D LIBCXXABI_TEST_PARAMS="std=c++26" \ - -D LLVM_LIT_ARGS="${lit_args}" + -D LIBCXXABI_TEST_PARAMS="std=c++26" echo "--- ninja runtimes C++26" - ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets} + ninja -vC "${BUILD_DIR}" ${runtime_targets} echo "--- cmake runtimes clang modules" - # We don't need to do a clean build of runtimes, because LIBCXX_TEST_PARAMS - # and LIBCXXABI_TEST_PARAMS only affect lit configuration, which successfully - # propagates without a clean build. Other that those two variables, builds - # are supposed to be the same. - - cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \ - -D CMAKE_C_COMPILER="${INSTALL_DIR}/bin/clang" \ - -D CMAKE_CXX_COMPILER="${INSTALL_DIR}/bin/clang++" \ - -D LLVM_ENABLE_RUNTIMES="${runtimes}" \ - -D LIBCXX_CXX_ABI=libcxxabi \ - -D CMAKE_BUILD_TYPE=RelWithDebInfo \ - -D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ + cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \ -D LIBCXX_TEST_PARAMS="enable_modules=clang" \ - -D LIBCXXABI_TEST_PARAMS="enable_modules=clang" \ - -D LLVM_LIT_ARGS="${lit_args}" + -D LIBCXXABI_TEST_PARAMS="enable_modules=clang" echo "--- ninja runtimes clang modules" - ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets} + ninja -vC "${BUILD_DIR}" ${runtime_targets} fi _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits