[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
This commit is contained in:
Louis Dionne 2020-11-05 10:47:06 -05:00
parent 99e64623ec
commit bb43a0cd4a
12 changed files with 98 additions and 16 deletions

View File

@ -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()...>;

View File

@ -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>

View File

@ -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>

View File

@ -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

View File

@ -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...>>;

View File

@ -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>

View File

@ -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>

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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++