This commit ensures that we can include all libc++ headers with modules
enabled. It adds a test to ensure that this doesn't regress, which is
necessary because our modules CI job does not build in all Standard modes.
Details
- Reviewers
ldionne EricWF - Group Reviewers
Restricted Project - Commits
- rG643df8fa8ef5: [libc++] Make sure that all headers can be included with modules enabled
Diff Detail
- Repository
- rG LLVM Github Monorepo
Time | Test | |
---|---|---|
19,620 ms | libcxx CI C++03 > llvm-libc++-shared-cfg-in.libcxx::modules_include.sh.cpp Script:
--
: 'RUN: at line 38'; /usr/bin/c++ /home/libcxx-builder/.buildkite-agent/builds/c6f270b094be-1/llvm-project/libcxx-ci/libcxx/test/libcxx/modules_include.sh.cpp --target=x86_64-unknown-linux-gnu -nostdinc++ -I /home/libcxx-builder/.buildkite-agent/builds/c6f270b094be-1/llvm-project/libcxx-ci/build/generic-cxx03/include/c++/v1 -I /home/libcxx-builder/.buildkite-agent/builds/c6f270b094be-1/llvm-project/libcxx-ci/build/generic-cxx03/include/c++/v1 -I /home/libcxx-builder/.buildkite-agent/builds/c6f270b094be-1/llvm-project/libcxx-ci/libcxx/test/support -std=c++03 -Werror -Wall -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-noexcept-type -Wno-atomic-alignment -Wno-user-defined-literals -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -fmodules -gmodules -fcxx-modules -fsyntax-only -DTEST_0
| |
20,250 ms | libcxx CI C++11 > llvm-libc++-shared-cfg-in.libcxx::modules_include.sh.cpp Script:
--
: 'RUN: at line 38'; /usr/bin/c++ /home/libcxx-builder/.buildkite-agent/builds/6c4ee5a01ab8-1/llvm-project/libcxx-ci/libcxx/test/libcxx/modules_include.sh.cpp --target=x86_64-unknown-linux-gnu -nostdinc++ -I /home/libcxx-builder/.buildkite-agent/builds/6c4ee5a01ab8-1/llvm-project/libcxx-ci/build/generic-cxx11/include/c++/v1 -I /home/libcxx-builder/.buildkite-agent/builds/6c4ee5a01ab8-1/llvm-project/libcxx-ci/build/generic-cxx11/include/c++/v1 -I /home/libcxx-builder/.buildkite-agent/builds/6c4ee5a01ab8-1/llvm-project/libcxx-ci/libcxx/test/support -std=c++11 -Werror -Wall -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-noexcept-type -Wno-atomic-alignment -Wno-user-defined-literals -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -fmodules -gmodules -fcxx-modules -fsyntax-only -DTEST_0
| |
190 ms | libcxx CI GCC 11 / C++latest > llvm-libc++-shared-gcc-cfg-in.libcxx::modules_include.sh.cpp Script:
--
: 'RUN: at line 38'; /usr/bin/g++-11 /home/libcxx-builder/.buildkite-agent/builds/b5181d178f5a-1/llvm-project/libcxx-ci/libcxx/test/libcxx/modules_include.sh.cpp -nostdinc++ -I /home/libcxx-builder/.buildkite-agent/builds/b5181d178f5a-1/llvm-project/libcxx-ci/build/generic-gcc/include/c++/v1 -I /home/libcxx-builder/.buildkite-agent/builds/b5181d178f5a-1/llvm-project/libcxx-ci/build/generic-gcc/include/c++/v1 -I /home/libcxx-builder/.buildkite-agent/builds/b5181d178f5a-1/llvm-project/libcxx-ci/libcxx/test/support -std=c++2b -Werror -Wall -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-noexcept-type -Wno-aligned-allocation-unavailable -Wno-atomic-alignment -Wno-sized-deallocation -Wno-literal-suffix -Wno-user-defined-literals -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_DISABLE_AVAILABILITY -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -Wno-placement-new -Wno-class-memaccess -fmodules -gmodules -fcxx-modules -fsyntax-only -DTEST_0
|
Event Timeline
Will ship once CI is complete, I tested and this fixes the LLDB issues on Green Dragon.
libcxx/include/barrier | ||
---|---|---|
54 ↗ | (On Diff #431716) | As a side note, I really don't love that headers are conditionally included. It just makes things weirder for our users, and even for us (it's an easy way to write portability bugs). |
libcxx/include/barrier | ||
---|---|---|
54 ↗ | (On Diff #431716) | I agree -- I think we should only conditionally include headers when including the headers *doesn't* work (i.e. including iostream on a platform that doesn't have localization). Adding a TODO to my list. |
FYI our builders have started running out of disk space, and while investigating the issue we pinpointed it to this change. The problem is that Clang started writing files to [CACHE]/clang/ModuleCache (on Linux that's either ${HOME}/.cache/clang/ModuleCache or ${XDG_CACHE_HOME}/clang/ModuleCache when XDG_CACHE_HOME is set), which on our builders is located on a partition with limited disk space, and a single run of libc++ test suite now generates 3.1G of data. I don't think we need to do anything for this change since Clang is behaving as intended, instead we'll need to make sure that ${XDG_CACHE_HOME} is on a volume with enough space, but I'm still reporting this since it was unexpected and others might run into this issue as well.