diff --git a/libcxx/cmake/caches/Generic-no-filesystem.cmake b/libcxx/cmake/caches/Generic-no-filesystem.cmake --- a/libcxx/cmake/caches/Generic-no-filesystem.cmake +++ b/libcxx/cmake/caches/Generic-no-filesystem.cmake @@ -1 +1,2 @@ +set(LIBCXX_ENABLE_STD_MODULES ON CACHE BOOL "") # TODO MODULES Remove when enabled automatically. set(LIBCXX_ENABLE_FILESYSTEM OFF CACHE BOOL "") diff --git a/libcxx/docs/Modules.rst b/libcxx/docs/Modules.rst --- a/libcxx/docs/Modules.rst +++ b/libcxx/docs/Modules.rst @@ -45,6 +45,7 @@ * ``LIBCXX_ENABLE_LOCALIZATION`` * ``LIBCXX_ENABLE_WIDE_CHARACTERS`` * ``LIBCXX_ENABLE_THREADS`` + * ``LIBCXX_ENABLE_FILESYSTEM`` Some of the current limitations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/libcxx/modules/CMakeLists.txt.in b/libcxx/modules/CMakeLists.txt.in --- a/libcxx/modules/CMakeLists.txt.in +++ b/libcxx/modules/CMakeLists.txt.in @@ -29,9 +29,6 @@ endif() endmacro() -if(NOT @LIBCXX_ENABLE_FILESYSTEM@) - message(FATAL_ERROR "Modules without filesystem support is not yet implemented.") -endif() if(NOT @LIBCXX_ENABLE_RANDOM_DEVICE@) message(FATAL_ERROR "Modules without randome device support is not yet implemented.") endif() diff --git a/libcxx/modules/std/filesystem.inc b/libcxx/modules/std/filesystem.inc --- a/libcxx/modules/std/filesystem.inc +++ b/libcxx/modules/std/filesystem.inc @@ -18,6 +18,7 @@ // [fs.class.filesystem.error], filesystem errors using std::filesystem::filesystem_error; +#ifndef _LIBCPP_HAS_NO_FILESYSTEM // [fs.class.directory.entry], directory entries using std::filesystem::directory_entry; @@ -30,6 +31,7 @@ // [fs.class.rec.dir.itr], recursive directory iterators using std::filesystem::recursive_directory_iterator; +#endif // _LIBCPP_HAS_NO_FILESYSTEM // [fs.rec.dir.itr.nonmembers], range access for recursive directory iterators @@ -56,6 +58,7 @@ using std::filesystem::operator|=; using std::filesystem::operator~; +#ifndef _LIBCPP_HAS_NO_FILESYSTEM // [fs.op.funcs], filesystem operations using std::filesystem::absolute; using std::filesystem::canonical; @@ -99,10 +102,10 @@ using std::filesystem::symlink_status; using std::filesystem::temp_directory_path; using std::filesystem::weakly_canonical; +#endif // _LIBCPP_HAS_NO_FILESYSTEM // [depr.fs.path.factory] using std::filesystem::u8path; - } // namespace std::filesystem // [fs.path.hash], hash support @@ -111,6 +114,8 @@ } export namespace std::ranges { +#ifndef _LIBCPP_HAS_NO_FILESYSTEM using std::ranges::enable_borrowed_range; using std::ranges::enable_view; +#endif // _LIBCPP_HAS_NO_FILESYSTEM } // namespace std::ranges diff --git a/libcxx/modules/std/fstream.inc b/libcxx/modules/std/fstream.inc --- a/libcxx/modules/std/fstream.inc +++ b/libcxx/modules/std/fstream.inc @@ -11,7 +11,9 @@ #ifndef _LIBCPP_HAS_NO_LOCALIZATION using std::basic_filebuf; +# ifndef _LIBCPP_HAS_NO_FILESYSTEM using std::swap; +# endif using std::filebuf; # ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS diff --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml --- a/libcxx/utils/ci/buildkite-pipeline.yml +++ b/libcxx/utils/ci/buildkite-pipeline.yml @@ -590,8 +590,11 @@ - "**/test-results.xml" - "**/*.abilist" env: - CC: "clang-${LLVM_HEAD_VERSION}" - CXX: "clang++-${LLVM_HEAD_VERSION}" + # Note: Modules require and absolute path for clang-scan-deps + # https://github.com/llvm/llvm-project/issues/61006 + CC: "/usr/lib/llvm-${LLVM_HEAD_VERSION}/bin/clang" + CXX: "/usr/lib/llvm-${LLVM_HEAD_VERSION}/bin/clang++" + CMAKE: "/opt/bin/cmake" ENABLE_CLANG_TIDY: "On" agents: queue: "libcxx-builders"