[libcxx-commits] [libcxx] 0e26efe - [libc++][C++20 modules] Tests no random device build.

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Tue Aug 22 11:17:01 PDT 2023


Author: Mark de Wever
Date: 2023-08-22T20:16:53+02:00
New Revision: 0e26efe3dca7011ca32cff6e46857efc69732c94

URL: https://github.com/llvm/llvm-project/commit/0e26efe3dca7011ca32cff6e46857efc69732c94
DIFF: https://github.com/llvm/llvm-project/commit/0e26efe3dca7011ca32cff6e46857efc69732c94.diff

LOG: [libc++][C++20 modules] Tests no random device build.

Depends on D158337

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D158347

Added: 
    

Modified: 
    libcxx/cmake/caches/Generic-no-random_device.cmake
    libcxx/docs/Modules.rst
    libcxx/modules/CMakeLists.txt.in
    libcxx/modules/std/random.inc
    libcxx/utils/ci/buildkite-pipeline.yml

Removed: 
    


################################################################################
diff  --git a/libcxx/cmake/caches/Generic-no-random_device.cmake b/libcxx/cmake/caches/Generic-no-random_device.cmake
index e9b4cc60cc80ea..adfa2458a8edf6 100644
--- a/libcxx/cmake/caches/Generic-no-random_device.cmake
+++ b/libcxx/cmake/caches/Generic-no-random_device.cmake
@@ -1 +1,2 @@
+set(LIBCXX_ENABLE_STD_MODULES ON CACHE BOOL "") # TODO MODULES Remove when enabled automatically.
 set(LIBCXX_ENABLE_RANDOM_DEVICE OFF CACHE BOOL "")

diff  --git a/libcxx/docs/Modules.rst b/libcxx/docs/Modules.rst
index 37e1161f0716f3..a95b5ef416132c 100644
--- a/libcxx/docs/Modules.rst
+++ b/libcxx/docs/Modules.rst
@@ -46,6 +46,7 @@ What works
    * ``LIBCXX_ENABLE_WIDE_CHARACTERS``
    * ``LIBCXX_ENABLE_THREADS``
    * ``LIBCXX_ENABLE_FILESYSTEM``
+   * ``LIBCXX_ENABLE_RANDOM_DEVICE``
 
 Some of the current limitations
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

diff  --git a/libcxx/modules/CMakeLists.txt.in b/libcxx/modules/CMakeLists.txt.in
index 18e7a7ae53763e..e5fe6e985435fc 100644
--- a/libcxx/modules/CMakeLists.txt.in
+++ b/libcxx/modules/CMakeLists.txt.in
@@ -29,9 +29,6 @@ macro(compile_define_if condition def)
   endif()
 endmacro()
 
-if(NOT @LIBCXX_ENABLE_RANDOM_DEVICE@)
-  message(FATAL_ERROR "Modules without randome device support is not yet implemented.")
-endif()
 if(NOT @LIBCXX_ENABLE_UNICODE@)
   message(FATAL_ERROR "Modules without Unicode support is not yet implemented.")
 endif()

diff  --git a/libcxx/modules/std/random.inc b/libcxx/modules/std/random.inc
index 87758fa949e1f5..0b003fdd8902e4 100644
--- a/libcxx/modules/std/random.inc
+++ b/libcxx/modules/std/random.inc
@@ -42,8 +42,10 @@ export namespace std {
 
   using std::default_random_engine;
 
+#ifndef _LIBCPP_HAS_NO_RANDOM_DEVICE
   // [rand.device], class random_device
   using std::random_device;
+#endif
 
   // [rand.util.seedseq], class seed_seq
   using std::seed_seq;

diff  --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml
index 9aa881c0f5bba5..6ae14eebfe5fb6 100644
--- a/libcxx/utils/ci/buildkite-pipeline.yml
+++ b/libcxx/utils/ci/buildkite-pipeline.yml
@@ -611,8 +611,11 @@ steps:
         - "**/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"


        


More information about the libcxx-commits mailing list