Skip to content

Commit cb827a1

Browse files
committed
[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.
1 parent cfb1035 commit cb827a1

File tree

1 file changed

+14
-39
lines changed

1 file changed

+14
-39
lines changed

.ci/monolithic-linux.sh

Lines changed: 14 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ set -o pipefail
1818

1919
MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}"
2020
BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build}"
21-
INSTALL_DIR="${BUILD_DIR}/install"
2221
rm -rf "${BUILD_DIR}"
2322

2423
ccache --zero-stats
@@ -81,69 +80,45 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
8180
-D LIBCXX_CXX_ABI=libcxxabi \
8281
-D MLIR_ENABLE_BINDINGS_PYTHON=ON \
8382
-D LLDB_ENABLE_PYTHON=ON \
84-
-D LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS=ON \
85-
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}"
83+
-D LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS=ON
8684

8785
echo "--- ninja"
86+
8887
# Targets are not escaped as they are passed as separate arguments.
8988
ninja -C "${BUILD_DIR}" -k 0 ${targets}
9089

9190
runtimes="${3}"
9291
runtime_targets="${4}"
9392

94-
# Compiling runtimes with just-built Clang and running their tests
95-
# as an additional testing for Clang.
93+
# Run runtimes tests.
94+
# We don't need to do a clean separate build of runtimes, because runtimes
95+
# will be built against just built clang, and because LIBCXX_TEST_PARAMS
96+
# and LIBCXXABI_TEST_PARAMS only affect lit configuration, which successfully
97+
# propagates without a clean build. Other that those two variables, builds
98+
# are supposed to be the same.
9699
if [[ "${runtimes}" != "" ]]; then
97100
if [[ "${runtime_targets}" == "" ]]; then
98101
echo "Runtimes to build are specified, but targets are not."
99102
exit 1
100103
fi
101104

102-
echo "--- ninja install-clang"
103-
104-
ninja -C ${BUILD_DIR} install-clang install-clang-resource-headers
105-
106-
RUNTIMES_BUILD_DIR="${MONOREPO_ROOT}/build-runtimes"
107-
INSTALL_DIR="${BUILD_DIR}/install"
108-
mkdir -p ${RUNTIMES_BUILD_DIR}
109-
110105
echo "--- cmake runtimes C++26"
111106

112-
rm -rf "${RUNTIMES_BUILD_DIR}"
113-
cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \
114-
-D CMAKE_C_COMPILER="${INSTALL_DIR}/bin/clang" \
115-
-D CMAKE_CXX_COMPILER="${INSTALL_DIR}/bin/clang++" \
116-
-D LLVM_ENABLE_RUNTIMES="${runtimes}" \
117-
-D LIBCXX_CXX_ABI=libcxxabi \
118-
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
119-
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
107+
cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
120108
-D LIBCXX_TEST_PARAMS="std=c++26" \
121-
-D LIBCXXABI_TEST_PARAMS="std=c++26" \
122-
-D LLVM_LIT_ARGS="${lit_args}"
109+
-D LIBCXXABI_TEST_PARAMS="std=c++26"
123110

124111
echo "--- ninja runtimes C++26"
125112

126-
ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets}
113+
ninja -vC "${BUILD_DIR}" ${runtime_targets}
127114

128115
echo "--- cmake runtimes clang modules"
129116

130-
# We don't need to do a clean build of runtimes, because LIBCXX_TEST_PARAMS
131-
# and LIBCXXABI_TEST_PARAMS only affect lit configuration, which successfully
132-
# propagates without a clean build. Other that those two variables, builds
133-
# are supposed to be the same.
134-
135-
cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \
136-
-D CMAKE_C_COMPILER="${INSTALL_DIR}/bin/clang" \
137-
-D CMAKE_CXX_COMPILER="${INSTALL_DIR}/bin/clang++" \
138-
-D LLVM_ENABLE_RUNTIMES="${runtimes}" \
139-
-D LIBCXX_CXX_ABI=libcxxabi \
140-
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
141-
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
117+
cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
142118
-D LIBCXX_TEST_PARAMS="enable_modules=clang" \
143-
-D LIBCXXABI_TEST_PARAMS="enable_modules=clang" \
144-
-D LLVM_LIT_ARGS="${lit_args}"
119+
-D LIBCXXABI_TEST_PARAMS="enable_modules=clang"
145120

146121
echo "--- ninja runtimes clang modules"
147122

148-
ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets}
123+
ninja -vC "${BUILD_DIR}" ${runtime_targets}
149124
fi

0 commit comments

Comments
 (0)