Skip to content

Commit d5b8a8b

Browse files
[𝘀𝗽𝗿] changes to main this commit is based on
Created using spr 1.3.4 [skip ci]
1 parent 33fae08 commit d5b8a8b

18 files changed

+60
-55
lines changed

.ci/compute_projects.py

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@
5757
".ci": {"llvm", "clang", "lld", "lldb"},
5858
}
5959

60+
# This mapping describes runtimes that should be enabled for a specific project,
61+
# but not necessarily run for testing. The only case of this currently is lldb
62+
# which needs some runtimes enabled for tests.
63+
DEPENDENT_RUNTIMES_TO_BUILD = {"lldb": {"libcxx", "libcxxabi", "libunwind"}}
64+
65+
# This mapping describes runtimes that should be tested when the key project is
66+
# touched.
6067
DEPENDENT_RUNTIMES_TO_TEST = {"clang": {"libcxx", "libcxxabi", "libunwind"}}
6168

6269
EXCLUDE_LINUX = {
@@ -180,16 +187,20 @@ def _compute_project_check_targets(projects_to_test: Set[str]) -> Set[str]:
180187
def _compute_runtimes_to_test(projects_to_test: Set[str]) -> Set[str]:
181188
runtimes_to_test = set()
182189
for project_to_test in projects_to_test:
183-
if project_to_test not in DEPENDENT_RUNTIMES_TO_TEST:
184-
continue
185-
runtimes_to_test.update(DEPENDENT_RUNTIMES_TO_TEST[project_to_test])
190+
if project_to_test in DEPENDENT_RUNTIMES_TO_TEST:
191+
runtimes_to_test.update(DEPENDENT_RUNTIMES_TO_TEST[project_to_test])
192+
if project_to_test in DEPENDENT_RUNTIMES_TO_BUILD:
193+
runtimes_to_test.update(DEPENDENT_RUNTIMES_TO_BUILD[project_to_test])
186194
return runtimes_to_test
187195

188196

189-
def _compute_runtime_check_targets(runtimes_to_test: Set[str]) -> Set[str]:
197+
def _compute_runtime_check_targets(projects_to_test: Set[str]) -> Set[str]:
190198
check_targets = set()
191-
for runtime_to_test in runtimes_to_test:
192-
check_targets.add(PROJECT_CHECK_TARGETS[runtime_to_test])
199+
for project_to_test in projects_to_test:
200+
if project_to_test not in DEPENDENT_RUNTIMES_TO_TEST:
201+
continue
202+
for runtime_to_test in DEPENDENT_RUNTIMES_TO_TEST[project_to_test]:
203+
check_targets.add(PROJECT_CHECK_TARGETS[runtime_to_test])
193204
return check_targets
194205

195206

@@ -216,16 +227,16 @@ def get_env_variables(modified_files: list[str], platform: str) -> Set[str]:
216227
projects_to_test = _compute_projects_to_test(modified_projects, platform)
217228
projects_to_build = _compute_projects_to_build(projects_to_test)
218229
projects_check_targets = _compute_project_check_targets(projects_to_test)
219-
runtimes_to_test = _compute_runtimes_to_test(projects_to_test)
220-
runtimes_check_targets = _compute_runtime_check_targets(runtimes_to_test)
230+
runtimes_to_build = _compute_runtimes_to_test(projects_to_test)
231+
runtimes_check_targets = _compute_runtime_check_targets(projects_to_test)
221232
# We use a semicolon to separate the projects/runtimes as they get passed
222233
# to the CMake invocation and thus we need to use the CMake list separator
223234
# (;). We use spaces to separate the check targets as they end up getting
224235
# passed to ninja.
225236
return {
226237
"projects_to_build": ";".join(sorted(projects_to_build)),
227238
"project_check_targets": " ".join(sorted(projects_check_targets)),
228-
"runtimes_to_build": ";".join(sorted(runtimes_to_test)),
239+
"runtimes_to_build": ";".join(sorted(runtimes_to_build)),
229240
"runtimes_check_targets": " ".join(sorted(runtimes_check_targets)),
230241
}
231242

.ci/compute_projects_test.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,17 @@ def test_ci(self):
205205
"check-cxx check-cxxabi check-unwind",
206206
)
207207

208+
def test_lldb(self):
209+
env_variables = compute_projects.get_env_variables(
210+
["lldb/CMakeLists.txt"], "Linux"
211+
)
212+
self.assertEqual(env_variables["projects_to_build"], "clang;lldb;llvm")
213+
self.assertEqual(env_variables["project_check_targets"], "check-lldb")
214+
self.assertEqual(
215+
env_variables["runtimes_to_build"], "libcxx;libcxxabi;libunwind"
216+
)
217+
self.assertEqual(env_variables["runtimes_check_targets"], "")
218+
208219

209220
if __name__ == "__main__":
210221
unittest.main()

.ci/monolithic-linux.sh

Lines changed: 14 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ trap at-exit EXIT
5555

5656
projects="${1}"
5757
targets="${2}"
58+
runtimes="${3}"
59+
runtime_targets="${4}"
5860

5961
lit_args="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-output-file-name --timeout=1200 --time-tests"
6062

@@ -70,7 +72,7 @@ export LLVM_SYMBOLIZER_PATH=`which llvm-symbolizer`
7072
# It will not be built unless it is used.
7173
cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
7274
-D LLVM_ENABLE_PROJECTS="${projects}" \
73-
-D LLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
75+
-D LLVM_ENABLE_RUNTIMES="${runtimes}" \
7476
-G Ninja \
7577
-D CMAKE_PREFIX_PATH="${HOME}/.local" \
7678
-D CMAKE_BUILD_TYPE=Release \
@@ -91,62 +93,28 @@ echo "--- ninja"
9193
# Targets are not escaped as they are passed as separate arguments.
9294
ninja -C "${BUILD_DIR}" -k 0 ${targets}
9395

94-
runtimes="${3}"
95-
runtime_targets="${4}"
96-
9796
# Compiling runtimes with just-built Clang and running their tests
9897
# as an additional testing for Clang.
99-
if [[ "${runtimes}" != "" ]]; then
100-
if [[ "${runtime_targets}" == "" ]]; then
101-
echo "Runtimes to build are specified, but targets are not."
102-
exit 1
103-
fi
104-
105-
echo "--- ninja install-clang"
106-
107-
ninja -C ${BUILD_DIR} install-clang install-clang-resource-headers
108-
109-
RUNTIMES_BUILD_DIR="${MONOREPO_ROOT}/build-runtimes"
110-
INSTALL_DIR="${BUILD_DIR}/install"
111-
mkdir -p ${RUNTIMES_BUILD_DIR}
112-
98+
if [[ "${runtimes_targets}" != "" ]]; then
11399
echo "--- cmake runtimes C++26"
114100

115-
rm -rf "${RUNTIMES_BUILD_DIR}"
116-
cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \
117-
-D CMAKE_C_COMPILER="${INSTALL_DIR}/bin/clang" \
118-
-D CMAKE_CXX_COMPILER="${INSTALL_DIR}/bin/clang++" \
119-
-D LLVM_ENABLE_RUNTIMES="${runtimes}" \
120-
-D LIBCXX_CXX_ABI=libcxxabi \
121-
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
122-
-D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
123-
-D LIBCXX_TEST_PARAMS="std=c++26" \
124-
-D LIBCXXABI_TEST_PARAMS="std=c++26" \
125-
-D LLVM_LIT_ARGS="${lit_args}"
101+
cmake \
102+
-D LIBCXX_TEST_PARAMS="std=c++26" \
103+
-D LIBCXXABI_TEST_PARAMS="std=c++26" \
104+
"${BUILD_DIR}"
126105

127106
echo "--- ninja runtimes C++26"
128107

129-
ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets}
108+
ninja -C "${BUILD_DIR}" ${runtime_targets}
130109

131110
echo "--- cmake runtimes clang modules"
132111

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

149117
echo "--- ninja runtimes clang modules"
150118

151-
ninja -vC "${RUNTIMES_BUILD_DIR}" ${runtime_targets}
119+
ninja -C "${BUILD_DIR}" ${runtime_targets}
152120
fi

libcxx/test/libcxx/containers/views/mdspan/extents/assert.conversion.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
// (((Extents != dynamic_extent) && (OtherExtents == dynamic_extent)) || ... ) ||
3131
// (numeric_limits<index_type>::max() < numeric_limits<OtherIndexType>::max())
3232

33+
#include <span> // dynamic_extent
3334
#include <mdspan>
3435
#include <cassert>
3536

libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_array.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
// for every rank index r.
3131
//
3232

33+
#include <span> // dynamic_extent
3334
#include <mdspan>
3435
#include <cassert>
3536

libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_integral.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
// - each element of exts is nonnegative and is representable as a value of type index_type.
3333
//
3434

35+
#include <span> // dynamic_extent
3536
#include <mdspan>
3637
#include <cassert>
3738

libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_span.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
// for every rank index r.
2929
//
3030

31+
#include <span> // dynamic_extent
3132
#include <mdspan>
3233
#include <cassert>
3334

libcxx/test/libcxx/containers/views/mdspan/extents/assert.obs.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
//
2525
// Returns: Di.
2626

27+
#include <span> // dynamic_extent
2728
#include <mdspan>
2829
#include <cassert>
2930

libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.conversion.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
//
2222
// Preconditions: other.required_span_size() is representable as a value of type index_type.
2323

24+
#include <span> // dynamic_extent
2425
#include <mdspan>
2526
#include <cassert>
2627

libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.extents.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
//
2020
// Effects: Direct-non-list-initializes extents_ with e.
2121

22+
#include <span> // dynamic_extent
2223
#include <mdspan>
2324
#include <cassert>
2425

0 commit comments

Comments
 (0)