[libcxx-commits] [libcxx] bb43a0c - [libc++] Add a Buildkite job that tests back-deployment on Apple

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Nov 5 15:27:27 PST 2020


Author: Louis Dionne
Date: 2020-11-05T18:26:08-05:00
New Revision: bb43a0cd4adc4f1fa12e0d2fd1fe9aa6b5c00e34

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

LOG: [libc++] Add a Buildkite job that tests back-deployment on Apple

The current way we test this is pretty cheap, i.e. we download previously
released macOS dylibs and run against that. Ideally, we would require a
full host running the appropriate version of macOS, and we'd execute the
tests using SSH on that host. But since we don't have such hosts available
easily for now, this is better than nothing.

At the same time, also fix some tests that were failing when back
deploying.

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

Added: 
    

Modified: 
    libcxx/include/variant
    libcxx/test/libcxx/thread/thread.condition/PR30202_notify_from_pthread_created_thread.pass.cpp
    libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp
    libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.signals.pass.cpp
    libcxx/test/std/utilities/variant/variant.hash/hash.pass.cpp
    libcxx/test/std/utilities/variant/variant.relops/relops.pass.cpp
    libcxx/test/std/utilities/variant/variant.relops/relops_bool_conv.fail.cpp
    libcxx/test/std/utilities/variant/variant.variant/variant.dtor/dtor.pass.cpp
    libcxx/test/std/utilities/variant/variant.variant/variant.status/index.pass.cpp
    libcxx/test/std/utilities/variant/variant.variant/variant.status/valueless_by_exception.pass.cpp
    libcxx/utils/ci/buildkite-pipeline.yml
    libcxx/utils/ci/run-buildbot.sh

Removed: 
    


################################################################################
diff  --git a/libcxx/include/variant b/libcxx/include/variant
index 0830d3dde1b7..16ab033894b6 100644
--- a/libcxx/include/variant
+++ b/libcxx/include/variant
@@ -521,7 +521,7 @@ struct __indices {
 };
 
 template <size_t... _Ns, class _Fp, class _Rp, class... _Args>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS
 static constexpr auto __make_vtable_impl(_Fp __f, _Rp (*)(_Args...)) {
   array<_Rp (*)(_Args...), (1 * ... * _Ns) + 1> __result = {
       [](_Args...) -> _Rp { __throw_bad_variant_access(); }
@@ -552,7 +552,7 @@ struct __base {
   };
 
   template <class _Vis, class _Vp, class _Wp>
-  inline _LIBCPP_INLINE_VISIBILITY
+  inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS
   static constexpr decltype(auto)
   __visit_alt_at(size_t __index, _Vis&& __vis, _Vp&& __v, _Wp&& __w) {
     constexpr size_t __size = __uncvref_t<_Vp>::__size();
@@ -598,7 +598,7 @@ struct __base {
   }
 
   template <size_t... _Is, class _Vis, class... _Vs>
-  inline _LIBCPP_INLINE_VISIBILITY
+  inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS
   static constexpr decltype(auto)
   __visit_alt_impl(index_sequence<_Is...>, _Vis&& __vis, _Vs&&... __vs) {
     using __multi = __multi<__uncvref_t<_Vs>::__size()...>;

diff  --git a/libcxx/test/libcxx/thread/thread.condition/PR30202_notify_from_pthread_created_thread.pass.cpp b/libcxx/test/libcxx/thread/thread.condition/PR30202_notify_from_pthread_created_thread.pass.cpp
index 824daba3fdbc..9c7879c811e0 100644
--- a/libcxx/test/libcxx/thread/thread.condition/PR30202_notify_from_pthread_created_thread.pass.cpp
+++ b/libcxx/test/libcxx/thread/thread.condition/PR30202_notify_from_pthread_created_thread.pass.cpp
@@ -13,13 +13,18 @@
 // unique_lock.
 // UNSUPPORTED: c++03
 
+// PR30202 was fixed starting in macosx10.13.
+// UNSUPPORTED: with_system_cxx_lib=macosx10.12
+// UNSUPPORTED: with_system_cxx_lib=macosx10.11
+// UNSUPPORTED: with_system_cxx_lib=macosx10.10
+// UNSUPPORTED: with_system_cxx_lib=macosx10.9
+
 // <condition_variable>
 
-// void
-//   notify_all_at_thread_exit(condition_variable& cond, unique_lock<mutex> lk);
+// void notify_all_at_thread_exit(condition_variable& cond, unique_lock<mutex> lk);
 
 // Test that this function works with threads that were not created by
-// std::thread. See: https://bugs.llvm.org/show_bug.cgi?id=30202
+// std::thread. See https://llvm.org/PR30202
 
 
 #include <condition_variable>

diff  --git a/libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp b/libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp
index 593d9a4bf4fd..0f7c48e04cd8 100644
--- a/libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp
+++ b/libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp
@@ -8,12 +8,12 @@
 
 // UNSUPPORTED: libcpp-has-no-threads
 
-// Until 58a0a70fb2f1, this_thread::sleep_for could get interrupted by
-// signals and this test would fail. Disable the test on the corresponding
-// system libraries.
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
+// Until 58a0a70fb2f1, this_thread::sleep_for could sometimes get interrupted
+// by signals and this test would fail spuriously. Disable the test on the
+// corresponding system libraries.
+// UNSUPPORTED: with_system_cxx_lib=macosx10.11
+// UNSUPPORTED: with_system_cxx_lib=macosx10.10
+// UNSUPPORTED: with_system_cxx_lib=macosx10.9
 
 // <thread>
 

diff  --git a/libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.signals.pass.cpp b/libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.signals.pass.cpp
index 469dfc40919e..9d6f995ff584 100644
--- a/libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.signals.pass.cpp
+++ b/libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.signals.pass.cpp
@@ -11,9 +11,9 @@
 // This test uses the POSIX header <sys/time.h> which Windows doesn't provide
 // UNSUPPORTED: windows
 
-// Until 58a0a70fb2f1, this_thread::sleep_for could get interrupted by
-// signals and this test would fail. Disable the test on the corresponding
-// system libraries.
+// Until 58a0a70fb2f1, this_thread::sleep_for misbehaves when interrupted by
+// a signal, as tested here. Disable the test on the corresponding system
+// libraries.
 // XFAIL: with_system_cxx_lib=macosx10.11
 // XFAIL: with_system_cxx_lib=macosx10.10
 // XFAIL: with_system_cxx_lib=macosx10.9

diff  --git a/libcxx/test/std/utilities/variant/variant.hash/hash.pass.cpp b/libcxx/test/std/utilities/variant/variant.hash/hash.pass.cpp
index 7e4740b05d47..cdadd6eff43e 100644
--- a/libcxx/test/std/utilities/variant/variant.hash/hash.pass.cpp
+++ b/libcxx/test/std/utilities/variant/variant.hash/hash.pass.cpp
@@ -9,6 +9,12 @@
 
 // UNSUPPORTED: c++03, c++11, c++14
 
+// Throwing bad_variant_access is supported starting in macosx10.13
+// XFAIL: with_system_cxx_lib=macosx10.12 && !no-exceptions
+// XFAIL: with_system_cxx_lib=macosx10.11 && !no-exceptions
+// XFAIL: with_system_cxx_lib=macosx10.10 && !no-exceptions
+// XFAIL: with_system_cxx_lib=macosx10.9 && !no-exceptions
+
 // <variant>
 
 // template <class... Types> struct hash<variant<Types...>>;

diff  --git a/libcxx/test/std/utilities/variant/variant.relops/relops.pass.cpp b/libcxx/test/std/utilities/variant/variant.relops/relops.pass.cpp
index d5dd7cffac35..fa681616758b 100644
--- a/libcxx/test/std/utilities/variant/variant.relops/relops.pass.cpp
+++ b/libcxx/test/std/utilities/variant/variant.relops/relops.pass.cpp
@@ -9,6 +9,12 @@
 
 // UNSUPPORTED: c++03, c++11, c++14
 
+// Throwing bad_variant_access is supported starting in macosx10.13
+// XFAIL: with_system_cxx_lib=macosx10.12 && !no-exceptions
+// XFAIL: with_system_cxx_lib=macosx10.11 && !no-exceptions
+// XFAIL: with_system_cxx_lib=macosx10.10 && !no-exceptions
+// XFAIL: with_system_cxx_lib=macosx10.9 && !no-exceptions
+
 // <variant>
 
 // template <class ...Types>

diff  --git a/libcxx/test/std/utilities/variant/variant.relops/relops_bool_conv.fail.cpp b/libcxx/test/std/utilities/variant/variant.relops/relops_bool_conv.fail.cpp
index eab6cc114540..9c4726a8b94b 100644
--- a/libcxx/test/std/utilities/variant/variant.relops/relops_bool_conv.fail.cpp
+++ b/libcxx/test/std/utilities/variant/variant.relops/relops_bool_conv.fail.cpp
@@ -9,6 +9,12 @@
 
 // UNSUPPORTED: c++03, c++11, c++14
 
+// Throwing bad_variant_access is supported starting in macosx10.13
+// XFAIL: with_system_cxx_lib=macosx10.12 && !no-exceptions
+// XFAIL: with_system_cxx_lib=macosx10.11 && !no-exceptions
+// XFAIL: with_system_cxx_lib=macosx10.10 && !no-exceptions
+// XFAIL: with_system_cxx_lib=macosx10.9 && !no-exceptions
+
 // <variant>
 
 // template <class ...Types>

diff  --git a/libcxx/test/std/utilities/variant/variant.variant/variant.dtor/dtor.pass.cpp b/libcxx/test/std/utilities/variant/variant.variant/variant.dtor/dtor.pass.cpp
index 9ba593c41fcf..3c0eff5a096e 100644
--- a/libcxx/test/std/utilities/variant/variant.variant/variant.dtor/dtor.pass.cpp
+++ b/libcxx/test/std/utilities/variant/variant.variant/variant.dtor/dtor.pass.cpp
@@ -9,6 +9,12 @@
 
 // UNSUPPORTED: c++03, c++11, c++14
 
+// Throwing bad_variant_access is supported starting in macosx10.13
+// XFAIL: with_system_cxx_lib=macosx10.12 && !no-exceptions
+// XFAIL: with_system_cxx_lib=macosx10.11 && !no-exceptions
+// XFAIL: with_system_cxx_lib=macosx10.10 && !no-exceptions
+// XFAIL: with_system_cxx_lib=macosx10.9 && !no-exceptions
+
 // <variant>
 
 // template <class ...Types> class variant;

diff  --git a/libcxx/test/std/utilities/variant/variant.variant/variant.status/index.pass.cpp b/libcxx/test/std/utilities/variant/variant.variant/variant.status/index.pass.cpp
index 51656d7df0c7..2abb124af666 100644
--- a/libcxx/test/std/utilities/variant/variant.variant/variant.status/index.pass.cpp
+++ b/libcxx/test/std/utilities/variant/variant.variant/variant.status/index.pass.cpp
@@ -9,6 +9,12 @@
 
 // UNSUPPORTED: c++03, c++11, c++14
 
+// Throwing bad_variant_access is supported starting in macosx10.13
+// XFAIL: with_system_cxx_lib=macosx10.12 && !no-exceptions
+// XFAIL: with_system_cxx_lib=macosx10.11 && !no-exceptions
+// XFAIL: with_system_cxx_lib=macosx10.10 && !no-exceptions
+// XFAIL: with_system_cxx_lib=macosx10.9 && !no-exceptions
+
 // <variant>
 
 // template <class ...Types> class variant;

diff  --git a/libcxx/test/std/utilities/variant/variant.variant/variant.status/valueless_by_exception.pass.cpp b/libcxx/test/std/utilities/variant/variant.variant/variant.status/valueless_by_exception.pass.cpp
index 9843f572f5c2..521683b2fd43 100644
--- a/libcxx/test/std/utilities/variant/variant.variant/variant.status/valueless_by_exception.pass.cpp
+++ b/libcxx/test/std/utilities/variant/variant.variant/variant.status/valueless_by_exception.pass.cpp
@@ -9,6 +9,12 @@
 
 // UNSUPPORTED: c++03, c++11, c++14
 
+// Throwing bad_variant_access is supported starting in macosx10.13
+// XFAIL: with_system_cxx_lib=macosx10.12 && !no-exceptions
+// XFAIL: with_system_cxx_lib=macosx10.11 && !no-exceptions
+// XFAIL: with_system_cxx_lib=macosx10.10 && !no-exceptions
+// XFAIL: with_system_cxx_lib=macosx10.9 && !no-exceptions
+
 // <variant>
 
 // template <class ...Types> class variant;

diff  --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml
index faa108156dee..9d560f6c14b9 100644
--- a/libcxx/utils/ci/buildkite-pipeline.yml
+++ b/libcxx/utils/ci/buildkite-pipeline.yml
@@ -257,3 +257,15 @@ steps:
       automatic:
         - exit_status: -1  # Agent was lost
           limit: 2
+
+  # Test back-deployment to older Apple platforms
+  - label: "Apple back-deployment macosx10.9"
+    command: "libcxx/utils/ci/run-buildbot.sh x86_64-apple-system-backdeployment-10.9"
+    artifact_paths:
+      - "**/test-results.xml"
+    agents:
+      queue: "libcxx-macos-builders"
+    retry:
+      automatic:
+        - exit_status: -1  # Agent was lost
+          limit: 2

diff  --git a/libcxx/utils/ci/run-buildbot.sh b/libcxx/utils/ci/run-buildbot.sh
index 5502cde7c704..f22d2a69cc79 100755
--- a/libcxx/utils/ci/run-buildbot.sh
+++ b/libcxx/utils/ci/run-buildbot.sh
@@ -25,7 +25,14 @@ function generate-cmake() {
           -DLLVM_ENABLE_PROJECTS="libcxx;libunwind;libcxxabi" \
           -DLLVM_LIT_ARGS="-sv --show-unsupported --xunit-xml-output test-results.xml" \
           -DLIBCXX_CXX_ABI=libcxxabi \
-          ${@}
+          "${@}"
+}
+
+function download-osx-roots() {
+  echo "--- Downloading previous macOS dylibs"
+  PREVIOUS_DYLIBS_URL="http://lab.llvm.org:8080/roots/libcxx-roots.tar.gz"
+  mkdir -p "${BUILD_DIR}/macos-roots"
+  curl "${PREVIOUS_DYLIBS_URL}" | tar -xz --strip-components=1 -C "${BUILD_DIR}/macos-roots"
 }
 
 function check-cxx-cxxabi() {
@@ -163,6 +170,28 @@ x86_64-apple-system-noexceptions)
                    -DLIBCXXABI_ENABLE_EXCEPTIONS=OFF
     check-cxx-cxxabi
 ;;
+x86_64-apple-system-backdeployment-*)
+  DEPLOYMENT_TARGET="${BUILDER#x86_64-apple-system-backdeployment-}"
+  PARAMS="target_triple=x86_64-apple-macosx${DEPLOYMENT_TARGET}"
+  PARAMS+=";cxx_runtime_root=${BUILD_DIR}/macos-roots/macOS/libc++/${DEPLOYMENT_TARGET}"
+  PARAMS+=";abi_library_path=${BUILD_DIR}/macos-roots/macOS/libc++abi/${DEPLOYMENT_TARGET}"
+  PARAMS+=";use_system_cxx_lib=True"
+  # Filesystem is supported on Apple platforms starting with macosx10.15.
+  if [[ ${DEPLOYMENT_TARGET} =~ ^10.9|10.10|10.11|10.12|10.13|10.14$ ]]; then
+      PARAMS+=";enable_filesystem=False"
+  fi
+
+  export CC=clang
+  export CXX=clang++
+  generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \
+                 -DLIBCXX_TEST_PARAMS="${PARAMS}" \
+                 -DLIBCXXABI_TEST_PARAMS="${PARAMS}"
+  download-osx-roots
+
+  # TODO: Also run the libc++abi tests
+  echo "+++ Running the libc++ tests"
+  ninja -C "${BUILD_DIR}" check-cxx
+;;
 benchmarks)
     export CC=clang
     export CXX=clang++


        


More information about the libcxx-commits mailing list