Skip to content

Commit d06ae33

Browse files
authored
[libc++][modules] Removes module testing. (llvm#76083)
This removes the entire modules testing infrastructure. The current infrastructure uses CMake to generate the std and std.compat module. This requires quite a bit of plumbing and uses CMake. Since CMake introduced module support in CMake 3.26, modules have a higher CMake requirement than the rest of the LLVM project. (The LLVM project requires 3.20.) The main motivation for this approach was how libc++ generated its modules. Every header had its own module partition. This was changed to improve performance and now only two modules remain. The code to build these can be manually crafted. A followup patch will reenable testing modules, using a different approach.
1 parent d89a0a6 commit d06ae33

27 files changed

+13
-291
lines changed

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ concurrency:
3535

3636

3737
env:
38-
CMAKE: "/opt/bin/cmake"
3938
# LLVM POST-BRANCH bump version
4039
# LLVM POST-BRANCH add compiler test for ToT - 1, e.g. "Clang 17"
4140
# LLVM RELEASE bump remove compiler ToT - 3, e.g. "Clang 15"
@@ -169,24 +168,18 @@ jobs:
169168
'bootstrapping-build'
170169
]
171170
machine: [ 'libcxx-runners-8-set' ]
172-
std_modules: [ 'OFF' ]
173171
include:
174172
- config: 'generic-cxx26'
175173
machine: libcxx-runners-8-set
176-
std_modules: 'ON'
177174
- config: 'generic-asan'
178175
machine: libcxx-runners-8-set
179-
std_modules: 'OFF'
180176
- config: 'generic-tsan'
181177
machine: libcxx-runners-8-set
182-
std_modules: 'OFF'
183178
- config: 'generic-ubsan'
184179
machine: libcxx-runners-8-set
185-
std_modules: 'OFF'
186180
# Use a larger machine for MSAN to avoid timeout and memory allocation issues.
187181
- config: 'generic-msan'
188182
machine: libcxx-runners-8-set
189-
std_modules: 'OFF'
190183
runs-on: ${{ matrix.machine }}
191184
steps:
192185
- uses: actions/checkout@v4
@@ -196,7 +189,6 @@ jobs:
196189
CC: clang-18
197190
CXX: clang++-18
198191
ENABLE_CLANG_TIDY: "OFF"
199-
ENABLE_STD_MODULES: ${{ matrix.std_modules }}
200192
- uses: actions/upload-artifact@v3
201193
if: always()
202194
with:

libcxx/CMakeLists.txt

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,6 @@ option(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS
117117
the shared library they shipped should turn this on and see `include/__availability`
118118
for more details." OFF)
119119
option(LIBCXX_ENABLE_CLANG_TIDY "Whether to compile and run clang-tidy checks" OFF)
120-
# TODO MODULES Remove this option and test for the requirements (CMake/Clang) instead.
121-
option(LIBCXX_ENABLE_STD_MODULES
122-
"Whether to enable the building the C++23 `std` module. This feature is
123-
experimental and has additional dependencies. Only enable this when
124-
interested in testing or developing this module. See
125-
https://libcxx.llvm.org/Modules.html for more information." OFF)
126120

127121
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
128122
set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-shared-gcc.cfg.in")
@@ -772,7 +766,6 @@ config_define_if_not(LIBCXX_ENABLE_RANDOM_DEVICE _LIBCPP_HAS_NO_RANDOM_DEVICE)
772766
config_define_if_not(LIBCXX_ENABLE_LOCALIZATION _LIBCPP_HAS_NO_LOCALIZATION)
773767
config_define_if_not(LIBCXX_ENABLE_UNICODE _LIBCPP_HAS_NO_UNICODE)
774768
config_define_if_not(LIBCXX_ENABLE_WIDE_CHARACTERS _LIBCPP_HAS_NO_WIDE_CHARACTERS)
775-
config_define_if_not(LIBCXX_ENABLE_STD_MODULES _LIBCPP_HAS_NO_STD_MODULES)
776769
config_define_if_not(LIBCXX_ENABLE_TIME_ZONE_DATABASE _LIBCPP_HAS_NO_TIME_ZONE_DATABASE)
777770
config_define_if_not(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)
778771

@@ -856,19 +849,15 @@ endfunction()
856849
add_subdirectory(include)
857850
add_subdirectory(src)
858851
add_subdirectory(utils)
859-
if (LIBCXX_ENABLE_STD_MODULES)
860-
add_subdirectory(modules)
861-
endif()
852+
add_subdirectory(modules)
862853

863854
set(LIBCXX_TEST_DEPS "cxx_experimental")
864855

865856
if (LIBCXX_ENABLE_CLANG_TIDY)
866857
list(APPEND LIBCXX_TEST_DEPS cxx-tidy)
867858
endif()
868859

869-
if (LIBCXX_ENABLE_STD_MODULES)
870-
list(APPEND LIBCXX_TEST_DEPS generate-cxx-modules generate-test-module-std)
871-
endif()
860+
list(APPEND LIBCXX_TEST_DEPS generate-cxx-modules)
872861

873862
if (LIBCXX_INCLUDE_BENCHMARKS)
874863
add_subdirectory(benchmarks)
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
set(LIBCXX_ENABLE_STD_MODULES ON CACHE BOOL "") # TODO MODULES Remove when enabled automatically.
21
set(LIBCXX_TEST_PARAMS "std=c++26" CACHE STRING "")
32
set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
set(LIBCXX_ENABLE_STD_MODULES ON CACHE BOOL "") # TODO MODULES Remove when enabled automatically.
21
set(LIBCXX_HARDENING_MODE "extensive" CACHE STRING "")
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
set(LIBCXX_ENABLE_STD_MODULES ON CACHE BOOL "") # TODO MODULES Remove when enabled automatically.
21
set(LIBCXX_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
32
set(LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
set(LIBCXX_ENABLE_STD_MODULES ON CACHE BOOL "") # TODO MODULES Remove when enabled automatically.
21
set(LIBCXX_TEST_PARAMS "enable_experimental=False" CACHE STRING "")
32
set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
set(LIBCXX_ENABLE_STD_MODULES ON CACHE BOOL "") # TODO MODULES Remove when enabled automatically.
21
set(LIBCXX_ENABLE_FILESYSTEM OFF CACHE BOOL "")
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
set(LIBCXX_ENABLE_STD_MODULES ON CACHE BOOL "") # TODO MODULES Remove when enabled automatically.
21
set(LIBCXX_ENABLE_LOCALIZATION OFF CACHE BOOL "")
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
set(LIBCXX_ENABLE_STD_MODULES ON CACHE BOOL "") # TODO MODULES Remove when enabled automatically.
21
set(LIBCXX_ENABLE_RANDOM_DEVICE OFF CACHE BOOL "")
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
set(LIBCXX_ENABLE_STD_MODULES ON CACHE BOOL "") # TODO MODULES Remove when enabled automatically.
21
set(LIBCXX_ENABLE_THREADS OFF CACHE BOOL "")
32
set(LIBCXXABI_ENABLE_THREADS OFF CACHE BOOL "")
43
set(LIBCXX_ENABLE_MONOTONIC_CLOCK OFF CACHE BOOL "")

0 commit comments

Comments
 (0)