Skip to content

Commit fd4cc87

Browse files
committed
[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
1 parent 690287b commit fd4cc87

File tree

4 files changed

+19
-11
lines changed

4 files changed

+19
-11
lines changed

libcxx/include/optional

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@ public:
10431043

10441044
#if _LIBCPP_STD_VER > 20
10451045
template<class _Func>
1046-
_LIBCPP_HIDE_FROM_ABI
1046+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
10471047
constexpr auto and_then(_Func&& __f) & {
10481048
using _Up = invoke_result_t<_Func, value_type&>;
10491049
static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,
@@ -1054,7 +1054,7 @@ public:
10541054
}
10551055

10561056
template<class _Func>
1057-
_LIBCPP_HIDE_FROM_ABI
1057+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
10581058
constexpr auto and_then(_Func&& __f) const& {
10591059
using _Up = invoke_result_t<_Func, const value_type&>;
10601060
static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,
@@ -1065,7 +1065,7 @@ public:
10651065
}
10661066

10671067
template<class _Func>
1068-
_LIBCPP_HIDE_FROM_ABI
1068+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
10691069
constexpr auto and_then(_Func&& __f) && {
10701070
using _Up = invoke_result_t<_Func, value_type&&>;
10711071
static_assert(__is_std_optional<remove_cvref_t<_Up>>::value,
@@ -1087,7 +1087,7 @@ public:
10871087
}
10881088

10891089
template<class _Func>
1090-
_LIBCPP_HIDE_FROM_ABI
1090+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
10911091
constexpr auto transform(_Func&& __f) & {
10921092
using _Up = remove_cv_t<invoke_result_t<_Func, value_type&>>;
10931093
static_assert(!is_array_v<_Up>, "Result of f(value()) should not be an Array");
@@ -1102,7 +1102,7 @@ public:
11021102
}
11031103

11041104
template<class _Func>
1105-
_LIBCPP_HIDE_FROM_ABI
1105+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
11061106
constexpr auto transform(_Func&& __f) const& {
11071107
using _Up = remove_cv_t<invoke_result_t<_Func, const value_type&>>;
11081108
static_assert(!is_array_v<_Up>, "Result of f(value()) should not be an Array");
@@ -1117,7 +1117,7 @@ public:
11171117
}
11181118

11191119
template<class _Func>
1120-
_LIBCPP_HIDE_FROM_ABI
1120+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
11211121
constexpr auto transform(_Func&& __f) && {
11221122
using _Up = remove_cv_t<invoke_result_t<_Func, value_type&&>>;
11231123
static_assert(!is_array_v<_Up>, "Result of f(std::move(value())) should not be an Array");
@@ -1132,7 +1132,7 @@ public:
11321132
}
11331133

11341134
template<class _Func>
1135-
_LIBCPP_HIDE_FROM_ABI
1135+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_OPTIONAL_ACCESS
11361136
constexpr auto transform(_Func&& __f) const&& {
11371137
using _Up = remove_cvref_t<invoke_result_t<_Func, const value_type&&>>;
11381138
static_assert(!is_array_v<_Up>, "Result of f(std::move(value())) should not be an Array");

libcxx/test/std/utilities/optional/optional.monadic/and_then.pass.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
//===----------------------------------------------------------------------===//
88

99
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
10+
11+
// Throwing bad_optional_access is supported starting in macosx10.13
12+
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
13+
1014
// <optional>
1115

1216
// template<class F> constexpr auto and_then(F&&) &;

libcxx/test/std/utilities/optional/optional.monadic/transform.pass.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
//===----------------------------------------------------------------------===//
88

99
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
10+
11+
// Throwing bad_optional_access is supported starting in macosx10.13
12+
// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} && !no-exceptions
13+
1014
// <optional>
1115

1216
// template<class F> constexpr auto transform(F&&) &;

libcxx/utils/ci/buildkite-pipeline.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -616,8 +616,8 @@ steps:
616616
- "**/test-results.xml"
617617
agents:
618618
queue: "libcxx-builders"
619-
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
620-
arch: "x86_64"
619+
os: "macos"
620+
arch: "x86_64" # We need to use x86_64 for back-deployment CI, since the old dylibs were compiled for x86_64
621621
retry:
622622
automatic:
623623
- exit_status: -1 # Agent was lost
@@ -630,8 +630,8 @@ steps:
630630
- "**/test-results.xml"
631631
agents:
632632
queue: "libcxx-builders"
633-
os: "macos10.15"
634-
arch: "x86_64"
633+
os: "macos"
634+
arch: "x86_64" # We need to use x86_64 for back-deployment CI, since the old dylibs were compiled for x86_64
635635
retry:
636636
automatic:
637637
- exit_status: -1 # Agent was lost

0 commit comments

Comments
 (0)