Skip to content

Commit d0af427

Browse files
committed
[libc++] Switch to the new testing configurations by default
We've been meaning to remove support for the legacy testing configuration for a long time. This patch switches the default from the legacy config to the appropriate new-style configuration based on a few hints. We've been running with the new-style configuration for more than a year in our CI, however it's possible that this will uncover issues with some users that run the tests on platforms that we don't support yet with the new-style configs. Unfortunately, there is no way to know about it other than to land this patch and see whether anything breaks. Differential Revision: https://reviews.llvm.org/D121632
1 parent 164c7af commit d0af427

File tree

3 files changed

+32
-48
lines changed

3 files changed

+32
-48
lines changed

libcxx/CMakeLists.txt

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,31 @@ option(LIBCXX_ENABLE_INCOMPLETE_FEATURES
137137
are new library features under development. These features don't guarantee
138138
ABI stability nor the quality of completed library features. Vendors
139139
shipping the library may want to disable this option." ON)
140-
set(LIBCXX_TEST_CONFIG "legacy.cfg.in" CACHE STRING
140+
141+
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
142+
set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-shared-gcc.cfg.in")
143+
elseif(MINGW)
144+
set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-mingw.cfg.in")
145+
elseif(WIN32) # clang-cl
146+
if (LIBCXX_ENABLE_SHARED)
147+
set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-shared-clangcl.cfg.in")
148+
else()
149+
set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-static-clangcl.cfg.in")
150+
endif()
151+
else()
152+
if (LIBCXX_ENABLE_SHARED)
153+
set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-shared.cfg.in")
154+
else()
155+
set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-static.cfg.in")
156+
endif()
157+
endif()
158+
set(LIBCXX_TEST_CONFIG "${LIBCXX_DEFAULT_TEST_CONFIG}" CACHE STRING
141159
"The path to the Lit testing configuration to use when running the tests.
142160
If a relative path is provided, it is assumed to be relative to '<monorepo>/libcxx/test/configs'.")
143161
if (NOT IS_ABSOLUTE "${LIBCXX_TEST_CONFIG}")
144162
set(LIBCXX_TEST_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/test/configs/${LIBCXX_TEST_CONFIG}")
145163
endif()
164+
message(STATUS "Using libc++ testing configuration: ${LIBCXX_TEST_CONFIG}")
146165
set(LIBCXX_TEST_PARAMS "" CACHE STRING
147166
"A list of parameters to run the Lit test suite with.")
148167

libcxx/docs/ReleaseNotes.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,9 @@ Build System Changes
106106
libc++abi already installs its headers in the right location. However, vendors building
107107
libc++ against alternate ABI libraries should make sure that their ABI library installs
108108
its own headers.
109+
110+
- The legacy testing configuration is now deprecated and will be removed in the next release. For
111+
most users, this should not have any impact. However, if you are testing libc++ in a configuration
112+
or on a platform that used to be supported by the legacy testing configuration and isn't supported
113+
by one of the configurations in ``libcxx/test/configs``, please reach out to the libc++ developers
114+
to get your configuration supported officially.

libcxx/utils/ci/run-buildbot

Lines changed: 6 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -192,114 +192,100 @@ check-generated-output)
192192
generic-cxx03)
193193
clean
194194
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx03.cmake" \
195-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
196195
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
197196
check-runtimes
198197
check-abi-list
199198
;;
200199
generic-cxx11)
201200
clean
202201
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \
203-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
204202
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
205203
check-runtimes
206204
check-abi-list
207205
;;
208206
generic-cxx14)
209207
clean
210208
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx14.cmake" \
211-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
212209
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
213210
check-runtimes
214211
check-abi-list
215212
;;
216213
generic-cxx17)
217214
clean
218215
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx17.cmake" \
219-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
220216
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
221217
check-runtimes
222218
check-abi-list
223219
;;
224220
generic-cxx20)
225221
clean
226222
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx20.cmake" \
227-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
228223
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
229224
check-runtimes
230225
check-abi-list
231226
;;
232227
generic-cxx2b)
233228
clean
234229
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx2b.cmake" \
235-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
236230
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
237231
check-runtimes
238232
check-abi-list
239233
;;
240234
generic-assertions)
241235
clean
242236
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-assertions.cmake" \
243-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
244237
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
245238
check-runtimes
246239
check-abi-list
247240
;;
248241
generic-debug-iterators)
249242
clean
250243
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-debug-iterators.cmake" \
251-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
252244
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
253245
check-runtimes
254246
check-abi-list
255247
;;
256248
generic-noexceptions)
257249
clean
258250
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-noexceptions.cmake" \
259-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
260251
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
261252
check-runtimes
262253
check-abi-list
263254
;;
264255
generic-modules)
265256
clean
266257
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake" \
267-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
268258
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
269259
check-runtimes
270260
check-abi-list
271261
;;
272262
generic-static)
273263
clean
274264
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-static.cmake" \
275-
-DLIBCXX_TEST_CONFIG="llvm-libc++-static.cfg.in" \
276265
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-static.cfg.in"
277266
check-runtimes
278267
;;
279268
generic-clang-13)
280269
export CC=clang-13
281270
export CXX=clang++-13
282271
clean
283-
generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
284-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
272+
generate-cmake -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
285273
check-runtimes
286274
check-abi-list
287275
;;
288276
generic-clang-14)
289277
export CC=clang-14
290278
export CXX=clang++-14
291279
clean
292-
generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
293-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
280+
generate-cmake -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
294281
check-runtimes
295282
check-abi-list
296283
;;
297284
generic-gcc)
298285
export CC=gcc-11
299286
export CXX=g++-11
300287
clean
301-
generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared-gcc.cfg.in" \
302-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" \
288+
generate-cmake -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" \
303289
-DLIBCXX_ENABLE_WERROR=NO
304290
check-runtimes
305291
;;
@@ -308,108 +294,93 @@ generic-gcc-cxx11)
308294
export CXX=g++-11
309295
clean
310296
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \
311-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared-gcc.cfg.in" \
312297
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in" \
313298
-DLIBCXX_ENABLE_WERROR=NO
314299
check-runtimes
315300
;;
316301
generic-asan)
317302
clean
318303
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-asan.cmake" \
319-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
320304
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
321305
check-runtimes
322306
;;
323307
generic-msan)
324308
clean
325309
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-msan.cmake" \
326-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
327310
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
328311
check-runtimes
329312
;;
330313
generic-tsan)
331314
clean
332315
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-tsan.cmake" \
333-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
334316
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
335317
check-runtimes
336318
;;
337319
generic-ubsan)
338320
clean
339321
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-ubsan.cmake" \
340-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
341322
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
342323
check-runtimes
343324
;;
344325
generic-with_llvm_unwinder)
345326
clean
346327
generate-cmake -DLIBCXXABI_USE_LLVM_UNWINDER=ON \
347-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
348328
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
349329
check-runtimes
350330
;;
351331
generic-singlethreaded)
352332
clean
353333
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-singlethreaded.cmake" \
354-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
355334
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
356335
check-runtimes
357336
;;
358337
generic-no-debug)
359338
clean
360339
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-debug.cmake" \
361-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
362340
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
363341
check-runtimes
364342
check-abi-list
365343
;;
366344
generic-no-filesystem)
367345
clean
368346
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-filesystem.cmake" \
369-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
370347
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
371348
check-runtimes
372349
;;
373350
generic-no-random_device)
374351
clean
375352
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-random_device.cmake" \
376-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
377353
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
378354
check-runtimes
379355
;;
380356
generic-no-localization)
381357
clean
382358
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-localization.cmake" \
383-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
384359
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
385360
check-runtimes
386361
;;
387362
generic-no-unicode)
388363
clean
389364
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-unicode.cmake" \
390-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
391365
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
392366
check-runtimes
393367
;;
394368
generic-no-wide-characters)
395369
clean
396370
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-wide-characters.cmake" \
397-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
398371
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
399372
check-runtimes
400373
;;
401374
generic-no-experimental)
402375
clean
403376
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-experimental.cmake" \
404-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
405377
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
406378
check-runtimes
407379
check-abi-list
408380
;;
409381
generic-abi-unstable)
410382
clean
411383
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-abi-unstable.cmake" \
412-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
413384
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
414385
check-runtimes
415386
;;
@@ -465,8 +436,7 @@ apple-system-backdeployment-*)
465436
;;
466437
benchmarks)
467438
clean
468-
generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
469-
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
439+
generate-cmake -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
470440
check-cxx-benchmarks
471441
;;
472442
documentation)
@@ -497,7 +467,6 @@ bootstrapping-build)
497467
-DRUNTIMES_BUILD_ALLOW_DARWIN=ON \
498468
-DLLVM_ENABLE_ASSERTIONS=ON \
499469
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake" \
500-
-DRUNTIMES_LIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
501470
-DRUNTIMES_LIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
502471

503472
echo "+++ Running the libc++ and libc++abi tests"
@@ -529,7 +498,6 @@ legacy-project-build)
529498
aarch64)
530499
clean
531500
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \
532-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
533501
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
534502
check-runtimes
535503
;;
@@ -538,37 +506,32 @@ aarch64-noexceptions)
538506
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \
539507
-DLIBCXX_ENABLE_EXCEPTIONS=OFF \
540508
-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF \
541-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
542509
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
543510
check-runtimes
544511
;;
545512
# Aka Armv8 32 bit
546513
armv8)
547514
clean
548515
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Arm.cmake" \
549-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
550516
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
551517
check-runtimes
552518
;;
553519
armv8-noexceptions)
554520
clean
555521
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Thumb-noexceptions.cmake" \
556-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
557522
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
558523
check-runtimes
559524
;;
560525
# Armv7 32 bit. One building Arm only one Thumb only code.
561526
armv7)
562527
clean
563528
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Arm.cmake" \
564-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
565529
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
566530
check-runtimes
567531
;;
568532
armv7-noexceptions)
569533
clean
570534
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Thumb-noexceptions.cmake" \
571-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
572535
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-shared.cfg.in"
573536
check-runtimes
574537
;;
@@ -580,15 +543,13 @@ clang-cl-dll)
580543
# correctly when libc++ visibility attributes indicate dllimport linkage
581544
# anyway), thus just disable the experimental library. Remove this
582545
# setting when cmake and the test driver does the right thing automatically.
583-
generate-cmake-libcxx-win -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF \
584-
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared-clangcl.cfg.in"
546+
generate-cmake-libcxx-win -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF
585547
echo "+++ Running the libc++ tests"
586548
${NINJA} -vC "${BUILD_DIR}" check-cxx
587549
;;
588550
clang-cl-static)
589551
clean
590-
generate-cmake-libcxx-win -DLIBCXX_ENABLE_SHARED=OFF \
591-
-DLIBCXX_TEST_CONFIG="llvm-libc++-static-clangcl.cfg.in"
552+
generate-cmake-libcxx-win -DLIBCXX_ENABLE_SHARED=OFF
592553
echo "+++ Running the libc++ tests"
593554
${NINJA} -vC "${BUILD_DIR}" check-cxx
594555
;;
@@ -602,7 +563,6 @@ mingw-dll)
602563
generate-cmake \
603564
-DCMAKE_C_COMPILER=x86_64-w64-mingw32-clang \
604565
-DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-clang++ \
605-
-DLIBCXX_TEST_CONFIG="llvm-libc++-mingw.cfg.in" \
606566
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake"
607567
echo "+++ Running the libc++ tests"
608568
${NINJA} -vC "${BUILD_DIR}" check-cxx
@@ -612,7 +572,6 @@ mingw-static)
612572
generate-cmake \
613573
-DCMAKE_C_COMPILER=x86_64-w64-mingw32-clang \
614574
-DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-clang++ \
615-
-DLIBCXX_TEST_CONFIG="llvm-libc++-mingw.cfg.in" \
616575
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake" \
617576
-DLIBCXX_ENABLE_SHARED=OFF \
618577
-DLIBUNWIND_ENABLE_SHARED=OFF

0 commit comments

Comments
 (0)