[libcxx-commits] [libcxx] fd4cc87 - [libc++] Allow backdeployment CI to run on newer macOS

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 15 08:34:26 PST 2022


Author: Louis Dionne
Date: 2022-02-15T11:34:22-05:00
New Revision: fd4cc870225eabdf2885585df55550ad011fcfc5

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

LOG: [libc++] Allow backdeployment CI to run on newer macOS

This should work now that we are using a matching libunwind.dylib when
we run the tests in back-deployment scenarios. The only restriction we
have now is to run on macOS x86_64, since that's what the old dylibs
were compiled for. This should allow us to move to newer AppleClangs
in the CI.

As a fly-by, fix missing availability annotations on optional's
monadic operations.

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

Added: 
    

Modified: 
    libcxx/include/optional
    libcxx/test/std/utilities/optional/optional.monadic/and_then.pass.cpp
    libcxx/test/std/utilities/optional/optional.monadic/transform.pass.cpp
    libcxx/utils/ci/buildkite-pipeline.yml

Removed: 
    


################################################################################
diff  --git a/libcxx/include/optional b/libcxx/include/optional
index 1599efdd32069..aa299f7b2d09e 100644
--- a/libcxx/include/optional
+++ b/libcxx/include/optional
@@ -1043,7 +1043,7 @@ public:
 
 #if _LIBCPP_STD_VER > 20
   template<class _Func>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
   constexpr auto and_then(_Func&& __f) & {
     using _Up = invoke_result_t<_Func, value_type&>;
     static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,
@@ -1054,7 +1054,7 @@ public:
   }
 
   template<class _Func>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
   constexpr auto and_then(_Func&& __f) const& {
     using _Up = invoke_result_t<_Func, const value_type&>;
     static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,
@@ -1065,7 +1065,7 @@ public:
   }
 
   template<class _Func>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
   constexpr auto and_then(_Func&& __f) && {
     using _Up = invoke_result_t<_Func, value_type&&>;
     static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,
@@ -1087,7 +1087,7 @@ public:
   }
 
   template<class _Func>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
   constexpr auto transform(_Func&& __f) & {
     using _Up = remove_cv_t<invoke_result_t<_Func, value_type&>>;
     static_assert(!is_array_v<_Up>, "Result of f(value()) should not be an Array");
@@ -1102,7 +1102,7 @@ public:
   }
 
   template<class _Func>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
   constexpr auto transform(_Func&& __f) const& {
     using _Up = remove_cv_t<invoke_result_t<_Func, const value_type&>>;
     static_assert(!is_array_v<_Up>, "Result of f(value()) should not be an Array");
@@ -1117,7 +1117,7 @@ public:
   }
 
   template<class _Func>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
   constexpr auto transform(_Func&& __f) && {
     using _Up = remove_cv_t<invoke_result_t<_Func, value_type&&>>;
     static_assert(!is_array_v<_Up>, "Result of f(std::move(value())) should not be an Array");
@@ -1132,7 +1132,7 @@ public:
   }
 
   template<class _Func>
-  _LIBCPP_HIDE_FROM_ABI
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
   constexpr auto transform(_Func&& __f) const&& {
     using _Up = remove_cvref_t<invoke_result_t<_Func, const value_type&&>>;
     static_assert(!is_array_v<_Up>, "Result of f(std::move(value())) should not be an Array");

diff  --git a/libcxx/test/std/utilities/optional/optional.monadic/and_then.pass.cpp b/libcxx/test/std/utilities/optional/optional.monadic/and_then.pass.cpp
index 61c61ff737852..a627abd5499e6 100644
--- a/libcxx/test/std/utilities/optional/optional.monadic/and_then.pass.cpp
+++ b/libcxx/test/std/utilities/optional/optional.monadic/and_then.pass.cpp
@@ -7,6 +7,10 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
+
+// Throwing bad_optional_access is supported starting in macosx10.13
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+
 // <optional>
 
 // template<class F> constexpr auto and_then(F&&) &;

diff  --git a/libcxx/test/std/utilities/optional/optional.monadic/transform.pass.cpp b/libcxx/test/std/utilities/optional/optional.monadic/transform.pass.cpp
index 209c8a34da050..11783afe0b566 100644
--- a/libcxx/test/std/utilities/optional/optional.monadic/transform.pass.cpp
+++ b/libcxx/test/std/utilities/optional/optional.monadic/transform.pass.cpp
@@ -7,6 +7,10 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
+
+// Throwing bad_optional_access is supported starting in macosx10.13
+// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
+
 // <optional>
 
 // template<class F> constexpr auto transform(F&&) &;

diff  --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml
index ae4c07aa27a04..bd66db0fe1457 100644
--- a/libcxx/utils/ci/buildkite-pipeline.yml
+++ b/libcxx/utils/ci/buildkite-pipeline.yml
@@ -616,8 +616,8 @@ steps:
         - "**/test-results.xml"
       agents:
         queue: "libcxx-builders"
-        os: "macos10.15" # TODO: For now, we're running the back-deployment tests for 10.9 on 10.15, because we don't have proper 10.9 machines
-        arch: "x86_64"
+        os: "macos"
+        arch: "x86_64" # We need to use x86_64 for back-deployment CI, since the old dylibs were compiled for x86_64
       retry:
         automatic:
           - exit_status: -1  # Agent was lost
@@ -630,8 +630,8 @@ steps:
         - "**/test-results.xml"
       agents:
         queue: "libcxx-builders"
-        os: "macos10.15"
-        arch: "x86_64"
+        os: "macos"
+        arch: "x86_64" # We need to use x86_64 for back-deployment CI, since the old dylibs were compiled for x86_64
       retry:
         automatic:
           - exit_status: -1  # Agent was lost


        


More information about the libcxx-commits mailing list